• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[Trigger] Does it leak? (confused)

Status
Not open for further replies.
Level 6
Joined
May 31, 2008
Messages
218
I got these two triggers that are used in my map, and since i am experiencing some minor lagg i am wondering if this could be part of it.

  • Create food
    • Events
      • Time - Every 3.00 seconds of game time
    • Conditions
    • Actions
      • Do Multiple ActionsFor each (Integer A) from 1 to 12, do (Actions)
        • Loop - Actions
          • Wait 0.20 game-time seconds
          • Set foodgroup = (Units owned by (Player((Integer A))) of type Food)
            • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • ((Player((Integer A))) Food cap) Greater than (>) 0
                • (Number of units in foodgroup) Equal to (==) 0
              • Then - Actions
                • Set foodpoint = (Center of Food place <gen>)
                • Unit - Create 1 Food for (Player((Integer A))) at foodpoint facing Default building facing (270.0) degrees
                • Set food_unit[(Integer A)] = (Last created unit)
                • Custom script: call RemoveLocation (udg_foodpoint)
              • Else - Actions
          • Custom script: call DestroyGroup (udg_foodgroup)
At least leakchecker says that Set food_unit[(Integer A)] = (Last created unit) is leaking. Should i just remake the triggers or can i keep it like this?

  • Food equals 0
    • Events
      • Player - Player 1 (Red)'s Food cap becomes Equal to 0.00
      • Player - Player 2 (Blue)'s Food cap becomes Equal to 0.00
      • Player - Player 3 (Teal)'s Food cap becomes Equal to 0.00
      • Player - Player 4 (Purple)'s Food cap becomes Equal to 0.00
      • Player - Player 5 (Yellow)'s Food cap becomes Equal to 0.00
      • Player - Player 6 (Orange)'s Food cap becomes Equal to 0.00
      • Player - Player 7 (Green)'s Food cap becomes Equal to 0.00
      • Player - Player 8 (Pink)'s Food cap becomes Equal to 0.00
      • Player - Player 9 (Gray)'s Food cap becomes Equal to 0.00
      • Player - Player 10 (Light Blue)'s Food cap becomes Equal to 0.00
      • Player - Player 11 (Dark Green)'s Food cap becomes Equal to 0.00
      • Player - Player 12 (Brown)'s Food cap becomes Equal to 0.00
    • Conditions
    • Actions
      • Unit - Remove food_unit[(Player number of (Triggering player))] from the game
 
Level 6
Joined
May 31, 2008
Messages
218
I got a bunch of triggers, but that is the only periodical one. And i can't really post the rest of them, would require shit loads of space.

If you don't want to look at the map itself, which i tried to make people do before without success :D
 
Status
Not open for further replies.
Top