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

Set multiple conditions at once

  • #10, by smac96 12 years ago Zitieren
    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 12 years ago Zitieren
    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 12 years ago Zitieren
    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 12 years ago Zitieren
    IT WORKS! Thank you guys!!! This is awesome :-)