Single choices due to hidden choices. A way around this?


#1

Hi guys,
Have a feeling this may have to do with my limited choice scripting ability once you get past the more common options, but is there a way to use something like an *if statement without a *choice?

Ok, my example is in my game you can get different types of dragons hatching from an egg with different stats being set and slightly different dialogue for each. At the moment it looks something like this:

*choice
    *if (egg = "blue") #Finally you see a claw poke through the shell breaking the casing away...        
        *goto 45
        
    *if (egg = "green") #Finally you see a claw poke through the shell breaking the casing away...
        *goto 12
        
    *if (egg = "gold") #Finally you see a claw poke through the shell breaking the casing away...
        *goto 22

The problem with this is, is that the reader will always only see one choice which I know is annoying. Can you set the *if statement to direct to a paragraph or two of text then back to the main storyline? (Or something else along this line without using single choices?)

Thanks :slight_smile:


#2

Yes. Leave out the *choice and #s. Put the “Finally…” line one line below the *if statement, indented one tab deeper. That will just display the text.

Edit – and looking at your code, because you use the same text regardless of egg color, you could do it like this:

Finally you see a claw poke through the shell breaking the casing away...
*if (egg = "blue") 
  *goto 45
*if (egg = "green") 
  *goto 12
*if (egg = "gold")
  *goto 22

#3

Thanks @Havenstone! I should have asked earlier. That would have made a lot of my coding less clunky and messy.


#4

If you do find yourself at a point where there are choices hidden by if statements, and only one available, you can use *selectable_if instead. This allows people to know that there’s other options open, if they replay the game slightly differently.


#5

Also, in cases like this… you don’t -need- to make it a *choice at all. You can simply have *if nested into the code multiple times in much the same manner as above, except without making it a choice, and it would branch depending on the egg color. Because the egg would not be ‘gold’ if the egg is ‘green’, nor would it be blue- you’d only get the code nested in the green branch if the egg is ‘green’.

Ah, excuse me. It looks like Havenstone already expressed this (I didn’t see).