Non-threaded

Forums » Advanced Editor Forum » Read Thread

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

scripting question

11 years ago

Ok so I suck badly at doing very complicated things in the advanced editor. Mostly due to my inability to force myself to sit down and read up on all the scripting but anyway...

I need the main char to start with say:

100hp

50bio

The bio is related to food, each time you change page it should go down by 1 unless you 'find food' which should add 5. So basically throughout the game your bio keeps dropping and you keep it topped up with food, if it hits 0 you die. Hp is just if you get into a fight it reduces according to how much damage is done to you.

SO the question: How do I script, or whats the best way to deal with the Bio stat?

scripting question

11 years ago

If the bio stat drops down EACH AND EVERY page, then there's a global link script you can use. It will run every time you click a link. Make sure you have scripting turned to advanced, then just do something like this (in the global link script):

%BIO := %BIO - 1

That would make your BIO stat go down by one each time you click a link. If you wanted to send them to a death page once they hit zero, then you'd do something like this:

%BIO := %BIO - 1

IF %BIO <= 0 THEN
$DEST := @P99

Replace "99" with whatever page number you decide you want your death page to be. This way, once they have 0 food, instead of going to the page they were going to go to, they instead go to a page that tells them they starved or otherwise dead. Keep in mind that with this method, if they only have one food and they click a new link, they would starve. If you wanted them to starve after they hit 0 and then clicked a new page, you'd just do this:

IF %BIO <= 0 THEN
$DEST := @P99

%BIO := %BIO - 1

Just do the check before affecting the variable.

That help?

scripting question

11 years ago

What Killa said. For more help with scripting I recommend reading the articles about scripting in the Help and Info section.