Help needed with links in a gamebook

AmandaLyn11
19 Jul 2015, 05:21
I'm new to Quest and know next to nothing about programming. I'm trying my best, but sometimes it all sounds like gibberish to me. I tried to search the forums for an answer to my probably simple question, but I think I ended up confusing myself even more.

I'm trying to figure out the easiest way to basically backtrack and then block out a link from a list of options when you reach that page again. For example, the player can choose to sneak into the kitchen, talk to a barmaid, or talk to an adventurer. Say the player sneaks into the kitchen first, finds out what he/she needs to, but then has nowhere else to go. So they go back out to the tavern scene they started at, and from there, I want the other two options to be still available, while the first one no longer be a clickable link (or if you click it, it gives you a message that you've already done everything here or something and takes you back to the other options again).

I've tried the "If" script hoping that I can tag each link when a player first chooses that option. Then if the player has seen the page/has a counter, when they get back to the the page that has all the choices, the link they already have followed is just text. Or if they haven't seen that page/have that counter, the link is still viable. That didn't seem to work for multiple "the player has already seen page if" options. It seemed to only spit out the message for the page they did see and didn't show the link for the pages they player hadn't already seen.

I'm wondering if I could somehow use the "first time" script instead to get an active link to disappear after the player has already chosen it and then circled back?

Also, I was wondering if somebody could explain the "Add page link" script, because I think I'm confusing myself over that as well. Every time I try to use it, I get nothing when I try to play through the game. (Or maybe I'm just using it wrong. I was trying to use it above with the "if" script. For example, if have seen page, display message. But if not seen page, add active link for an option for the player to pick.)

Thanks for any help, and patience, you can offer this confused newbie! :D

adammadam
19 Jul 2015, 10:00
use set object flag, when the player leaves the kitchen the first time, set a flag on the player and call it what you like e.g. kitchen. Then for the exit, when entering the kitchen have an if script and have it so if the player has the kitchen flag, it prints a message "youve already explored that way" or whatever you want, if they dont have the flag it moves them into the kitchen (use the move object script and move player to the kitchen).

HegemonKhan
19 Jul 2015, 18:40
this is a bit advanced, as you're going to need to use Attributes to track what pages~paths~options you selected, which you can then use to remove said page~path~option when you go back (via scripting: page type: script or script+text).

Also, just pointing this out, you might want~need them to actually be able to go back to that just visited page~path~option after going back to the previous page~path~option, in case they missed something important, so thus you may not want to remove that page~path~option... depends on your game design, obviously.

I'm not that familiar with GameBook version of quest, unfortunately...

but here's a quasi example:

for every page, the page type should be: script+text

current page: hallway
new page links: kitchen, bathroom, bedroom

in the Text Adventure version, it'd be probably something like this, as a good way to do it:

for every page, it needs these scripts added first:

foreach (page_link_variable, this.page_links_stringlist)
-> if [expression] page_link_variable.visited
->-> list remove (this.page_links_stringlist, page_link_variable)

what this does is:

for *each~all~every* page link choice (via 'page_link_variable' ) of the page you're currently on (via 'this.page_links_stringlist' ), if you'e already visited those pages (via 'if [expression] page_link_variable.visited' ), then remove those page link choices (via 'list remove (this.page_links_stringlist, page_link_variable)' ).

Though, if the page link chocies do exist as a String~Object List Attribute, it won't be called 'page_links_stringlist', so you'll have to use whatever the page link list is actually called.

Pertex
19 Jul 2015, 20:20
You can just use the textprocessor command {if}

{if not Page2.visited:{page:Page2} }

HegemonKhan
20 Jul 2015, 01:30
I still can't figure out... then why this doesn't work... argh:

(I'm just not getting this GameBook version, sighs)

<game name=xxx">
<roomenter type="script">
foreach (page_variable, player.parent.options) {
page_object_variable = GetObject (page_variable)
if (page_object_variable.visited) {
list remove (player.parent.options, page_variable)
}
}
</roomenter>
</game>


oh... wait... does the 'player.parent.options' (the page link stringdictionary) get the 'keys' or the 'values' ??? I assumed it gets the keys (for 'Page1.options: Page2,Page3' ), but if it gets the Values, than that would be why it doesn't work...

is there then a Stringlist of the page links (which would thus get, for Page.options_stringlist, the: 'Page2,Page3' ) ???