DE EN FR ES IT CZ
Back Back to top

Set multiple conditions at once

This thread is a few years old. Some details may refer to an earlier version of Visionaire Studio. Current tutorials

  • #10, by smac96 13 years ago Quote
    So you mean:

    getObject('Scenes[Test scene].SceneConditions[CONDITION_BATMAN]'):setValue(VConditionValue, true)
    getObject('Scenes[Test scene].SceneConditions[CONDITION_SUPERMAN]'):setValue(VConditionValue, true)
    getObject('Scenes[Test scene].SceneConditions[CONDITION_HULK]'):setValue(VConditionValue, true)
    getObject('Scenes[Test scene].SceneConditions[CONDITION_SPIDERMAN]'):setValue(VConditionValue, true)
    getObject('Scenes[Test scene].SceneConditions[CONDITION_THOR‘]'):setValue(VConditionValue, true)
    
  • #11, by NoCom 13 years ago Quote
    Nope he meant sth like that:
    local t = { "BATMAN", "SUPERMAN", "HULK", "SPIDERMAN", "THOR" }
    for i=0, #(t), 1 do
    getObject('Scenes[Test scene].SceneConditions[CONDITION_'..t[i]..']'):setValue(VConditionValue, true)
    end
    


    this should work, try it ^^

    p.s. It's quite the same as yours, just shorter. ^^
  • #12, by afrlme 13 years ago Quote
    no not what I meant. but sure you can do that. wink

    a little tip: don't include special characters like question marks or exclamation marks in you object names. keep them as simple as possible & join them together with _underscores.

    I'm not sure exactly why you are wanting to do this or whether all conditions are grouped in same place, same scene, character or whatever. It's not really possible to create a global function for doing this as the conditions could be from multiple different places.

    So yeah, probably better to write them out as you have done above.

    here check out this page I wrote, for a bit more information in regards to getObject.
  • #13, by smac96 13 years ago Quote
    IT WORKS! Thank you guys!!! This is awesome :-)