If Statement on String Variables

Discussion in 'CHYOA General' started by StanS55, Oct 11, 2017.

  1. StanS55

    StanS55 Experienced

    Do you all know if you can check a string variable in an IF statement.
    After doing some reading, I believe it's not possible but wanted to check over here.

    Basically, I wrote story with a name and my characters make a comment specific to that name. I want to see if users modify the default name varoable as that comment wouldn't make sense then. Ultimately I can just throw the comment away but wanted to see.
     
  2. gene.sis

    gene.sis CHYOA Guru

    It is not possible to use Immersion Variables within If-Statements.


    I just tested if there could be a workaround by using an Immersion Variable within a Conditional Branch Variable, but it doesn't work because the Immersion Variables get processed (adding some html with tags) to be changeable after loading the chapter.

    (You can use Immersion Variables within a Conditional Branch Variable to show them with the right name in the Score Tab.)
     
    StanS55 likes this.
  3. Funtimes

    Funtimes Virgin

    If you change from immersion variables to handlebars installing a correct if would be easy
     
  4. gene.sis

    gene.sis CHYOA Guru

    What would be the difference? Handlebars would create the html receiver as well and it would be inserted before the processing of the If-Statements.