Game mode improvement: variable addition

Discussion in 'Suggestions' started by blank97, Aug 4, 2020.

  1. blank97

    blank97 Really Experienced

    I recently messaged gene.sis to ask how to add variables in game mode. I thought this was a
    rudimentary function so it must exist already and I just wasn't able to figure out how. Let me clarify what I mean by "add", I am not talking about changing values. I am talking about displaying the result of addition and subtraction just like you can display variable's value by {variable}. E.g. {v1+v2} or {variable+5} should display the addition. This could also be used for boolean variables to use operations like 'and', 'or' ,'xor' ; these operations could be very useful. For progress and numeric variables, you could use this to display the addition now and change variables, later.

    One problem with game mode now is "change in score" changes variable instantly. I first thought changing variable inside chapter could be a solution but it deserves its own thread. Second and possibly easy to implement is this solution. If you just have a way to add variables and display that, you could write the changes inside chapter. It would not change the score but readers will read the change when they are supposed to instead of reading the score and knowing what changes will happen in this chapter. After that you could change the score in the next chapter to reflect the changes that happened in the previous chapter.
     
    RejectTed and insertnamehere like this.
  2. Almax

    Almax Really Experienced

    Variable addition would definitely be cool. It's not a totally perfect fix, but it'll work and you don't need to wait for it -- if you know what's going to be added, you can just have a new variable that changes with it. For example, you know that you'll add "Strength" and "Speed" later. If you make a variable called "StrSpd", then you can increase it and decrease it whenever "Strength" or "Speed" change. Any time "Strength" goes up by 3, so does "StrSpd".

    The "change in score" changes being added instantly I personally don't see as a problem, but instead just something that's not perfectly intuitive, like lists in code starting from number 0. It's a bit weird when you're starting out (seriously, the 1st number is 0, and the 2nd is 1?), but you get used to it and can account for it. For example, if "Dance" starts at 0 and increases by 1 every time the player does a hard boogie, and the chapter changes depending on how many times they've done a hard boogie before, just have the first check check for if Dance = 1, instead of if Dance = 0. If you require a Strength of at least 17 to see certain text, and later on in that chapter your Strength increases by 3, change the initial check to 14.

    It's not intuitive, but you get used to it fast, and changing it now would mess up EVERY already existing Game Mode story. Hopefully this helps you!
     
    MidbossMan and insertnamehere like this.
  3. insertnamehere

    insertnamehere Really Really Experienced

    Huh, I just brought this up on your other thread. I will echo that I think the two concepts - conditional score changes and arithmetic operations - are intertwined. You might be able to get away with the former if you have the latter, since that's essentially how basic computer circuitry works. Either way, would be very useful.
     
  4. blank97

    blank97 Really Experienced

    Well, I think you didn't understand. I am not talking about adding two variable and storing result in third(It probably is another suggestion that has already been suggested) . I am talking about adding inside chapter to display it as a solution to the "changes to the score happening instantly problem". If you add and display inside chapter and change in next chapter, this problem is somewhat solved.

    And I don't understand how my suggestion is affecting already existing stories. Can you please elaborate on that?
     
  5. blank97

    blank97 Really Experienced

    How can you use arithmetic operations to change score conditionally? "Change to scores" is a section in every chapter and it does not have conditions option so any arithmetic operation will not affect it.
     
  6. blank97

    blank97 Really Experienced

    Did nobody see that? This is something that could be very useful.
     
  7. insertnamehere

    insertnamehere Really Really Experienced

    That's what computer addition is, though. Adding two variables and storing them in a third variable. If you've ever added up two numbers on a computer, the result gets stored in a third variable, whether you notice it or not. I think that, by having the author save the addition into a variable, it would be both easier for Friedman and more useful to authors.
    Almax was not referring to your suggestion, but to the idea of reworking when score changes go into effect.
    It is correct that it would not work with your initial idea. It might work if you save the result of the operation i.e. under certain conditions. For instance, you could change the variable Money according to the variable Income by adding them together, instead of having conditional link chapters that check Income = 100 then adds 100 to Money, then another that checks Income = 200 then adds 200 to Money, etc. A less simple example would be, set HadSexTwice to True only if HadSexOnce is True becomes Set HadSexTwice to the value of HadSexOnce. The ability to do that would be a (highly convenient) side effect of your idea - think of it as HadSexOnce+0 - but only if you could save the result.
     
    gene.sis and Almax like this.
  8. blank97

    blank97 Really Experienced

    Considering they have not implemented it yet . I was simply providing with an easier solution. Storing in third variable would require creation of that variable and an interface that lets you add two variable.
    But as I have replied to you in an another thread there is something called "formula parser" in development which would solve all these problems.
     
    gene.sis likes this.
  9. gene.sis

    gene.sis CHYOA Guru

    As stated in the other thread as well...
    It is difficult to add additional easy-to-use syntax for chapters as there is basically no variable naming convention besides not using braces.
     
    insertnamehere likes this.