Non-threaded

Forums » Advanced Editor Forum » Read Thread

Get help from the experts on variables, scripts, items, and other scary things.

Making a encounter not appear again

10 years ago

Hey, all, I am making a story game (60+ pages in), and I have made it so that when you enter a town, you find a merchant being attacked by some thugs. If the player chooses to kill thugs, how will I make it, so when the player enters that part of town again, the event doesn't repeat?

I am in the advanced editor, and the items and variables are basic. Scripts are not enabled.

Thanks in advance

Making a encounter not appear again

10 years ago

If you don't want to use scripts, you could create a variable like THUGS and have it start at value 1. If the thugs are killed, subtract it by one. Now, every link leading to that area would require two links: one that leads to the encounter with the restriction that THUGS must be 1, and another that doesn't lead to the encounter with the restriction that THUGS must be 0.

I would, however, recommend using link scripts as they're more efficient.

Making a encounter not appear again

10 years ago

Okay, but how do I make it with scripts? I've never scripted in my life :(

Making a encounter not appear again

10 years ago

When scripting is enabled, numbers appear next to your pages (for instance, "[#1] The First Page"). Take note of these page ID numbers.

For every link leading to the area, you would put in a code like this:

IF %THUGS = 1 THEN $DEST := @P[#1] ELSE $DEST := @P[#2]

Replace the [#1] with the page ID number for the thugs encounter and the [#2] with the page ID without the encounter. (For instance if the thug encounter is page #31 then @P[#1] should be @P31).

The script is an "if statement" that checks the variable THUGS. If it's 1, then the destination for the link is set to the encounter. If it isn't, the destination is the page without the encounter. You might want to take a look at the articles The Basics of Scripting and Intermediate Scripting for more info on the scripting language of CYS.

Making a encounter not appear again

10 years ago

Thanks Bradin. I think you saved my story game!

Making a encounter not appear again

10 years ago

Happy to help!

Making a encounter not appear again

10 years ago

Aha, so I still need the "THUG" Variable...my variable list is getting bigger.