Questions about Conditions (GENERAL DISCUSSION)

Discussion in 'Site Feedback' started by porneia, Mar 27, 2019.

Tags:
  1. porneia

    porneia Really Experienced

    I have tons of questions about how to best use conditions and I thought a separate thread dedicated solely to such things would be useful for the community.

    So, here is my question for today . . .

    Is there anyway to have multiple equations of conditions to view a single chapter, or do you have to post that chapter twice (which I guess is the answer)?

    For example, I want the reader to have access to the chapter "the safe door opens" only if they qualify to meet one of two different sets of equations. Such as . . .

    Option #1 = Stealth>80 & ClothingforNevin<4
    ---OR---
    Option #2 = Stealth>70 & Luck>30 & ClothingforNevin<4

    Again, the player has to meet either of these conditions. So, can I somehow put both the condition options in one chapter or do I have to post two different "the safe door opens" chapters?

    As always, thank you for the help!
     
    Last edited: Mar 27, 2019
  2. jamie87

    jamie87 Guest

    I'd be interested to know if that's possible - I can't see any way to do it without having two separate chapters.

    As a workaround, I guess one of the chapters could be a link chapter, to avoid having to maintain two identical chapters?

    On a similar note, is it possible to use "or" within if statements?
     
    porneia and gene.sis like this.
  3. gene.sis

    gene.sis CHYOA Guru

    That isn't possible currently. Conditions must be evaluated very often, so I'm not sure if this will ever be an option. Though, if we have something similar to the suggested Formula Parser, it would be possible to precalculate the outcome. (This would also be helpful for the chapter where you ask the question as you could provide additional information on why the option is unlocked.)


    Exactly.


    While it is possible to create a workaround for an AND operator, there is no way to do the same for an OR operator. In that case, you can only use two content-identical if-statements with different, exclusive conditions.
     
    porneia and jamie87 like this.
  4. Javalar

    Javalar Really Experienced

    Just a side remark: The current system understands Conditions with spaces or punctuation in between. There is no need to have a One-word-variable.

    Of course, there are reasons why doing it like you did might still be just fine and easier to handle.
     
    porneia and gene.sis like this.
  5. gene.sis

    gene.sis CHYOA Guru

    Furthermore, you can use Immersion variables within Conditional Branches variables.

    I think the main reason to do it is to get nice looking variable names in the Score tab.
     
    porneia and Javalar like this.