WatchNon-threaded

Forums » Advanced Editor Forum » Read Thread

Talk about it. Ask for help on it. Compliment it.

[Answered] Countdown with Scripting

11 years ago

I'm making an advanced story game and there's this one section where I want it that you can only click 12 links within that section and then you can only choose one link. If it helps, the storyline is that you're in a mall with friends, and you're cruising the mall, buying items and attempting to find clues to solve a mystery, but you have to make it to the movies on time, so that's why I want it that you can only choose 12 links. Help?

[Answered] Countdown with Scripting

11 years ago

This can be accomplished with variable restrictions for all the links. Basically, you just set a single variable (like TIME as an example) to 12. Have all the links restricted to work only if the player has more than 0 TIME. Each time the player clicks a link, reduce TIME by 1. This represents how much time you have left before the movies, and causes you to lose time as you visit each place. Once the player has clicked a link 12 times, they'll have run out of time, so the only place they can go to is the unrestricted link (the movies).

If you're not sure how to handle this, I'll look into it if you want, though I'm sure others who already know the code will pipe in before then.

[Answered] Countdown with Scripting

11 years ago
Thaedos is precisely right. That's the simplest way to do it. If you know scripting, you can use this script, put it in the global link script:

If the section is between pages 20 and 50 and the page where they go if they run out of time is 51 then:

IF $PAGEID > 19 THEN
BEGIN
IF $PAGEID < 51 THEN
BEGIN
%TIME := %TIME - 1
END
END

IF %TIME = 0
$PAGEDEST := 51

I haven't used the debugger on this so it's likely to be formatted improperly, but you should get the gist. I really suggest doing it the way Thaedos suggested if you don't script though. You don't need scripting for this problem, it's just more convenient.

[Answered] Countdown with Scripting

11 years ago
Whoops, replace $PAGEDEST with $DEST

[Answered] Countdown with Scripting

11 years ago

So you create the variable TIME and set it to 12, and you set it that if the TIME goes below 1 to go to the page where the movie starts?

[Answered] Countdown with Scripting

11 years ago
yeah. And then on each link, lower time by one.