- Joined
- Nov 14, 2004
- Messages
- 159
I'm trying make AI in my map, but this Selection Event + Selection action never work at least for me. Anyone know proper way to do this?
Or it might be condition doesn't work.
-
picking neutral tower
-
Events
- Player - Player 1 (Red) Selects a unit
- Player - Player 2 (Blue) Selects a unit
- Player - Player 3 (Teal) Selects a unit
- Player - Player 4 (Purple) Selects a unit
- Player - Player 5 (Yellow) Selects a unit
- Player - Player 6 (Orange) Selects a unit
- Player - Player 7 (Green) Selects a unit
- Player - Player 8 (Pink) Selects a unit
- Player - Player 9 (Gray) Selects a unit
- Player - Player 10 (Light Blue) Selects a unit
- Player - Player 11 (Dark Green) Selects a unit
- Player - Player 12 (Brown) Selects a unit
-
Conditions
- ((Triggering player) Current gold) Greater than or equal to 100
- (Owner of (Triggering unit)) Equal to Neutral Passive
- (Unit-type of (Triggering unit)) Equal to Tower
-
Actions
- Set ExistTowerB = False
- Set regpos = (Position of (Triggering unit))
- Region - Center towercheck h <gen> on regpos
- Region - Center towercheck v <gen> on regpos
- Unit Group - Pick every unit in (Units in towercheck h <gen>) and do (If ((Owner of (Picked unit)) Equal to (Triggering player)) then do (Set ExistTowerB = True) else do (Do nothing))
- Unit Group - Pick every unit in (Units in towercheck v <gen>) and do (If ((Owner of (Picked unit)) Equal to (Triggering player)) then do (Set ExistTowerB = True) else do (Do nothing))
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- ExistTowerB Equal to True
-
Then - Actions
- Player - Add -100 to (Triggering player) Current gold
- Unit - Change ownership of (Triggering unit) to (Triggering player) and Change color
- Player - Add 1 to (Triggering player) Current lumber
- Else - Actions
-
If - Conditions
-
Events
-
Decision
-
Events
- Time - Every 0.50 seconds of game time
- Conditions
-
Actions
-
For each (Integer A) from 1 to 12, do (Actions)
-
Loop - Actions
- Set someNum = (Random integer number between 1 and 100)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- ((Player((Integer A))) controller) Equal to Computer
- someNum Less than or equal to 50
-
Then - Actions
- Selection - Select (Random unit from (Units of type Tower)) for (Player((Integer A)))
-
Else - Actions
- If (((Player((Integer A))) controller) Equal to Computer) then do (Unit - Order (Random unit from (Units owned by (Player((Integer A))) of type Tower)) to train/upgrade to a Footman) else do (Do nothing)
-
If - Conditions
-
Loop - Actions
-
For each (Integer A) from 1 to 12, do (Actions)
-
Events
Or it might be condition doesn't work.