Non-threaded

Forums » Advanced Editor Forum » Read Thread

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

$DEST

14 years ago

is it possible to set a $DEST script as a page script, instead of a link script. ive been doing all my scripts on the pages instead of the links, because the same page can be reached from many links, and this keeps me from writing up the same script for each link, what i want to do is, if the scripting on that page would make a certain variable reach or go  below zero make it redirect them to a different page, but if it doesnt, they continue to the page as normal.

$DEST

14 years ago

It would be apreciated if someone could figure out a way to do that, but i found a work around. Im sorry if you took up your time looking for a solution.

$DEST

14 years ago
I thought you weren't able to change variables at all with page scripts, save for the $PAGETEXT variable?

At least that's what it said in one of alexp's articles. But I'd think you could only do the $DEST in the link script, even if you can change other variables in page. Mainly because link scripts are used second, and you could set $DEST to @P3 on the page script, but once you click a link, it would set to something else anyway, because every link has an inherent $DEST.

$DEST

14 years ago
Oh wow. So I just checked it out, and as it turns out, Solostrike is a big liar! (I thought it was Alexp who wrote the article I was thinking of, but apparently it was Solo)

"A page script is executed after a link is pressed and before the destination page loads. That means variables cannot be manipulated (added, subtracted, etc.), but can be evaluated."

Just look at that. Lies. All of it lies.

I'll go test your $DEST idea now :)

$DEST

14 years ago

Hey, im pretty sure 3J would let you rewrite that article by solo strike if you wanted to. :)

$DEST

14 years ago
Hmm, yea. He's mentioned to me at one point that I could update some articles if I wanted. I'll add it to my list of to dos :D

$DEST

14 years ago
So yea, I checked out the $DEST thing and it does not work. BUT you could do a global link script that changes the $DEST if a certain variable was 1, and then have the page script add to that variable, and it should do the job.

$DEST

14 years ago

That sounds like it could work, the way i did it is like this, normally clicking that link would make you, for example shoot an oponent with an arrow, While the page script would make the varible FOE go down by ten. if the foes health was already ten or less, then this would kill him, but where the problem lies is that your FOE would survive according to the text. So the link that takes you to that page, has script that reads like this

IF %FOE <11 THEN

BEGIN

$DEST := @P82

END

that way if the page script would kill the FOE, then it would take it to a different page entirely, that way the text doesnt tell you your dead enemy is alive, or let him hit you again. instead it takes you to a page that tells you that your arrow killed him.