HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Can someone help me with this trigger?

07-02-2006, 09:15 PM#1
Sardius
Im trying to do a trigger that when a specific unit hasn't been attacked for about 10 seconds, or simply has no hostile units in the region around him, that he moves to attack the players base immedietly.
07-02-2006, 09:42 PM#2
Alevice
A periodic ran trigger? Timer?

I wouldn't know how to check in a non-event response way wether the unit is being attacked, but you can check if there aren't enemy units around with:

Trigger:
Actions
Collapse Unit Group - Pick every unit in (Units in (Region centered at (Position of YourUnit) with size (256.00, 256.00))) and do (Actions)
Collapse Loop - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Picked unit) Not equal to YourUnit
(Owner of (Picked unit)) Equal to Neutral Hostile
Then - Actions
Else - Actions
07-03-2006, 12:36 AM#3
SFilip
for the event: make a timer variable (call it timer for example) and then
Trigger:
Time - timer expires
and to set it you need another trigger:
Trigger:
Timer
Collapse Events
Unit - <your unit> Is attacked
Conditions
Collapse Actions
Countdown Timer - Start timer as a One-shot timer that will expire in 10.00 seconds
so as you can see this would reset the timer every time a unit is attacked...