- Joined
- Mar 15, 2012
- Messages
- 2,885
The thing that starts this is just a esc key event and sets the unit as well from another trigger.
It works on everything in the testmap except the cage destructible.
Uploaded the map as well just in-case the triggers don't show the issue well enough.
It works on everything in the testmap except the cage destructible.
[trigger=Detect Nearest Destruct]
Events
Conditions
Actions
Destructible - Pick every destructible within 5000.00 of (Position of testunituu) and do (Actions)
Loop - Actions
Set ISD_d = (Picked destructible)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
ISD_d Equal to (Picked destructible)
Then - Actions
Set testdist = (Distance between (Position of testunituu) and (Position of ISD_d))
Set testreal = (testdist / 2.00)
Set count = 0
Destructible - Pick every destructible within testreal of (Position of testunituu) and do (Actions)
Loop - Actions
Set count = (count + 1)
Game - Display to (All players) the text: (String(count))
Set ISD_d = No destructible
Set ISD_d = (Picked destructible)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
count Equal to 1
Then - Actions
Game - Display to (All players) the text: (Name of ISD_d)
Else - Actions
Set testdist = (Distance between (Position of testunituu) and (Position of ISD_d))
Set testreal = (testdist / 2.00)
Set count = 0
Destructible - Pick every destructible within testreal of (Position of testunituu) and do (Actions)
Loop - Actions
Set count = (count + 1)
Game - Display to (All players) the text: (String(count))
Set ISD_d = No destructible
Set ISD_d = (Picked destructible)
Set ISD_d = No destructible
Set ISD_d = No destructible
Else - Actions
Set ISD_d = No destructible
[/trigger]
Events
Conditions
Actions
Destructible - Pick every destructible within 5000.00 of (Position of testunituu) and do (Actions)
Loop - Actions
Set ISD_d = (Picked destructible)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
ISD_d Equal to (Picked destructible)
Then - Actions
Set testdist = (Distance between (Position of testunituu) and (Position of ISD_d))
Set testreal = (testdist / 2.00)
Set count = 0
Destructible - Pick every destructible within testreal of (Position of testunituu) and do (Actions)
Loop - Actions
Set count = (count + 1)
Game - Display to (All players) the text: (String(count))
Set ISD_d = No destructible
Set ISD_d = (Picked destructible)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
count Equal to 1
Then - Actions
Game - Display to (All players) the text: (Name of ISD_d)
Else - Actions
Set testdist = (Distance between (Position of testunituu) and (Position of ISD_d))
Set testreal = (testdist / 2.00)
Set count = 0
Destructible - Pick every destructible within testreal of (Position of testunituu) and do (Actions)
Loop - Actions
Set count = (count + 1)
Game - Display to (All players) the text: (String(count))
Set ISD_d = No destructible
Set ISD_d = (Picked destructible)
Set ISD_d = No destructible
Set ISD_d = No destructible
Else - Actions
Set ISD_d = No destructible
[/trigger]
Uploaded the map as well just in-case the triggers don't show the issue well enough.