• 🏆 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] Quick Question for Time Events

Status
Not open for further replies.
Level 13
Joined
Mar 24, 2010
Messages
950
I already assume a logical answer to this but i wanna just double check with some people to make sure.

Lets say i have this trigger:

  • Spawn Footmen
    • Events
      • Time - Every 8.00 seconds of game time
    • Conditions
    • Actions
      • Set Temp_UnitGroup = (Units of type Town Hall)
      • Unit Group - Pick every unit in Temp_UnitGroup and do (Actions)
        • Loop - Actions
          • Set Temp_Point = (Position of (Picked unit))
          • Unit - Create 1 Footman for (Owner of (Picked unit)) at Temp_Point facing Default building facing degrees
          • Custom script: call RemoveLocation ( udg_Temp_Point )
      • Custom script: call DestroyGroup (udg_Temp_UnitGroup)
And i have a lot of triggers like this one, all with time events that could and probably will occur at the same time and overlap at the same time sometimes.

If 2 or more triggers with time events like this, trigger at the same time and im using the Temp_UnitGroup variable for all of them will it sequence this in order and work fine or will it mess up and try and use that var for more than 1 group at once?

Reason i ask is i have had some triggers in the past happen at the same time and do some funny things before, but i dont remember if it had anything to do with unitgroup var's and it wasnt with a time event it was a unit triggered event which is more on the dot time wise.
 
Level 13
Joined
Mar 24, 2010
Messages
950
Well its for my footies game, kinda re-doing those triggers becuz i did them a long time ago and was lazy and fast when i first did them.

So i have like 25ish different triggers all with different timers to spawn the different units at different intervals. some have like every 7.5 some have 8, 9, 10, 11sec etc. and im sure some will over lap sometimes. i just wanna make sure that if i use the same UnitGroup for them all it wont affect anything if they every overlap and trigger at the same time once in a while.
 

Bribe

Code Moderator
Level 50
Joined
Sep 26, 2009
Messages
9,464
There is no collision, unless you use TriggerSleepAction. Otherwise, your code will run through and execute exactly when it's supposed to.

I've seen some GUI triggers cause lag when there's multiple high-frequency triggers running, but they don't mesh. If you create a group in a function and destroy it within the same function (again, no wait period), you're fine, unless accounting for the fact that GUI sucks hardcore and will still leak the unit group by a small amount even though you "destroyed" it.

Hence, JASS is 150, 000 times better than this GUI monstrosity.
 
Level 13
Joined
Mar 24, 2010
Messages
950
Even though you remove leaks it still does a little..? whys that.
If thats the case is there any better way to do this trigger without using groups? maybe a loop intA. Dont really wanna get into jass a lot, too late in the game for that xD

Whats the difference between gui converted to "jass text" and real free hand made jass
 

Bribe

Code Moderator
Level 50
Joined
Sep 26, 2009
Messages
9,464
GUI converted to custom script is every bit as bad as GUI, because you're changing nothing except for how you, the coder, view it.

It leaks because JASS is a poorly-coded language. Ironic, because it's so strongly-typed. To work around the JASS leaks, you have to do things like null local variables (weird) and the default GUI functions do not ever do that.
 
Status
Not open for further replies.
Top