Is it possible to wrap the replace function in an If statement?

If I want to replace text, but only in a specific circumstance, can I wrap the:

 @replace mylabel

In a statement like:

{if gender=male:@replace mylabel=new content}

The above doesn't appear to work.


From what I know you can't mix these two statements together. Squiffy's if statement isn't like an if statement in a programming language. All it can go is check a variable and display some text right after. You could possibly do it with javascript but I do not know how to access Squiffy's @replace function. But the if statement can in a way function a little bit like a label depending on how you use it.

Example:

Are you a boy or a girl.

[[boy]]

[[girl]]

[[skip]](hello)

[[boy]]:
    squiffy.set("gender", "boy");
    squiffy.story.go("hello");

[[girl]]:
    squiffy.set("gender", "girl");
    squiffy.story.go("hello");
    
[[hello]]:
Hi you are a{if gender=boy: young man.}{if gender=girl: young lady.}{else: cool person.}

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

Support

Forums