- Joined
- Aug 3, 2004
- Messages
- 2,909
How can I remove a unit with locust on demand? Using an expiration timer is not an option.
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Vision Extension

Events


Unit - A unit Changes owner

Conditions


(Unit-type of (Triggering unit)) Equal to Relic

Actions


Set Relic_A = (Position of (Triggering unit))


Set Relic_Units = (Units within 4000.00 of Relic_A matching (((Unit-type of (Matching unit)) Equal to Dummy (Relic Vision)) and ((Owner of (Matching unit)) Not equal to (Owner of (Ownership-changed unit)))))


Unit Group - Pick every unit in Relic_Units and do (Unit - Remove (Picked unit) from the game)


Unit - Create 1 Dummy (Relic Vision) for (Owner of (Ownership-changed unit)) at (Relic_A offset by (0.00, 1000.00)) facing Default building facing degrees


Unit - Create 1 Dummy (Relic Vision) for (Owner of (Ownership-changed unit)) at (Relic_A offset by (750.00, 750.00)) facing Default building facing degrees


Unit - Create 1 Dummy (Relic Vision) for (Owner of (Ownership-changed unit)) at (Relic_A offset by (1000.00, 0.00)) facing Default building facing degrees


Unit - Create 1 Dummy (Relic Vision) for (Owner of (Ownership-changed unit)) at (Relic_A offset by (750.00, -750.00)) facing Default building facing degrees


Unit - Create 1 Dummy (Relic Vision) for (Owner of (Ownership-changed unit)) at (Relic_A offset by (0.00, -1000.00)) facing Default building facing degrees


Unit - Create 1 Dummy (Relic Vision) for (Owner of (Ownership-changed unit)) at (Relic_A offset by (-750.00, -750.00)) facing Default building facing degrees


Unit - Create 1 Dummy (Relic Vision) for (Owner of (Ownership-changed unit)) at (Relic_A offset by (-1000.00, 0.00)) facing Default building facing degrees


Unit - Create 1 Dummy (Relic Vision) for (Owner of (Ownership-changed unit)) at (Relic_A offset by (-750.00, 750.00)) facing Default building facing degrees


Custom script: call RemoveLocation(udg_Relic_A)


Custom script: call DestroyGroup(udg_Relic_Units)
You can however put them in a group to be used later. You can then make a custom in range check on all units in that group (although less efficient due to JASS being interpreted slowly).Be aware that locust units are ignored for area unit enums, but are included for player unit enums.
call UnitAddAbility(udg_DUMMY, 'Aloc')
call ShowUnit(udg_DUMMY, false)
call call UnitRemoveAbility(udg_DUMMY, 'Aloc')
call ShowUnit(udg_DUMMY, true)
Untitled Trigger 001

Events

Conditions

Actions


Custom script: set udg_ID = GetHandleId(GetTriggerUnit())


For each (Integer A) from 1 to 3, do (Actions)



Loop - Actions




Unit - Remove (Load (Integer A) of ID in Tower_Hash) from the game


Unit - Create 1 Footman for Player 1 (Red) at (Center of (Playable map area)) facing Default building facing degrees


Hashtable - Save Handle Of(Last created unit) as 1 of ID in Tower_Hash


Unit - Create 1 Footman for Player 1 (Red) at (Center of (Playable map area)) facing Default building facing degrees


Hashtable - Save Handle Of(Last created unit) as 2 of ID in Tower_Hash


Unit - Create 1 Footman for Player 1 (Red) at (Center of (Playable map area)) facing Default building facing degrees


Hashtable - Save Handle Of(Last created unit) as 3 of ID in Tower_Hash
Vision Extension

Events

Conditions

Actions


Unit - Create 1 Dummy (Relic Vision) for Neutral Passive at (Relic_A offset by (0.00, 1000.00)) facing Default building facing degrees


Hashtable - Save Handle Of(Last created unit) as 1 of 8 in Tower_Hash_Units


Unit - Create 1 Dummy (Relic Vision) for Neutral Passive at (Relic_A offset by (750.00, 750.00)) facing Default building facing degrees


Hashtable - Save Handle Of(Last created unit) as 2 of 8 in Tower_Hash_Units


Unit - Create 1 Dummy (Relic Vision) for Neutral Passive at (Relic_A offset by (1000.00, 0.00)) facing Default building facing degrees


Hashtable - Save Handle Of(Last created unit) as 3 of 8 in Tower_Hash_Units


Unit - Create 1 Dummy (Relic Vision) for Neutral Passive at (Relic_A offset by (750.00, -750.00)) facing Default building facing degrees


Hashtable - Save Handle Of(Last created unit) as 4 of 8 in Tower_Hash_Units


Unit - Create 1 Dummy (Relic Vision) for Neutral Passive at (Relic_A offset by (0.00, -1000.00)) facing Default building facing degrees


Hashtable - Save Handle Of(Last created unit) as 5 of 8 in Tower_Hash_Units


Unit - Create 1 Dummy (Relic Vision) for Neutral Passive at (Relic_A offset by (-750.00, -750.00)) facing Default building facing degrees


Hashtable - Save Handle Of(Last created unit) as 6 of 8 in Tower_Hash_Units


Unit - Create 1 Dummy (Relic Vision) for Neutral Passive at (Relic_A offset by (-1000.00, 0.00)) facing Default building facing degrees


Hashtable - Save Handle Of(Last created unit) as 7 of 8 in Tower_Hash_Units


Unit - Create 1 Dummy (Relic Vision) for Neutral Passive at (Relic_A offset by (-750.00, 750.00)) facing Default building facing degrees


Hashtable - Save Handle Of(Last created unit) as 8 of 8 in Tower_Hash_Units
