How do i make a melee computer AI upgrade "Zerg melee weapons" at the 10 minute mark as an example.
None.
An artist's depiction of an Extended Unit Death
Assuming the AI player is player 2:
UpgradeAt10Minutes
Events
Timer - Elapsed time is 6000.0 Game Time seconds
Local Variables
Conditions
Actions
Tech Tree - Set Zerg Melee Attacks Level 1 upgrade level to 1 for player 2
That gives the upgrade at 10 minutes automatically if the player does not already have it.
UpgradeAt10Minutes
Events
Timer - Elapsed time is 6000.0 Game Time seconds
Local Variables
Conditions
Actions
AI - Suggests order (Evolution Chamber - Evolve Melee Attacks Level 1) to (Random Living unit from (Evolution Chamber units in (Entire map) owned by player 2 matching Excluded: Missile, Dead, Hidden, with at most Any Amount)) using tactical AI logic
That suggests for the AI to upgrade melee attack level 1 if it has not done so already. Or, more accurately, it picks an Evolution Chamber at random and tells it that it should upgrade Melee Attacks 1 if it can.
Post has been edited 2 time(s), last time on Feb 18 2011, 6:23 am by Roy. Reason: Fixed trigger, added better explanation
Assuming the AI player is player 2:
UpgradeAt10Minutes
Events
Timer - Elapsed time is 6000.0 Game Time seconds
Local Variables
Conditions
Actions
Tech Tree - Set Zerg Melee Attacks Level 1 upgrade level to 1 for player 2
That gives the upgrade at 10 minutes automatically if the player does not already have it.
UpgradeAt10Minutes
Events
Timer - Elapsed time is 6000.0 Game Time seconds
Local Variables
Conditions
Actions
AI - Suggests order (Evolution Chamber - Evolve Melee Attacks Level 1) to (Random Living unit from (Evolution Chamber units in (Entire map) owned by player 2 matching Excluded: Missile, Dead, Hidden, with at most Any Amount)) using tactical AI logic
That suggests for the AI to upgrade melee attack level 1 if it has not done so already. Or, more accurately, it picks an Evolution Chamber at random and tells it that it should upgrade Melee Attacks 1 if it can.
But my game gives the host the option to add computer AI players, so it can be any of the 8 players. Would this work still?
None.
An artist's depiction of an Extended Unit Death
But my game gives the host the option to add computer AI players, so it can be any of the 8 players. Would this work still?
Yeah, you can just apply it to all players that are AI players. This can be achieved by storing the AI players in an array when the host chooses the number of AI players, and then just iterating one of the mentioned triggers for each player in that array. If you need an example of this, just ask and I or someone else will post one.
Note: Players are represented by integers. There is no "Player" variable.
I need an example, please.
None.
An artist's depiction of an Extended Unit Death
Alright, so I'm not sure how you're performing the option for the host, but in that trigger you should add all the AI players being added to a player group (global variable), like so:
PickedAIUnits
Events
------- Your event here
Local Variables
Conditions
Actions
------- Your actions here
------- Say 4 AI players were chosen. Add them to a global variable:
Player Group - Add player 2 to AIPlayerGroupVariable
Player Group - Add player 3 to AIPlayerGroupVariable
Player Group - Add player 4 to AIPlayerGroupVariable
Player Group - Add player 5 to AIPlayerGroupVariable
Then, let's say you're going with the first trigger that automatically gives the upgrade after 10 minutes. Change the actions to iterate over each player in the player group:
UpgradeAt10Minutes
Events
Timer - Elapsed time is 6000.0 Game Time seconds
Local Variables
Conditions
Actions
Player Group - Pick each player in AIPlayerGroupVariable and do (Actions)
Actions
Tech Tree - Set Zerg Melee Attacks Level 1 upgrade level to 1 for player (Picked player)
That should go through each player in the group and give them the upgrade.
Edit: I guess I should have asked this earlier: by "add" do you mean before the game begins you fill computer slots, or you choose how many players in-game? I assumed the latter.
Edit2: If you're doing it via lobby, use this as the first trigger to populate the player group:
Trigger for Lobby-Determined AI
SetComputerGroup
Events
Game - Map initialization
Local Variables
Conditions
Actions
Player Group - Pick each player in (Active Players) and do (Actions)
Actions
General - If (Conditions) then do (Actions) else do (Actions)
If
(Controller of player (Picked player)) == Computer
Then
Player Group - Add player (Picked player) to AIPlayerGroupVariable
Else
Post has been edited 1 time(s), last time on Feb 19 2011, 12:22 am by Roy.
Alright, so I'm not sure how you're performing the option for the host, but in that trigger you should add all the AI players being added to a player group (global variable), like so:
PickedAIUnits
Events
------- Your event here
Local Variables
Conditions
Actions
------- Your actions here
------- Say 4 AI players were chosen. Add them to a global variable:
Player Group - Add player 2 to AIPlayerGroupVariable
Player Group - Add player 3 to AIPlayerGroupVariable
Player Group - Add player 4 to AIPlayerGroupVariable
Player Group - Add player 5 to AIPlayerGroupVariable
Then, let's say you're going with the first trigger that automatically gives the upgrade after 10 minutes. Change the actions to iterate over each player in the player group:
UpgradeAt10Minutes
Events
Timer - Elapsed time is 6000.0 Game Time seconds
Local Variables
Conditions
Actions
Player Group - Pick each player in AIPlayerGroupVariable and do (Actions)
Actions
Tech Tree - Set Zerg Melee Attacks Level 1 upgrade level to 1 for player (Picked player)
That should go through each player in the group and give them the upgrade.
Edit: I guess I should have asked this earlier: by "add" do you mean before the game begins you fill computer slots, or you choose how many players in-game? I assumed the latter.
Edit2: If you're doing it via lobby, use this as the first trigger to populate the player group:
Trigger for Lobby-Determined AI
SetComputerGroup
Events
Game - Map initialization
Local Variables
Conditions
Actions
Player Group - Pick each player in (Active Players) and do (Actions)
Actions
General - If (Conditions) then do (Actions) else do (Actions)
If
(Controller of player (Picked player)) == Computer
Then
Player Group - Add player (Picked player) to AIPlayerGroupVariable
Else
Thanks Roy, I meant adding computers via lobby. I want to do another thing but its a little more complex. Want to help me with it?
None.
An artist's depiction of an Extended Unit Death
Sure, that's why this forum exists