Login / Registrieren
DE EN FR ES IT CZ
Zurück Nach oben

If ... and ... if ...?

  • #1, by constantin 9 years ago Zitieren
    I have a question, that seems to be easy to answer, but after a lot of tries I just cannot make it.
    Here is the problem:
    I have a lot of different values and want to check, if all of them are true at the same time. If not, something else should happen. Do i really have to write:
    if value1 = x 
        if value 2= y
       else do something else
            if value3=z
               else do something else 
        (and so on ...)

    or is there something to combine values like: if value1=x and value2=y and value3=z then ...

    As you might have guessed, I am more of a writer than a programmer, but I have a lot of fun using visionaire to tell stories and appreciate the help in the forum a lot.

    constantin


  • #2, by sebastian 9 years ago Zitieren
    if you are using only action parts then the answer would be yes. 
    But you could use Lua script to combine it like you guessed:

    Execute script :

    if Values["valuename"].Int == 12 and Values["valuename2"].Int == 32 and ... then
     Conditions["alltrue"].ConditionValur = true
    end

    (the value names have to be unique here) 

    and after that actionpart you could just check the "alltrue" condition actionpart if it is true... 
  • #3, by constantin 9 years ago Zitieren
    great! thank you!
  • #4, by Machtnix 9 years ago Zitieren
    You can combine two conditions in the editor too, but it's more helpful to use Lua. wink
  • #5, by sebastian 9 years ago Zitieren
    You can combine two conditions in the editor too, but it's more helpful to use Lua. wink

    actually you can only compare two values if they are equal/higher/lower/etc than but not check if two of them are a specific number.
    For condtitions you can only check if it is true or false.
  • #6, by Machtnix 9 years ago Zitieren
    Ah, correct.