terrian death trigger

SouL-Laka

New Member
Reaction score
2
hi
in my maze im using a trigger that kills you if you go off the path
but its the simple one
Code:
Code:
Walk off path
    Events
        Time - Every 0.05 seconds of game time
    Conditions
    Actions
        Unit Group - Pick every unit in (Units of type Civilian) 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 Ashenvale - Grassy Dirt
                    Then - Actions
                        Unit - Kill (Picked Unit)
                    Else - Actions
        Custom script: call DestroyGroup(GetLastCreatedGroup())


and i guess there are better ways to make it
so can anyone show me how
and explain it so i learn :D
 

Ghan

Administrator - Servers are fun
Staff member
Reaction score
888
Does that Custom Script really eliminate the leak? I don't know if you can get the last created unit group since the unit group loop uses a separate function....

A better way to do it? I don't think so. Try using search. There have been many systems on how to do this.
 

SFilip

Gone but not forgotten
Reaction score
634
"Last Created Unit Group" is the group in which all units last created with Unit - Create... are stored in.
 

0zaru

Learning vJASS ;)
Reaction score
60
Soooo that's not removed...

maybe put this before the group

Code:
Custom Script: set bj_wantDestroyGroup = true

But it's better if you store it in a variable and destroy it in the variable
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top