- Joined
- Jun 13, 2012
- Messages
- 113
So the trigger below is for a computer ai.
Basically I made variable player3 that acts as a switch, in order to detect if the computer enter that region. Basically when the computer enters the region it plus 1 to the variable and will retrigger this variable to move the hero again to another region, until it = 4.
The entire trigger works as intended but with, one glaring issue that i cant seem to find a solution to. When the computer enters lets say Barrack region it gets the issue order, but once it gets the order to move to barrack region, the computer just stands on the same region, because its already there.
So is there some sort of condition that will allow the cpu to issue its move order and ignore the region its already in. It can go back to that region later but it shouldnt be able to go back to it if its already in the region.
Basically I made variable player3 that acts as a switch, in order to detect if the computer enter that region. Basically when the computer enters the region it plus 1 to the variable and will retrigger this variable to move the hero again to another region, until it = 4.
The entire trigger works as intended but with, one glaring issue that i cant seem to find a solution to. When the computer enters lets say Barrack region it gets the issue order, but once it gets the order to move to barrack region, the computer just stands on the same region, because its already there.
So is there some sort of condition that will allow the cpu to issue its move order and ignore the region its already in. It can go back to that region later but it shouldnt be able to go back to it if its already in the region.
-
Move to new region Player 3
-
Events
- Game - Player3 becomes Less than or equal to 4.00
-
Conditions
- (Player 3 (Teal) controller) Equal to Computer
- (Player 3 (Teal) Food used) Less than or equal to (Player 3 (Teal) Food cap)
- (Player 3 (Teal) Current gold) Greater than or equal to 150
-
Actions
- Game - Display to (All players) the text: (String((Player 3 (Teal) Current gold)))
- Game - Display to (All players) the text: (String((Player 3 (Teal) Food used)))
- Game - Display to (All players) the text: (String(Player3))
-
Unit Group - Pick every unit in (Units in (Playable map area) owned by Player 3 (Teal)) and do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- ((Picked unit) is A Hero) Equal to True
-
Then - Actions
- Set VariableSet Temp_Point_Copy = RandomPoint[(Random integer number between 8 and RegionNumberForAi)]
- Unit - Order (Picked unit) to Move To Temp_Point_Copy
- Custom script: call RemoveLocation (udg_Temp_Point_Copy)
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Loop - Actions
-
Events