Variables

Today I’m here to talk a bit more about Variables and how I like to set them up in Ren’Py.

What I’ve decided to do is give you a breakdown of how to set the same variable different ways. Using Boolean, Number or String Variables.

I’ll take you through which one I prefer for each kinda style of variable and why.

So today I am gonna show you how to set up the Main Characters Eye Colour.

First up as always we are gonna set up the variables.

Setting Up Variables

If you are not aware how to set up a variable please check out my post Setting up Variables in Ren’Py.

This is how each variable is gonna look for this exercise

Boolean Variable

mceyecolor_blue = False
mceyecolor_green = False
mceyecolor_brown = False

Number Variable

mceyecolor_blue_number = 0
mceyecolor_green_number = 0
mceyecolor_brown_number = 0

String Variable

None

mceyecolor = None

False

mceyecolor = False

label string_variables: menu: "Lets try setting the player characters eye color." "Blue": $ mceyecolor = "blue" "Green": $ mceyecolor = "green" "Brown": $ mceyecolor = "brown"