Move to different passages based on attribute

Hi folks

I'm new to Squiffy so playing around with a basic game to get to grips with things and have hit a snag. I have a scenario where a "knife" attribute is set earlier in one section and then I want to move the outcome of a fight to one of two passages based on whether the character has picked up the knife. I'm using the following:

[[JailerFight]]:
{if knife=1:[Kill Jailer]}{else:[Killed by Jailer]}
[Kill Jailer]:
You kill the jailer
[Killed by Jailer]:
The jailer kills you

but when I run the game (and I've got the knife) I get a link to the "Kill Jailer" passage rather than the text of the passage. I can click that link and then see the text, but I want to move straight to "You kill the jailer" appearing.

What am I missing?

Thanks in advance.


You could do this:

The jailer pounces, murder in his eyes. It's the [knife](JailerFight, knife=1) or your [fists](JailerFight). 

[JailerFight]:
{if knife=1:{Kill Jailer}}{else:{Killed by Jailer}}

[Kill Jailer]:
You kill the jailer
[Killed by Jailer]:
The jailer kills you

If you want to move the action to one place or another, you'll need to use sections rather than passages, such as...

[[JailerFight]]:
{if knife=1:[[Kill Jailer]]}{else:[[Killed by Jailer]]}
[[Kill Jailer]]:
You kill the jailer
[[Killed by Jailer]]:
The jailer kills you

This will move you to the correct section of code. Does that help?

And no, I didn't actually test this :)


Thanks, both - I had tried both sections and passages but I think the problem lays with Squiffy (or maybe the JavaScript) not recognising the sections or passages unless there's some text in front of them. As soon as I put some text in front of the sections, the links resolved, so I've ended up with this (excuse the over the top prose!):

He lunges towards you - do you try and [[fight him]](JailerFight), or [[run for the door?]](JailerEscape)

[[JailerFight]]:

{if knife=1:Surprised, you raise the old breadknife out of instinct and the momentum from the fat, cannibalistic jailer impales him on the blade, the metal sinking deep into his chest and getting stuck there. He looks at you with sad amazement for a moment, before letting out his last breath and sinking to the floor, dead. [[Click to continue]](EndofFight)}{else: Surprised, you try to fend him off but the sheer size of the man overwhelms you. You fall to the floor, the breath knocked out of you, as the giant cannibalistic jailer puts his fat hands around your throat and squeezes tighter and tighter until [[everything goes black . . .]](start)}```

This has been a good learning exercise, though, so cheers.


Looking again at your original, you click on one of the options and it goes to a passage (an add-on phrase that returns control to the main section when complete). So you complete the control reverts to [[JailerFight]]: But since you have already used one of the two options (and only one is displayed) you get no more options. Now that I looked it it again, that's what I realized. Since you don't want to go back, you shouldn't use passages []. Use [[]] sections.

I use the following sort of trick all the time (assuming f1 is a true/false boolean).

{if f1: [[Run down the hall]](you die)}
{else: [[Run down the hall]](you live)}

Those work just fine without pre-text.


Thanks again, Bluevoss - I'll give that a go.

Cheers!


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

Support

Forums