- Joined
- Jul 25, 2011
- Messages
- 1,065
I'm making an AI for my map. They move fine but they don't shoot. I made them press hot keys to shoot but they don't shoot please help me.
-
AI target move
-
Events
- Time - Every 5.00 seconds of game time
- Conditions
-
Actions
-
For each (Integer A) from 1 to 12, do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
And - All (Conditions) are true
-
Conditions
- AITarget[(Integer A)] Equal to No unit
- ((Owner of Player[(Integer A)]) slot status) Equal to Is unused
-
Conditions
-
And - All (Conditions) are true
-
Then - Actions
- Set AITarget[(Integer A)] = Player[(Random integer number between 1 and 12)]
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- ((Owner of Player[(Integer A)]) slot status) Equal to Is unused
-
Then - Actions
- Set TP[16] = (Position of AITarget[(Integer A)])
- Unit - Order Player[(Integer A)] to Move To TP[16]
- Custom script: call RemoveLocation(udg_TP[16])
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- ((Owner of Player[(Integer A)]) slot status) Equal to Is unused
-
Then - Actions
- Set TP[18] = (Position of Player[(Integer A)])
- Set TG4 = (Units within 1100.00 of TP[18])
- Custom script: call RemoveLocation(udg_TP[18])
-
Unit Group - Pick every unit in TG4 and do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
And - All (Conditions) are true
-
Conditions
- ((Owner of (Picked unit)) is an enemy of (Owner of Player[(Integer A)])) Equal to True
-
Or - Any (Conditions) are true
-
Conditions
- (Unit-type of (Picked unit)) Not equal to Bullet
- (Unit-type of (Picked unit)) Not equal to Rocket
-
Conditions
-
Conditions
-
And - All (Conditions) are true
-
Then - Actions
- Unit - Order Player[(Integer A)] to Stop
- Set AITarget[(Player number of (Owner of Player[(Integer A)]))] = Player[(Player number of (Owner of (Picked unit)))]
- Set TP[18] = (Position of Player[(Player number of (Owner of (Picked unit)))])
- Unit - Make Player[(Integer A)] face TP[18] over 0.00 seconds
- Custom script: call RemoveLocation(udg_TP[18])
- Wait 1.00 seconds
- Game - Force (Owner of Player[(Integer A)]) to press the key Z
- Wait 1.00 seconds
- Game - Force (Owner of Player[(Integer A)]) to press the key X
- Wait 1.00 seconds
- Game - Force (Owner of Player[(Integer A)]) to press the key C
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Loop - Actions
- Custom script: call DestroyGroup(udg_TG4)
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Loop - Actions
-
For each (Integer A) from 1 to 12, do (Actions)
-
Events
-
AI Shoot
-
Events
- Unit - A unit Is attacked
-
Conditions
- ((Owner of (Triggering unit)) slot status) Equal to Is unused
-
Actions
- Unit - Order Player[(Player number of (Owner of (Triggering unit)))] to Stop
- Set AITarget[(Player number of (Owner of (Triggering unit)))] = Player[(Player number of (Owner of (Attacking unit)))]
- Set TP[17] = (Position of Player[(Player number of (Owner of (Attacking unit)))])
- Unit - Make (Triggering unit) face TP[17] over 0.00 seconds
- Custom script: call RemoveLocation(udg_TP[17])
- Wait 1.00 seconds
- Game - Force (Owner of (Triggering unit)) to press the key Z
- Wait 1.00 seconds
- Game - Force (Owner of (Triggering unit)) to press the key X
- Wait 1.00 seconds
- Game - Force (Owner of (Triggering unit)) to press the key C
-
Events