Non-threaded

Forums » Advanced Editor Forum » Read Thread

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

Repeating page script

4 years ago
Discovered an issue while implementing time variables into my story. I have a stats page item, which when used takes the player to a stats page (hope you’ve kept up by this point). When they go back to the original page, however, the page script repeats and any changes to variables (like time) reoccur.

I know I can set up a variable that switches when the player goes on the stats page. Then any page with a page script I could tell the script not to run if that variable is switched on. Then I can put in the global link to switch the variable off. However, this is long winded as it involves finding pages with page script already on and amending them. Does anyone know a quicker way?

Repeating page script

4 years ago
I think I follow -- can you put the script that makes the changes into the previous action? So instead of being at the start of the page, it's on the action of the previous page? Then it wouldn't be kicked off on the return.

Repeating page script

4 years ago
Yeah I think that would do it and it’s a more elegant solution than what I thought of. It is still a pain because so many links go to various pages via $DEST depending on certain variables, but it’s still easier. Thank you Ogre!

Repeating page script

4 years ago
In the global page script check if they are on any of the pages that time doesn't apply, before applying time.

If it's just a couple of stats pages I don't see why changing them would be long winded though.

Repeating page script

4 years ago
Time is applied on almost every single page, so any use of the stats page will double time changes. And it’s not only time- I have over 10 other variables such as intelligence, charisma, luck etc. that all can change. Along with over 500 pages, many of which have variable changes in the page script, it would take a long time to implement my method or Ogre’s, hence seeking a more elegant solution. If it weren’t such a script-heavy game it would be much easier.

I’m not sure I understand your solution. There isn’t a few stats pages- it’s a stats page item that leads you to a stats page whenever you want to use it. As a result, whenever you use it and go back to the story, the page script repeats.

Repeating page script

4 years ago
Ohh, I was under the impression the bulk of this was done in your global page script.

Yeah, if it's a bunch of individual pages there's no way to get around making the changes individually.