Page 1 of 1

solved - Fourth variable not setting

Posted: Thu Aug 06, 2020 8:49 am
by AlienDucky
I have four paths a player could take in my game in any order, and the player is only going to get to do three of them before something different happens on the fourth day.

I'm able to set three of the paths as variables using:

Code: Select all

label forest:
    if days == 1:
        $ choice_1 = 'forest'
    if days == 2:
        $ choice_2 = 'forest'
    if days == 3:
        $ choice_3 = 'forest'
    
    scene bg_forest
    show player at left
    $ forest -= 1
    $ daypts += 11'
on each of the four paths, but when I then try to set choice 4 at the end of the third day using:

Code: Select all

label end_of_day_three:
    scene bg_inside_house
    
    $ day3pts = daypts
    
    if 'forest' == 1:
        $ choice_4 = 'forest'
    elif 'waterfall' == 1:
        $ choice_4 = 'waterfall'
    elif 'castle' == 1:
        $ choice_4 = 'castle'
    elif 'caves' == 1:
        $ choice_4 = 'caves'
    
    n "Oooooh! My feet hurt after looking around [choice_3] all day."
    n "But I've still got the [choice_4] left to explore, so it's time for me to turn the lights off..."
    jump day_four
I get nothing
20200806 variables.PNG
I made that screen in the corner to help me keep track, so I can see caves = 1 and so should be turning into choice_4. Right?
All other inserted variables are showing up as they should

Re: Fourth variable not setting

Posted: Thu Aug 06, 2020 9:13 am
by IrinaLazareva
It's not quite clear, but..

Code: Select all

if 'forest' == 1:
if 'forest' ('waterfall' / 'castle' / 'caves' ) is variable, it should be unquoted:

Code: Select all

   if forest == 1:
if 'forest' is a value of another variable, for example, choice_0, it should be:

Code: Select all

if choice_0 == 'forest':

Re: Fourth variable not setting

Posted: Thu Aug 06, 2020 9:24 am
by AlienDucky
It was the first one thank you!!