Skip to content

Set and if statements do not seem to be working #3

@tymerica

Description

@tymerica

I copied the if statements from the wiki, because my personal if statements didnt work (I was trying to get it to evaluate functions in the if statement to allow for more direct access to game data) but before I could even get to that, i couldn't get basic if statements working.

<<set $gold to 1>> A: Hello player! Do you have enough gold? <<if $gold is 1>> A: Looks like you need more gold! (This will only appear if $gold is equal to 1.) <<elseif $gold > 1>> A: Good work! (This will only appear if $gold is greater than 1.) <<else>> A: Come back when you have some gold! (This will only appear if $gold is less than 1.) <<endif>>

It would not step past the set step, and if i tried to resume the yarntree manually in the set callback i got a stackoverflow, i also tried manually setting it by the operation, and still didn't seem to work.

then i just tried if statements, it would never go to the line under any if statement although i made sure it evaluated by debugging in my ide, it just seemed to stop after it went through the if else if checks

A: Hello player! Do you have enough gold? <<if 5 is 1>> A: Looks like you need more gold! (This will only appear if $gold is equal to 1.) <<elseif 5 > 1>> A: Good work! (This will only appear if $gold is greater than 1.) <<else>> A: Come back when you have some gold! (This will only appear if $gold is less than 1.) <<endif>>
it would never execute the A: Good work!

there may be a step i'm missing, but just dropping either of these into a node would stop the node in it's tracks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions