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.
[07:41 pm]
Ultraviolet -- just sent you a message on Discord. I suspect you're probably trying to change unit speeds for units that don't use flingy.dat for movement (like any units that walk instead of hovering/flying). You can change their movement to flingy, but they unfortunately look more like they're gliding than walking when you do that.
[07:31 pm]
Symmetry -- EE2, I've been using setdatfile successfully for units.dat and weapons.dat but the flingy changes don't seem to happen
[05:25 pm]
Ultraviolet -- in EE2 you just open DatEdit, go to the flingy tab, and make whatever changes you want. Though if you want to do dynamic shit, you have to use the trigger editor with the setdatfile action. And of course you have to inject your changes when done. Can give more specific troubleshooting advice if you provide more details
[05:20 pm]
Ultraviolet -- Symmetry
Symmetry shouted: why can't I seem to make eud editor change flingy.dat D:
Are you using EE2 or EE3?
[04:57 pm]
Symmetry -- wdym
[02:24 pm]
Apos -- :wob:
[2026-7-12. : 4:16 am]
NudeRaider -- files in c:\program files\ are protected
[2026-7-11. : 8:11 pm]
Symmetry -- why can't I seem to make eud editor change flingy.dat D:
[2026-7-11. : 4:33 pm]
Ultraviolet -- :wob:
Please log in to shout.


Members Online: Heinermann