Logistics nightmare - need help.

OurJud
31 Oct 2016, 01:32I'm having a problem hiding a link (for which I'm using non-directional exits to create) when certain conditions are met.
When the following sequence from start-up is followed the game behaves as it should (I'm only including the choices for simplicity):
Light fire or Outside (choose Outside)
Gather wood or Shack (choose Gather wood then Shack)
Light fire, Outside or Craft bow and arrow (choose Light fire - Light fire link becomes inactive)
Outside or Craft bow and arrow (choose Outside)
Gather wood or Shack (choose Gather wood then Shack)
Outside or Craft Bow and Arrow (choose Craft bow and arrow - Craft bow and arrow link becomes inactive)
But, if I choose Craft bow and arrow BEFORE Light fire at step 3, then go back outside to gather wood and re-enter the Shack, the Craft Bow and arrow link is live again.
Here's the game: http://textadventures.co.uk/games/view/cvfcxi3f7estiwxujyyvpw/gamebook-test
The Pixie
31 Oct 2016, 08:22You have this:
stop sound
if (GetBoolean(player, "firelit")) {
play sound ("firecrackling3.mp3", false, true)
msg ("Inside a shack. Another winter is drawing in. Room is warm.")
MakeExitInvisible (firetrue)
}
else if (not GetBoolean(player, "firelit")) {
msg ("Inside a shack. Another winter is drawing in. Room is freezing.")
MakeExitVisible (firetrue)
if (Got(wood)) {
MakeExitVisible (gotwood)
}
}
else if (Got(hunting bow)) {
MakeExitInvisible (gotwood)
}
You have three blocks here. The first gets done if the fire is lit, the second if it is not lit, the third when it is neither lit nor not lit!
I would suggest breaking it up so one section handles the fire and another the bow.
stop sound
// Handle the fire
if (GetBoolean(player, "firelit")) {
play sound ("firecrackling3.mp3", false, true)
msg ("Inside a shack. Another winter is drawing in. Room is warm.")
MakeExitInvisible (firetrue)
}
else {
msg ("Inside a shack. Another winter is drawing in. Room is freezing.")
if (Got(wood)) {
MakeExitVisible (firetrue)
}
else {
MakeExitInvisible (firetrue)
}
}
// Handle the bow
if (Got(wood) and not Got(hunting bow)) {
MakeExitInvisible (gotwood)
}
else {
MakeExitInvisible (gotwood)
}

OurJud
31 Oct 2016, 13:03Thank you, but are those last two negative for the bow correct? If I have the wood, but not the bow, the Craft bow and arrow link should be there (because I have the materials need (the wood)?
The Pixie
31 Oct 2016, 13:18Oh, right. Should be:
// Handle the bow
if (Got(wood) and not Got(hunting bow)) {
MakeExitVisible (gotwood)
}
else {
MakeExitInvisible (gotwood)
}

OurJud
31 Oct 2016, 13:28Right, when I change the first Invisible to Visible in the bow section it works beautifully, but I'm having a similar issue with a Hunt for food option that is added to the forest room (triggered when the player crafts the bow inside the shack.
I can get the link to appear and function as desired, but I need it to disappear on subsequent visits to the forest when the player has used it. I can get the link to become inactive, but not disappear like the Light fire one does.
This is how I have it:
msg ("It was a long hunt, but a scrawny rabbit was eventually caught.
")
SetObjectFlagOn (player, "gotfood")
MakeExitInvisible (havebow)
And then in the After entering room under the Scripts tab for Forest, I have:
if (GetBoolean(player, "gotfood")) {
MakeExitInvisible (havebow)
}
As I say, this works in as much as it dactivates the link, but how do I get rid of it altogether like the Light fire link?
The Pixie
31 Oct 2016, 15:11I think the Light fire only disappears because the text is printed out again, it is not disappearing as such from the existing text.

OurJud
31 Oct 2016, 15:18Sorry, I don't know what you mean.
When you gather wood and enter the shack the Light fire option is activated (because you collected wood), but once you've used it to light the fire (then exited to the forest and re-entered the shack) the link has disappeared (because the fire is already lit).
What I don't understand is why I can't do the same with Hunt for food. Once you've used this link it fades and becomes 'dead', but still doesn't disappear altogether on subsequent visits to the forest.