If statements within if statements

  • #1, by frenzykittyMonday, 04. November 2013, 08:12 11 years ago
    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

    Newbie

    6 Posts


  • #2, by afrlmeMonday, 04. November 2013, 10:28 11 years ago
    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.

    Imperator

    7278 Posts

  • #3, by frenzykittyMonday, 04. November 2013, 10:48 11 years ago
    Thanks. I'd appreciate that

    Newbie

    6 Posts

  • #4, by afrlmeMonday, 04. November 2013, 16:04 11 years ago
    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
    

    Imperator

    7278 Posts