Set multiple conditions at once

  • #10, by smac96Tuesday, 03. June 2014, 19:09 10 years ago
    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)


    97 Posts

  • #11, by NoComTuesday, 03. June 2014, 19:29 10 years ago
    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)

    this should work, try it ^^

    p.s. It's quite the same as yours, just shorter. ^^


    24 Posts

  • #12, by afrlmeTuesday, 03. June 2014, 20:02 10 years ago
    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.


    7265 Posts

  • #13, by smac96Tuesday, 03. June 2014, 20:09 10 years ago
    IT WORKS! Thank you guys!!! This is awesome :-)


    97 Posts