*if statements

I have already consulted the Make your own game tab and searched the forums tirelessly to no avail. So I am going to put it to the forum in general to help with my confusion. I am writing a scene in my book where the mc’s height is a factor in the scene. So I want to use an *if statement for the scene without having to create 5 separate scenes is that even possible and if so how do I do it?

*if (tall)
    You are tall.
    *goto next_scene
*elseif (average)
    You are of average height.
    *goto next_scene
*else
    You are a shortie.
    *goto next_scene 
1 Like

You can also have your height stat be a number (ex: 1=short 2=medium 3=tall), and then use multireplace to have variations in your text based on height.

1 Like

How do I use the multireplace?

Multireplace ← that’s it’s entry in the wiki. it should tell you all you need. :slightly_smiling_face:

1 Like

*if (mcheight=tiny)
*gosub scarletscene4
*if (mcheight=small)
I stand on the tip of my toes and give her a peck on her cheek.
*if (mcheight=average)
*gosub scarletscene5
*if (mcheight=tall)
*gosub scarletscene6
*if (mcheight=giant)
*gosub scarletscene7

This is what I want to do but not have to write out every scene

I am still confused on how to implement the multireplace

Assuming using implicit_control_flow, two options like so. Recommend multireplace for one or two word difference, otherwise it’s more readable for coder/editor to use *if to break up the text.

*create implicit_control_flow true

*comment suppose 1 = short, 2 = average, 4 = tall
*create height 1

I look @{height up||down} at her,
*if (height = 1)
    stand on my tiptoes
*elseif (height = 2)
    lean in to give her a peck
*else
    lean down
to give her a peck on the cheek. Then we continue down the sidewalk…
1 Like

Okay thaniks

I put that in start up correct?

If by “that” you mean *create implicit_control_flow true, then yes! That goes in startup.txt