Non-threaded

Forums » Advanced Editor Forum » Read Thread

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

Multiple $DEST routing

2 days ago

It isn't clear from the Scripting Reference, but if I set a $DEST in a page script and the target page script also includes a $DEST redirect, will the chain of pages execute in sequence? Based on Intermediate Scripting I think it might.

Example: Page A uses a $DEST set to direct to Page B. Page B has a $DEST set for page C. When someone hits Page A, will they wind up on Page C with the page script of all three pages processed in A->B->C sequence, or will the $DEST only work to go to Page B and stop there?

A game I'm working on has a "Lose a turn" effect that can happen, in which multiple things get advanced automatically, and it would be great if I could have a "Lose your turn" page that I can bounce to from where ever that could then bounce them either back to Page A or too a small collection of pages for fail states or triggered secondary events. This would let me avoid having to replicate the "Lose a turn" code block on every page where that can happen.

Multiple $DEST routing

yesterday
You might have gotten around to testing this already, but I have a hunch it does not work that way. But then I've never seen $DEST used outside a link script at all so I'd be curious what happens there. My gut is that page scripts can only effect what's on the page and can't move the player to a different one though.

Multiple $DEST routing

yesterday
Yeah I'm going to have to run some tests on this.

Multiple $DEST routing

18 hours ago
Yeah, $DEST can only be used in link scripts. Using it on a page script causes an ASP crash.

Multiple $DEST routing

18 hours ago
You can't use a global script for whatever happens when you lose a turn?

Multiple $DEST routing

16 hours ago
For me it doesn't work as you intended, but it doesn't crash either. I think this article explains why. The page script is only executed after the destination has been chosen.

Multiple $DEST routing

8 hours ago
I did overlook step 5 there. Good catch.

Multiple $DEST routing

16 hours ago
You can fake this effect somewhat with automatically forwarding from one page to the next. Here is a script for that.
You can just copy it into a page and it will automatically forward to follow the desried link. In this example link number 2.

OK it is actually not easy to post the script here, as I seem to be running into some security features. (Although I properly escaped it.)

Multiple $DEST routing

16 hours ago
OK the easiest solution was to put the script on the first page of this game. If you click on the main game link you will see the forwarding happen in action.

Multiple $DEST routing

8 hours ago
Yeah, I am already reworking my approach to move a lot of the pagescript stuff into link scripts. I was wondering about working out a javascript triggering event or other ways to get implement something like what I was hoping for. This will save some time and trouble, thanks.