Variables not working

Discussion in 'CHYOA General' started by Chris7129, Mar 29, 2024.

  1. Chris7129

    Chris7129 Virgin

    For example: I make a chapter in which someone gets to choose between being nice and being mean. if the reader chooses mean, a new variable will be set to "FriendIsAngry". So the next time he can only meet him if that variable is off. But for some reason, he cannot meet him even though he was nice and thus the variable should be off.
    Does anybody know what the problem is?
     
  2. gene.sis

    gene.sis CHYOA Guru

    I assume that you use a Boolean for FriendIsAngry.
    The behavior of the variable should be:


    Chapter Condition: FriendIsAngry = False

    Reader Score: FriendIsAngry = True
    Outcome: The condition is not met and the reader can't choose the option.

    Reader Score: FriendIsAngry = (not set)
    Outcome: As the variable is not in the Reader's Score, the condition fails and the reader can't choose the option.

    Reader Score: FriendIsAngry = False
    Outcome The condition is met and the reader can choose the option.


    The problem might be that the variable is not set (to False) when the reader chooses "nice" and thus doesn't exist when the Condition is evaluated.

    If that isn't the case, please send me a link to the (published or unpublished) chapter and I'll take a look.