Could we code an age range into CHYOA?

Discussion in 'CHYOA General' started by Walter Dee, Apr 8, 2019.

  1. Walter Dee

    Walter Dee Virgin

    I'd love to have a variable for a character's age and then limit it to certain limits or a range. In other words, if the story made no sense to have a character younger than 18 or older than 90, I'd like to display some sort of error message explaining that the age the reader entered is out of range.

    Another option might be changing the choice links where if a reader has entered a number of of range, the link(s) to continue on might become unclickable or the text might change to say something like "Cannot continue - {character}'s age must be older than {characters_age}."

    Thoughts? Possible?
     
  2. gene.sis

    gene.sis CHYOA Guru

    Underage content is also prohibited on CHYOA.


    Tracking the age is possible with Conditional Branches Variables. (The reader must activate Game Mode.)
    It isn't possible with Immersion Variables. (Immersion Variables can be changed any time while reading the story.)

    With Conditional Branches, you could either offer chapters with the age (18, 19, 20, 21, 22, 23, and so on) which just set the specific age of that chapter (results in a ton of chapters) or create a structure to add on the age (start with 18 and give options +1, +5, +10 which would be locked as soon as you would exceed the maximum with the next addition).

    Personally, I'd recommend using a fixed age for your characters as there are so many things which would change due to it. The characters could still go to school, live at their parents, study, work or even be retired. (With Conditional Branches, you can take care of these details but I'm not sure if it's worth to start with.)