Attributes/If Statements Help

Can someone help me? (btw i know the passages are wrong)

'MAKE SURE TO TAKE PRECAUTIONS!'

'Okay geez...'

Precautiosn: [[None]]ㅤ-ㅤ[Wear Gloves + Mask]ㅤ-ㅤ[Put Seed in Bag]ㅤ-ㅤ[Put Seed in Safe]ㅤ-ㅤ[[go]]

[[None]]:
@clear
game over

[mask gloves]:
ok
[seed bag]
ok
[seed safe]
ok

[[go]]:
{if seen @1:game over}{if seen @2:'go get more '}{else:'Okay, you're good to go'}

Does that work? or something?


I'm not sure what you mean by {if seen @1: … you don't have a passage named @1, so you can't check if the player has seen it.

Perhaps you mean:

'MAKE SURE TO TAKE PRECAUTIONS!'

'Okay geez...'

Precautiosn: [[None]]ㅤ-ㅤ[Wear Gloves + Mask](mask gloves)ㅤ-ㅤ[Put Seed in Bag](seed bag)ㅤ-ㅤ[Put Seed in Safe](seed safe)ㅤ-ㅤ[[go]]

[[None]]:
@clear
game over

[mask gloves]:
ok
[seed bag]
ok
[seed safe]
ok
[@1]:
You've taken one precaution
[@2]:
You've taken 2 precautions
[@3]:
That's all 3 precautions, time to go

[[go]]:
{if seen @1:game over}{if seen @2:'go get more '}{else:'Okay, you're good to go'}

Now the seen will work (although it's worth noting that it tests if you have visited a @3 passage in ANY section, so if you use this method in more than one place it won't work.

Also, in this case the results would be:

If you haven't taken any precautions: 'Okay, you're good to go'
If you did one thing (so seen @1 is true): game over'Okay, you're good to go'
If you did two (seen @1 and seen @2 both true): game over'go get more '
All 3 precautions (seen @1, @3, and @3 all true): game over'go get more '

If you want to have different responses for each option, you probably want something like:

{if seen @3:Text for if you did all 3}{else:{if seen @2:Text for if you did 2}{else:{if seen @1:Text for just one}{else:Text for if you didn't do any of them}}}

An alternative method might be to use an attribute to count how many precautions you've taken. In that case, it would look more like:

@set precautions_taken = 0
'MAKE SURE TO TAKE PRECAUTIONS!'

'Okay geez...'

Precautiosn: [[None]]ㅤ-ㅤ[Wear Gloves + Mask](mask gloves)ㅤ-ㅤ[Put Seed in Bag](seed bag)ㅤ-ㅤ[Put Seed in Safe](seed safe)ㅤ-ㅤ[[go]]

[[None]]:
@clear
game over

[mask gloves]:
@inc precautions_taken
ok
[seed bag]
@inc precautions_taken
ok
[seed safe]
@inc precautions_taken
ok

[[go]]:
{if precautions_taken<2:game over}{if precautions_taken=2:'go get more '}{if precautions_taken>2'Okay, you're good to go'}

Thank you! Also, I just found a bug.

[[Go!]]:
{if precautions_taken<2:<h2 style="text-align:center;">GAME OVER</h2>
<h4 style="text-align:center;">The manager slapped you in the face, so hard that you died.

<h6 style="text-align:center;">[[Restart]](Play)}{if precautions_taken=2:'That's not enough precautions! 

[['Geez, I'll go get more']](Enter the room)}{if precautions_taken>2:'Okay! You're ready! Goodbye! [[Go!]](donk)'}

The bug is ('Geez, I'll go get more'). When you go back the value is not reset. Do I do @precautions_taken=0 everytime they go back?


I thought I'd included that. I'm sure you'll get it to work.


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

Support

Forums