- Joined
- Apr 1, 2009
- Messages
- 201
Trying to come up with a trigger where whenever a hero enters shallow water they get a regeneration ability and when they leave shallow water, they lose the ability. Here's what I've come up with so far. Every time I test the trigger in game and move my hero into shallow water the game crashes.
-
Startup
-

Events
-


Map initialization
-
-

Conditions
-

Actions
-


Custom script: set bj_wantDestroyGroup = true
-


Unit Group - Pick every unit in (Units in (Playable map area) matching (((Matching unit) is A Hero) Equal to True)) and do (Actions)
-



Loop - Actions
-




Unit Group - Add (Picked unit) to WaterRegenGroup
-
-
-
-
-
Check
-

Events
-


Time - Every 0.03 seconds of game time
-
-

Conditions
-

Actions
-


Unit Group - Pick every unit in WaterRegenGroup and do (Actions)
-



Loop - Actions
-




Set WaterRegenUnit = (Picked unit)
-




Set WaterRegenPoint = (Position of WaterRegenUnit)
-




If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-





If - Conditions
-






(Terrain pathing at WaterRegenPoint of type Floatability is off) Equal to False
-






(Terrain pathing at WaterRegenPoint of type Walkability is off) Equal to False
-
-





Then - Actions
-






Unit - Add Water Regen to (Picked unit)
-






Player - Disable Water Regen for (Owner of (Picked unit))
-
-





Else - Actions
-






Unit - Remove Water Regen from (Picked unit)
-
-
-




Custom script: call RemoveLocation(udg_WaterRegenPoint)
-
-
-
-





