Random numerical variables?

Discussion in 'Site Feedback' started by CrocodileHAZARD, Oct 11, 2018.

  1. Okay, to start off the topic: I acknowledge that at present my knowledge of variables/conditionals and most of the workings behind them are not all there. Working on it, but right now it wouldn't be totally inaccurate to say I have next to no knowledge on the subject.

    That said, I've parsed out three for the conditional variables: Boolean, Numerical, and Progress. Each one influences the story in some way or another. What I'm interesting in right now are the Numerical Variables. This one, to my limited understanding, offers the most potential amount of offers for however many variables an author could ever need. But I'm wondering if there is any way to randomly generate that variable.

    For example: the central character to a story is gambling and he's given a pair of dice to roll. Numerical Variables could definitely be utilized the the chapters that follow based on what he rolls. But what would make it interesting was if the value of the roll could be randomly influenced. The reader could generate anything between a 2 and a 12 in this case, and the Conditional Variables would play out however the author sets them up. If the number is a 2-6 or 8-12, then the main character loses the bet and X event happens, influencing the story further down the line because of the loss. If the number generated is a 7, they win and the story plays out differently. And that's just a very basic gambling situation. If every outcome influenced events differently, there's good potential for some drastic differences between repeated readings.

    Is a feature like that even possible, or is it just a pipe dream from a dude who still has trouble wrapping his small mind around the concept of Boolean Variables?
     
  2. Nemo of Utopia

    Nemo of Utopia CHYOA Guru

    This is a planned feature of the Formula Parser which is intended to be rolled out after the next major code update.* Among other features, the formula parser will be able to generate random numbers which altar variables and compare two or more different variables and change other variables based on the results of the comparison. This will allow many powerful new options in game mode if you are good at programming.
    *[The code update is planned to be scheduled for sometime this winter, hopefully around Christmas: Formula Parser for about six months after that once the new code has been stabilized and had most bugs worked out...]
     
    Last edited: Oct 11, 2018
    gene.sis likes this.
  3. Good to know
     
  4. gene.sis

    gene.sis CHYOA Guru

    related to Game Mode Enhancement: Random Value and Formula Parser (see link above)


    A note about your example: If you want to roll two dices, you'd also need the ability to add variables to each other. Only creating a random value between 2 and 12 doesn't reflect the actual probability to roll a specific number. If you create a random value between 2 and 12, the probability to get a 7 is about 9% while it is about 16% if you roll two dices. Though you could work around that if you would just use the correct probability (e.g. by creating a random number between 1 and 6 where one number represents the 7 (the probability is the same))