Staredit Network > Forums > SC2 Assistance > Topic: Make computer AI upgrade at specific time.
Make computer AI upgrade at specific time.
Feb 18 2011, 5:03 am
By: thegameplayer  

Feb 18 2011, 5:03 am thegameplayer Post #1



How do i make a melee computer AI upgrade "Zerg melee weapons" at the 10 minute mark as an example.



None.

Feb 18 2011, 5:26 am Roy Post #2

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




Feb 18 2011, 7:28 pm thegameplayer Post #3



Quote from Roy
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.

Feb 18 2011, 11:51 pm Roy Post #4

An artist's depiction of an Extended Unit Death

Quote from thegameplayer
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.




Feb 18 2011, 11:59 pm thegameplayer Post #5



I need an example, please.



None.

Feb 19 2011, 12:14 am Roy Post #6

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


Post has been edited 1 time(s), last time on Feb 19 2011, 12:22 am by Roy.




Feb 19 2011, 4:26 am thegameplayer Post #7



Quote from 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

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.

Feb 19 2011, 4:31 am Roy Post #8

An artist's depiction of an Extended Unit Death

Sure, that's why this forum exists :)




Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[01:36 am]
Moose -- Thinking on it more, I vaguely remember it being annoying because it kept repeating some short loop of the Super Mario World theme LMAO
[12:57 am]
Oh_Man -- I thought i remembered an old mario map but i searched super mario starcraft on utube and i couldnt see anything cept UMS
[11:40 pm]
lil-Inferno -- Blizzard forgot about SC so it's okay
[07:04 pm]
Symmetry -- malware maps for everyone
[07:03 pm]
Moose -- probs lmao
[06:57 pm]
Symmetry -- (and will be patched)
[06:56 pm]
Symmetry -- The old stuff would've gotten patched no? this is current
[06:55 pm]
Moose -- Just made? I thought we had that years ago
[2026-8-09. : 5:23 pm]
Oh_Man -- so someone just made super mario in brood war https://www.youtube.com/watch?v=DmrUcKU65oQ
[2026-8-06. : 2:41 am]
Oh_Man -- i used to play TF2 competitive in that clan, and also was PR manager (ie: i wrote all the website posts)
Please log in to shout.


Members Online: lifebot, NudeRaider