• 🏆 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!

Need help with trigger, not working

Status
Not open for further replies.
Level 20
Joined
Jun 27, 2011
Messages
1,864
So heres the trigger
[trigger=Death]Death
Events
Time - Every 0.01 seconds of game time
Conditions
Actions
Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Terrain type at (Position of (Picked unit))) Equal to Outland - Abyss
((Picked unit) is alive) Equal to True
(Owner of (Picked unit)) Equal to Player 1 (Red)
Then - Actions
Unit - Kill (Picked unit)
Special Effect - Create a special effect attached to the origin of (Picked unit) using Abilities\Spells\Human\Polymorph\PolyMorphDoneGround.mdl
Else - Actions
Do nothing
[/trigger]
and here's the screenshot ingame:
asasdsadasd.jpg
I don't know whats the problem here, please help
 
Level 10
Joined
May 8, 2009
Messages
252
Your trigger is leaking, for more information about leaks check this out Basic Memory Leaks

Here's your trigger without leaks:

  • Death
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • Set UnitGroup = Units in (Units in (Playable map area))
      • Unit Group - Pick every unit in (UnitGroup) and do (Actions)
        • Loop - Actions
          • Set Point = Position of (Picked Unit)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Terrain type at (Point) Equal to Outland - Abyss
              • ((Picked unit) is alive) Equal to True
              • (Owner of (Picked unit)) Equal to Player 1 (Red)
            • Then - Actions
              • Unit - Kill (Picked unit)
              • Special Effect - Create a special effect attached to the origin of (Picked unit) using Abilities\Spells\Human\Polymorph\PolyMorphDoneGround.mdl
            • Else - Actions
          • Custom script: call RemoveLocation (udg_Point)
      • Custom script: call DestroyGroup (udg_UnitGroup)
What you must know:
1. Don't ever use "0.01 seconds of game time", it will increase game lag while 0.03 is far enough (I would personally use 0.1)
2. Unit groups are leaking, this is why you must create a "Unit Group" variable, set it to whatever you want and destroy it afterward. Like that the game will properly overwrites the Unit Group. Same problem occurs with point.
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
Unit groups are leaking, this is why you must create a "Unit Group" variable, set it to whatever you want and destroy it afterward.
You don't really need extra Unit Group variable in this case, you can always:
  • Custom script: set bj_wantDestroyGroup = true
  • Unit Group - Pick every unit in (UnitGroup) and do (Actions)
  • ---- ACTIONS ----
This will save you a variable and also at the same time, clear the Unit Group leak.
 
Level 12
Joined
Sep 11, 2011
Messages
1,176
Weird, that worked for me.

  • Untitled Trigger 001
    • Events
      • Time - Every 0.01 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Terrain type at (Position of (Picked unit))) Equal to Outland - Abyss
              • ((Picked unit) is alive) Equal to True
              • (Owner of (Picked unit)) Equal to Player 1 (Red)
            • Then - Actions
              • Unit - Kill (Picked unit)
              • Special Effect - Create a special effect attached to the origin of (Picked unit) using Abilities\Spells\Human\Polymorph\PolyMorphDoneGround.mdl
            • Else - Actions
 

Attachments

  • Die.jpg
    Die.jpg
    30.6 KB · Views: 118
Status
Not open for further replies.
Top