Non-threaded

Forums » Advanced Editor Forum » Read Thread

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

Going back to a previous page.

7 years ago

Okay, so I have a problem here. I have an item, which is actually a character who follows you; said character can be activated at any point so she'll talk to you and answer your stupid questions, after which you may return to whatever page you were on. (For obvious reasons, you can't ask her stupid questions on certain pages, and instead other things happen if you activate her)

In order to accomplish this, I attempted to use the advanced editor's "Previous Page" link. It doesn't work because the dialogue tree is all pages, too, so it goes like this:

Hallway>talk to person>go back>Hallway. and then you're back in the hallway, but if you ask a question, then:

Hallway>talk to person>ask stupid question>redirect to main screen>go back>back to stupid question. and then you get stuck in a redirect loop. 

So what I'm asking is, is there a way to return the player to the screen they were at before they used the item, even if they chose a branching dialogue option?

Going back to a previous page.

7 years ago

Just use a variable to keep track of the page on which the item was used.

  1. Make a variable named %LASTPAGE
  2. Give your item this script: %LASTPAGE := $PAGEID
  3. Give your "Go back" link this script: $DEST := "@P" + %LASTPAGE

Going back to a previous page.

7 years ago

Coincidentally this is exactly what I needed. Tried it out and it worked perfectly. I was just about to read up on more scripting to try to figure out how to do it or simply ask for help. So you saved me a lot of time messing with it. 

Rather than connect it to an item, I plugged it into a variable-based timer system on a map, where someone can have a conversation pop up wherever they are on the map, and end up back on the same spot without me having to god-mod teleport them to a pre-decided location at the end of the conversation. 

Going back to a previous page.

7 years ago

Thanks! It worked perfectly.