• 🏆 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] Does this leak?!

Status
Not open for further replies.
Level 12
Joined
Apr 26, 2008
Messages
830
  • Spawn 01
    • Ereignisse
      • Zeit - Every 25.00 seconds of game time
    • Bedingungen
    • Aktionen
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • 'IF'-Bedingungen
          • CreepCountR1 Kleiner als 5
        • 'THEN'-Aktionen
          • Einheit - Create 1 Soldat for Neutral feindlich at (Center of Route 1 <gen>) facing Vorgabe für Gebäude-Ausrichtung degrees
          • Set CreepCountR1 = (CreepCountR1 + 1)
          • Einheitengruppe - Add (Last created unit) to Route1Creeps
        • 'ELSE'-Aktionen
          • -------- Do nothing --------
  • Dies 01
    • Ereignisse
      • Einheit - A unit Stirbt
    • Bedingungen
      • ((Triggering unit) is in Route1Creeps) Gleich True
    • Aktionen
      • Set CreepCountR1 = (CreepCountR1 - 1)
      • Einheitengruppe - Remove (Triggering unit) from Route1Creeps


It's a simply spawn system i made for my map, i can't destroy the groups because i will still need them. So does this leak?!
 
Level 12
Joined
Apr 26, 2008
Messages
830
Another thing is that you should remove the Do Nothing. And as Maker said there is a Location leak in your Spawn01 trigger. Use CustomScript to remove the Leak:

  • Custom script: call RemoveLocation(udg_Route01)
Also it is better if you post your triggers in english and not in german.

I didn't add do nothing as function it's just a comment, and i can't post them in english since my editor is german!
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,199
Additionally some more obscure fonts may not be supported on all systems (as if they are useful to the majority of people anyway).

The only really international way to transfer triggers is via JASS as programming code is not localized. Too bad GUI converts to JASS in such a stupid way it is pointless.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,199
It is hard to explain exactly. This is just a brief list of stupid things GUI converting to JASS does.
* stupid and/or conditional strucutres (could be written as 1 line instead).
* all tests used in if then else flow control statements broken down into dozens of separate functions (could be inlined into 1 line instead).
* heavy use of pointless function wrappers (aka, most of the Swaped and BJ functions).
* no form of optimizations or automatic code collection (storing values used multiple times in locals or creating functions for blocks of code that are refferenced multiple times throughout all triggers).

Combined with the inherit faults of GUI in the first place (no functions, no locals and obscuring useful functionality) it means GUI converted to JASS is nearly always usless and you would be better off rewriting the thing in JASS from scratch.
 
Status
Not open for further replies.
Top