How can I make disappear an option?

Mihnea
Hello, I have two options after some text:

some text...
[[press the red button]]
[[press the green button]]

After the player choose one option, say press the red button, I want that the other option disappear, like that:

some text...
press the green button

another text from press the red button section...

It is possible?

bgbg
You mean something like this?

[[press the red button]](Red)  
{label:1=[[press the green button]](Green)}

[[Red]]:
@replace 1=

You pressed the red button. Now the green option will disappear.

[[Green]]:
You pressed the green button.


To do this you can use the replace function

Mihnea
Yess! Thank you!

I want both options to behave like that, so the code is:


{label:1=[[press the red button]](Red)}
{label:2=[[press the green button]](Green)}

[[Red]]:
@replace 2=
You pressed the red button. Now the green option will disappear.

[[Green]]:
@replace 1=
You pressed the green button. Now the red option will disappear.


Regards,
Mihnea

I believe you can also use the seen function to do this a little more simply.

{if not seen Green:[[You press the red button]]}
{if not seen Red:[[You press the green button]]}

Both buttons will appear before you press either, but pressing one turns off the other because you will have traveled to the page named "Green" (I didn't include the parentheses after the page link)

http://docs.textadventures.co.uk/squiffy/seen.html


It depends whether or not you want to remove text that is already on the screen. werew's solution will prevent it from appearing, but it won't remove the text if it's already on the screen.


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

Support

Forums