• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

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 11
Joined
May 8, 2009
Messages
275
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: 119
Status
Not open for further replies.
Top