HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Trigger: attack selected unit

10-10-2006, 06:02 AM#1
Meai
I need a trigger like this:

trigger 1:
player selects a unit

trigger 2:
every 0.5 seconds create 1 unit
order last created unit to attack ~selected~ unit. <-- how?
10-10-2006, 06:21 AM#2
Captain Griffen
Use trigger one to set the unit to a global unit variable, and then use that in trigger 2.
10-10-2006, 06:28 AM#3
Fireeye
You have to create the needed attackers in another trigger so there won't spawn endless units.
Trigger:
Attack
Collapse Events
Time - Every 1.00 seconds of game time
Conditions
Collapse Actions
Collapse For each (Integer A) from 1 to "Max Number of Players", do (Actions)
Collapse Loop - Actions
Set temp_group = (Units owned by (Player((Integer A))) matching (((Matching unit) is selected by (Player((Integer A)))) Equal to True))
Unit - Order Attacker[Integer A] to Attack (Random unit from temp_group)
Custom script: call DestroyGroup(udg_temp_group)