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

If statements within if statements

  • #1, by frenzykitty 13 years ago Zitieren
    Is it possible to do this in Visionaire, as I'm having trouble with the stacking of them.

    Also, in an action I have a set object fisibility to 0, but the object is still clickable in my scene? Any reason why this might be happening?

    Thanks
  • #2, by afrlme 13 years ago Zitieren
    visibility is just the opacity of your object....
    to disable it create a condition which you can set inside of the properties section of the object itself; depending on whether or not you set it to negate the object will only be visible/active depending on if the assigned condition is true/false.

    yes it's possible to do if queries within VS; albeit creating complicated if queries in vs itself is somewhat confusing due to how they end up looking in the action blocks... I find it much easier to create complicated if queries with Lua instead; but each to their own. wink

    I'll create an example later, when I've woken up properly.
  • #3, by frenzykitty 13 years ago Zitieren
    Thanks. I'd appreciate that
  • #4, by afrlme 13 years ago Zitieren
    if condition "condition_name" is true (or false)
     if value "value_name" > 5
      -- some actions here
     end if
    end if
    


    if condition "condition_name" is true
     if value "value_1" < 5
      -- do something
     else
     if value "value_1" >= 5
      -- do something else
     end if
     end if
    else
    -- if first condition not met; do something...
    end if
    


    in VS queries work by line; meaning it will only go to the next line inside of an if query if the current query is met.

    thing I don't like about doing if queries inside of VS action blocks is that we can't create complex joint queries, like we can do with Lua...
    if cond1 and cond2 and not cond3 or value1 > 5 then
     -- do something...
    elseif not cond1 and not cond2 and cond3 or value1 < 5 then
     -- do something else...
    else
     -- if none of above queries are met then do something else...
    end