Links in gamebook that run scripts without moving

fogmike
I'm building a game set on a spacecraft, using gamebook mode for various reasons. Early on in the game is a bulkhead blocking access to the bridge, and alongside it, an access panel that when used can lock or unlock the bulkhead.

At the moment I have links off the 'corridor' page to subpages such as 'corridor_exitToBridge' (Go to Bridge) and 'corridor_usePanel' (Use Panel). The first page either moves you through if it is unlocked, or prints 'The bulkhead is sealed' and moves you back to the corridor; while the second changes the relevant variable, prints a quick confirmation message, and moves you back to the corridor.

This isn't ideal - it makes the game play the description of the corridor again. What I want ideally is an in-place system that, when 'Use Panel' link in the corridor is clicked, updates the variable and prints a message (so runs a script) without leaving the room, and that re-displays the links.

So the result should be functionally something like this, using '>(command)' to denote choice of hyperlink:

You are in the corridor, standing before the bulkhead. An access panel glows nearby.

(Go down corridor)
(Go to bridge)
(Use panel)

>Go to bridge

The bulkhead is sealed.

(Go down corridor)
(Go to bridge)
(Use panel)

>Use panel

The panel flashes green and the door clicks.

(Go down corridor)
(Go to bridge)
(Use panel)

>Go to bridge

Workstations gleam in front of you, silent and eerie.

(Examine stations)
(Look out window)
(Exit to corridor)

>Exit to corridor

You are in the corridor, standing before the bulkhead. An access panel glows nearby.

(Go down corridor)
(Go to bridge)
(Use panel)

(Last part included to show that description should be redisplayed upon entering room - so 'first time' scripts are insufficient.)

Can anybody help?

Alex
You could try putting the corridor description inside a {once}, i.e.:


{once:You are in the corridor, standing before the bulkhead. An access panel glows nearby.}


That way the corridor description will only be displayed the first time.

You might be interested in my new project Squiffy https://github.com/textadventures/squiffy - this is exactly why it has "sections" and "passages". In your case, your link to "use panel" would be a passage within the "corridor" section. After clicking the "use panel" link, you could set some flags, run some script or whatever, but the player would still be in the corridor.

fogmike
Afraid {once:} blocks wouldn't work - players would be revisiting the corridor multiple times, and I'd want them to see the initial description if they'd come from a (properly) different location.

Squiffy on the other hand looks really, really cool; and quite possibly just what I'm after. Thanks a lot! I have a lot of experimenting to do now....

This topic is now closed. Topics are closed after 60 days of inactivity.

Support

Forums