Object use in Gamebook mode?

OurJud
Okay, this is simplified for explanation purposes, but this is the gist of what I want to achieve, if possible.

Location C: You're in a room and need a key to unlock a door.

If you took route B, you will have found the key.

If you took route A, you will arrive at location C without the key (and have to return to route B to get it).

In that my player will arrive at location C whichever route they choose, how do I determine if they have the key or not?

Or am I going about the mapping process all wrong?

jaynabonne
One way:

Decide that there will be a flag called something like "hasKey", which will be true if they have the key. Then make the page on route B be a text+script page, and have its script set the flag. You'll then be able to check it at location C.

What that means in location C is up to your design. (If they don't have the key, can they go back? Or are they forced to go a way that is not the locked door?)

OurJud
OK. So is flagging and the text-script page done through the UI?

jaynabonne
Yes.

You can set the page type using the "Page type" dropdown when you click on a page. It defaults to "Text".

Once you have the page set to either "Script" or "Script + Text", then you will have a Script section where you can add script commands. You will find the commands to set flags on and off under the Variables section. You'll find the "if" script statement under the Scripts section.

If you can describe what you want the behavior to be when they do and don't have the key, I might be able to help with that. I don't know a way to prevent someone from clicking on a link. So you might have to dynamically add and remove the link through the locked door depending on the key - or have the page the door link goes to check if they have the key and then send them back if not. (That might be cleaner for the user. That way they still have the link to click on, but it won't let them move on.) You could do that with a routing script-only page that either sends the player on if they have the key or back if not.

OurJud
Thanks, JB. I shall no doubt require some assistance when I reach such a juncture.

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

Support

Forums