- Joined
- Sep 24, 2007
- Messages
- 300
I want to create AMH that detects whether selected unit is visible to player or not.
Preety simple triggering...if everything worked as it should. But ofc it doesnt.
I have no idea how to get out the "Selecting player". Triggering Player DOESN'T work (tried "debugging", it failed completely).
edit: I tested out. If player 1 selects his own units, triggering player == player 1. If player 1 selects units owned by player 2, triggering unit == player 2.
Totally messed up thing..
Preety simple triggering...if everything worked as it should. But ofc it doesnt.
I have no idea how to get out the "Selecting player". Triggering Player DOESN'T work (tried "debugging", it failed completely).
-
add units
-
Events
-
Unit - A unit enters (Playable map area)
-
-
Conditions
-
Actions
-
Set array = (array + 1)
-
Set unit[array] = (Triggering unit)
-
Trigger - Add to detect selection <gen> the event (Unit - unit[array] Is selected)
-
-
-
detect selection
-
Events
-
Conditions
-
Actions
-
Set player = (Triggering player)
-
Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
((Triggering unit) is visible to player) Not equal to (!=) True
-
-
Then - Actions
-
Game - Display to (All players) the text: ((Name of player) + is maphacker!)
-
-
Else - Actions
-
-
-
-
edit: I tested out. If player 1 selects his own units, triggering player == player 1. If player 1 selects units owned by player 2, triggering unit == player 2.
Totally messed up thing..