Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Automatically Skipping a Passage OR Assigning Variables Values Based on User Selection (Snowman)

I'm wondering if there is either a way to:
1. Automatically skip a passage
What I mean here is that, let's say the user selected Female instead of Male. I want to save this into a variable. The method I thought of so far is to have Female and Male go to different passages where I can then assign the variable a value to define the gender. However, I don't want the User to actually see this passage since nothing else happens here. Is there a way to do some stuff in this passage and then the just kind of skip over it to the next passage?

Or, if that's not possible,
2. Assign variables values based on user selection
So we have the:
Female
Male

I want something like if they selected Female, s.gender = "female" or whatever.

I know that:
Female<%s.gender="female"%>
Male<%s.gender="male"%>

just runs both pieces of code so it will always ="male."

Any tips?

> The second method of doing this is preferred, but I can get by if I know how to just skip passages.
> Feel free to post links to documentation that might help me with this, I couldn't find anything about it.

Comments

  • The Snowman (goto:) equivalent? thread contains information about creating what is commonly known as a Setter Link in Snowman.

    Based on the linked information the following is one possible solution.
    Are you <a onclick="story.state.gender='male'; story.show('Some Passage')">Male</a> or <a onclick="story.state.gender='female'; story.show('Some Passage')">Female</a>?
    
    ... you can use code like the following in the Some Passage passage to check if it worked:
    Gender: <%= s.gender %>
    
  • You can also have a passage display another:
    <%= story.render('name of other passage') %>
    
  • Both great answers! Super helpful!! Thank you both
Sign In or Register to comment.