Menu
Login
Language
DE EN FR ES IT CZ
Back

Set multiple conditions at once

  • #10, by smac96 Tuesday, 03. June 2014, 19:09 12 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)
    

    Newbie

    97 Posts

  • #11, by NoCom Tuesday, 03. June 2014, 19:29 12 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. ^^

    Newbie

    24 Posts

  • #12, by afrlme Tuesday, 03. June 2014, 20:02 12 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.

    Imperator

    7290 Posts

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

    Newbie

    97 Posts