• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • ✅ Time to vote for the top 3 models! The POLL for Hive's 6th HD Modeling Contest: Mechanical is now open! 📅 Poll close on July 16, 2024! 🔗 Cast your vote now!

Running blank trigger

Status
Not open for further replies.
Level 7
Joined
Jul 4, 2007
Messages
249
Hey, does it matter if I run a blank trigger in the sense of causing problems or reducing performance? This is the trigger I'm using and I'm thinking of removing the condition, and just let the blank trigger "No trigger" run instead. What do you think?
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • Items_GeneralTrigger[(Integer A)] Not equal to No trigger <gen>
    • Then - Actions
      • Trigger - Run Items_GeneralTrigger[(Integer A)] (ignoring conditions)
    • Else - Actions
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,233
What happens is it tries to run a trigger with the value of null, which is what GUI refers to as no trigger and is the default value for uninitialized trigger array slots. If this is safe or does anything depends on how run trigger is internally implemented. It should have a native test, like what you wrote above, to only run a trigger if the argument is a valid trigger object.

If it does not have such a test, or a safety for null, then it may be prone to crashing or causing unpredictable behaviour.
 
Level 7
Joined
Jul 4, 2007
Messages
249
What happens is it tries to run a trigger with the value of null, which is what GUI refers to as no trigger and is the default value for uninitialized trigger array slots. If this is safe or does anything depends on how run trigger is internally implemented. It should have a native test, like what you wrote above, to only run a trigger if the argument is a valid trigger object.

If it does not have such a test, or a safety for null, then it may be prone to crashing or causing unpredictable behaviour.
It is a real trigger though. So it's not the default value of "no trigger" but a trigger named No Trigger, that is empty.
  • No trigger
    • Events
    • Conditions
    • Actions
 
Status
Not open for further replies.
Top