• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Trigger] Wait in a periodic trigger cause a bug or damage in the trigger?

Status
Not open for further replies.
Level 6
Joined
Jul 14, 2020
Messages
128
Greetings hive

I am creating a skill that stops time, this skill can only be cast by one unit at a time, which means that simultaneous casts are not allowed.

And what I want to do to make it more realistic is to place a Wait, verifying if the ability to stop time is active with a bool, in some systems or templates of my map (not in all).

My doubt is that if I do that, it can damage the trigger at the moment or in the long term ?

As I said that this ability can only be launched by one user at a time, always, then it sets a Bool to True that later allows to put a wait in the template/systems, and at the end of the ability it sets the same Bool to False, which allows the systems/templates to work again.

For more details I attach this:


  • Some Loop Trigger of a System/Template
    • Events
      • Time - Every 0.02 seconds of game time
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • Conditions
          • STOPTIME_Bool Igual a True
        • Actions
          • Wait 10.00 seconds
        • Else - Actions
      • Unit Group - Pick every unit in SomeSystemGroup and do (Actions)
        • Actions
          • Some Loop Trigger of a System/Template actions

Thanks :grin:
 
Level 22
Joined
Feb 26, 2008
Messages
891
The wait action might cause problems in your other triggers, but it depends on the trigger and what it is doing. The trigger you show here might cause trouble because it is running on a periodic timer. The "Every 0.02 seconds of game time" doesn't care about the Wait action. It will continue to run this trigger every 0.02 seconds even when previous instances of the trigger are stuck in the wait time.
 
Level 6
Joined
Jul 14, 2020
Messages
128
The wait action might cause problems in your other triggers, but it depends on the trigger and what it is doing. The trigger you show here might cause trouble because it is running on a periodic timer. The "Every 0.02 seconds of game time" doesn't care about the Wait action. It will continue to run this trigger every 0.02 seconds even when previous instances of the trigger are stuck in the wait time.
Thank you for replying,
First, the systems to which I plan to place this condition do not activate other triggers, they depend on themselves.

Second, when you say "The "Every 0.02 seconds of game time" doesn't care about the Wait action. It will continue to run this trigger every 0.02 seconds even when previous instances of the trigger are stuck in the wait time."

Do you mean that the trigger will continue doing the actions that are in "Unit Group - Pick every unit in SomeSystemGroup and do (Actions)" ?

I say this because I have tested this in a map, and when I place the wait , the actions of "Unit Group - Pick every unit in SomeSystemGroup and do (Actions)" actually stop.
But if you refer to the actions before the Wait, you are right, the loop is still running, but it doesn't get to enter the "Unit Group - Pick every unit in SomeSystemGroup and do (Actions)" zone.


So what could be the solution ? I can think of moving the condition "STOPTIME_Bool" to the main trigger, but verifying if it is false or true,
and if it is true, then the loop actions would never be done until it is false, but I don't know if this could generate other errors.

Thanks again
 
Last edited:
Level 22
Joined
Feb 26, 2008
Messages
891
Do you mean that the trigger will continue doing the actions that are in "Unit Group - Pick every unit in SomeSystemGroup and do (Actions)" ?

No, I mean that what will happen is that while the boolean is true, you'll be stacking up multiple executions of this trigger every 0.02 seconds, all of which will at some point finish the 10 second wait and then proceed with the Unit Group action below.

If the trigger is running every 0.02 seconds anyway, then it doesn't seem necessary to bother letting it complete when the boolean is true. I would try adding the boolean check to the main trigger condition section, and remove the wait action. That way no actions will run at all if the boolean is true, and then when it is false, you need only wait until the next execution of the trigger to pick the actions back up again.
 
Level 6
Joined
Jul 14, 2020
Messages
128
No, I mean that what will happen is that while the boolean is true, you'll be stacking up multiple executions of this trigger every 0.02 seconds, all of which will at some point finish the 10 second wait and then proceed with the Unit Group action below.

If the trigger is running every 0.02 seconds anyway, then it doesn't seem necessary to bother letting it complete when the boolean is true. I would try adding the boolean check to the main trigger condition section, and remove the wait action. That way no actions will run at all if the boolean is true, and then when it is false, you need only wait until the next execution of the trigger to pick the actions back up again.
Yes, the last thing you mentioned also crossed my mind, so do you think that would be all right?

All the systems and templates, which I put that main condition, will run as if I had never used that ability ?

Thx again
 
Status
Not open for further replies.
Top