• 0

    posted a message on Adding a hero escort to AI attack wave?

    Thanks for all your suggestions, but I still can't get him to work.

    General - Pick each integer from 10 to 10, and do (Actions)
                Actions
                    AI - Set the target for player (Picked integer) attack waves to be escorting unit group (Any units in (Entire map) owned by player (Picked integer) matching Required: Heroic; Excluded: Missile, Dead, Hidden, with at most Any Amount) with replace behavior Replace Group. This version will leash.
                    AI - Add Jim Raynor AI to the next attack wave for player (Picked integer), the unit is specifically assigned to escort (Closest unit to (Position of Jim Raynor AI) in (Any units in (Entire map) owned by player (Picked integer) matching Required: Heroic; Excluded: Robotic, Missile, Dead, Invulnerable, with at most Any Amount)) offset by 5.0 towards 90.0 degrees.
                    AI - Send the attack wave from player (Picked integer) to attack in 0 seconds and Don't Wait
    

    This is what I made with your help, pplantenga, but he still refuses to follow them. I'm beginning to suspect something is wrong with my variable.

        Actions
            General - Pick each integer from 2 to 2, and do (Actions)
                Actions
                    General - If (Conditions) then do (Actions) else do (Actions)
                        If
                            (Status of player (Picked integer)) != Playing
                        Then
                            Unit - Create 1 Jim Raynor (Commando) for player 10 at Point 011 facing (Random angle) degrees (No Options)
                            Variable - Set Jim Raynor AI = (Last created unit)
                            Unit - Create 1 Barracks for player 10 at Barracks player 2 facing 270.0 degrees (No Options)
                        Else
    

    This is what I use to determine Jim Raynor as the variable. Any ideas?

    Posted in: Triggers
  • 0

    posted a message on Adding a hero escort to AI attack wave?

    @BasharTeg: Go

    My hero is a Biological, Robotic, Heroic and Light hero.

    The ones I want him to escort are Biological, Psionic and Heroic.

    Posted in: Triggers
  • 0

    posted a message on Adding a hero escort to AI attack wave?

    @Tolkfan: Go

    Thank you for all your help, but he still refuses to move.

    AI 2
        Events
            Game - Map initialization
        Local Variables
        Conditions
        Actions
            General - Pick each integer from 2 to 2, and do (Actions)
                Actions
                    General - If (Conditions) then do (Actions) else do (Actions)
                        If
                            (Status of player (Picked integer)) != Playing
                        Then
                            Unit - Create 1 Jim Raynor (Commando) for player 10 at Point 011 facing (Random angle) degrees (No Options)
                            Variable - Set Jim Raynor AI = (Last created unit)
                            Unit - Create 1 Barracks for player 10 at Barracks player 2 facing 270.0 degrees (No Options)
                        Else
    

    That is what I use to set Jim as the variable, then I use this to make him move.

      AI - Add Jim Raynor AI to the next attack wave for player (Picked integer), the unit is specifically assigned to escort (Closest unit to (Position of Jim Raynor AI) in (Any units in (Entire map) owned by player (Picked integer) matching Required: Heroic; Excluded: Robotic, Missile, Dead, Invulnerable, with at most Any Amount)) offset by 5.0 towards 90.0 degrees.
    

    Any idea what I might be missing here?

    Posted in: Triggers
  • 0

    posted a message on Adding a hero escort to AI attack wave?

    @Tolkfan: Go

    Thanks for your help, but then I have another problem. Perhaps not as serious, but nothing I mess around with seems to work.

    I just used Add UnitType because I don't know how to add a specific unit that hasn't actually spawned yet.

    I tried making a Unit variable, saying that Unit = closest unit to point 011, so I could then just refer to the variable whenever I needed the escort. Again, the hero did nothing. Since the hero spawns from a trigger, it doesn't appear in the "Value" list. Do you have any suggestions what else I can use?

    Posted in: Triggers
  • 0

    posted a message on Adding a hero escort to AI attack wave?

    I've made an AI use attack waves just fine - but I do still need to figure out how the Escort ability works.

    In my scenario, I want 6 ghosts to attack towards a point and then have a hero escort them there.

    I'm not sure what I've done wrong, the ghosts attack but the hero doesn't follow after them. Here's my code so far:

    Attack wave 2
        Events
            Timer - Every 121.0 seconds of Real Time
        Local Variables
        Conditions
        Actions
            General - Pick each integer from 10 to 10, and do (Actions)
                Actions
                    General - If (Conditions) then do (Actions) else do (Actions)
                        If
                            Ai kills[(Picked integer)] == 120
                        Then
                            AI - Add (6 / 9 / 9 / 9) Ghost to the attack wave
                            AI - Set the target for player (Picked integer) attack waves to Point 005
                            AI - Add an attack wave waypoint at Player 10 point 1 for player (Picked integer) using Normal Mode
                            AI - Add an attack wave waypoint at Player 10 point 2 for player (Picked integer) using Normal Mode
                            AI - Add an attack wave waypoint at Player 10 point 3 for player (Picked integer) using Normal Mode
                            AI - Add an attack wave waypoint at Player 10 point 4 for player (Picked integer) using Normal Mode
                            AI - Add an attack wave waypoint at Player 10 point 5 for player (Picked integer) using Normal Mode
                            AI - Add an attack wave waypoint at Player 10 point 6 for player (Picked integer) using Normal Mode
                            Unit Group - Pick each unit in (Any units in (Entire map) owned by player 10 matching Required: Robotic; Excluded: Missile, Dead, Hidden, with at most Any Amount) and do (Actions)
                                Actions
                                    General - If (Conditions) then do (Actions) else do (Actions)
                                        If
                                            (Unit type of (Picked unit)) == Jim Raynor (Commando)
                                        Then
                                            AI - Add unit of type (Unit type of (Picked unit)) to the next attack wave for player (Picked integer), the unit is specifically assigned to escort (Closest unit to (Position of (Picked unit)) in (Any units in (Entire map) owned by player (Picked integer) matching Required: Heroic; Excluded: Robotic, Missile, Dead, Invulnerable, with at most Any Amount)) offset by 5.0 towards 90.0 degrees.
                                        Else
                            AI - Send the attack wave from player (Picked integer) to attack in 20 seconds and Don't Wait
                        Else
    

    As said, the hero just stands around in one place. Can anyone see what I've done wrong?

    Posted in: Triggers
  • 0

    posted a message on Need help with attack waves

    @Tolkfan: Go

    It works perfectly! Thank you so much for your help.

    If anyone else happens to google this and has the same problem, this is what I used:

    AI player 4
        Events
            Game - Map initialization
        Local Variables
        Conditions
            (Status of player 4) != Playing
        Actions
            AI - Start the campaign AI for player 12
    
    Posted in: Triggers
  • 0

    posted a message on Need help with attack waves

    Just a quick description of what I have; you and 3 others hold out in a small base from the oncoming zombie apocalypse.

    At first, you choose 1 out of 6 heroes who all have levels.

    Then you choose which units you want to spawn from a dialog. Similar to some tug of wars, you simply click whatever button you want and those units then spawn around your hero.

    The gamemode is extremely difficult for 1 player alone to win, since it's built for 4 player co-op. This is why I want to create an AI for it.

    I've never made an actual AI before, the zombies never needed one, they simply attack the nearest unit.

    I've made a "temporary AI" using lots of different clumsy, non-dynamic triggers. The AI is extremely simple, it says that:

    AI
        Events
            Game - Map initialization
        Local Variables
        Conditions
        Actions
            General - Pick each integer from 1 to 4, and do (Actions)
                Actions
                    General - If (Conditions) then do (Actions) else do (Actions)
                        If
                            (Status of player (Picked integer)) != Playing
                        Then
                            Unit - Create 1 Jim Raynor (Commando) for player (Picked integer) at Point 012 facing (Random angle) degrees (No Options)
                            Trigger - Run AI orders  (Check Conditions, Don't Wait until it finishes)
                        Else
    

    Basically spawns a hero for the player who's not there, meaning that different units will spawn around that hero. They also have the same thinking as the zombies - attack the nearest unit. The biggest problem is that they don't use their abilities since the Tactical AI is not enabled.

    So, what I have so far is:

    AI player 2
        Events
            Game - Map initialization
        Local Variables
        Conditions
            (Status of player 2) != Playing
        Actions
            AI - Start the campaign AI for player 2
    

    and

    Attack wave 2
        Events
            Timer - Every 121.0 seconds of Real Time
        Local Variables
        Conditions
        Actions
            General - Pick each integer from 2 to 2, and do (Actions)
                Actions
                    General - If (Conditions) then do (Actions) else do (Actions)
                        If
                            Ai kills[(Picked integer)] == 120
                            (Status of player (Picked integer)) != Playing
                        Then
                            AI - Add (6 / 6 / 6 / 6) Ghost to the attack wave
                            AI - Set the target for player (Picked integer) attack waves to Point 005
                            AI - Add an attack wave waypoint at Point 005 for player (Picked integer) using Normal Mode
                            AI - Send the attack wave from player (Picked integer) to attack in 5 seconds and Don't Wait
                        Else
    

    So, the campaign AI is started for player 2 and I've added 6 ghosts to the attack wave. Also, a trigger 1 second before this trigger spawns 6 ghosts for player 2, so it should be good to go, right? Well, nothing happens in-game. The units are spawned around Jim Raynor, but they never move out. Does anyone have any idea what might be wrong?

    Posted in: Triggers
  • 0

    posted a message on Simulating AI for custom gamemode

    I've been trying to simulate an AI for my Zombie Survival/Horror mod, in this I have been successful so far.

    When you first start out, you choose one of 6 heroes and can then choose your auto-spawn army from the left dialog.

    I believe the core gameplay is finished, but I want to create a working AI before I publish it.

    I want the AI to "take over" when a slot is empty - not only when it is replaced with an AI slot.

    I can easily create a bunch of different triggers telling the AI to spawn their units along with the player's, but that would be a very clumsy solution.

    I want to create a dynamic AI that grows at the same speed that the player does.

    AI
        Events
            Game - Map initialization
        Local Variables
        Conditions
        Actions
            General - Pick each integer from 1 to 4, and do (Actions)
                Actions
                    General - If (Conditions) then do (Actions) else do (Actions)
                        If
                            (Status of player (Picked integer)) != Playing
                        Then
                            Unit - Create 1 Jim Raynor (Commando) for player (Picked integer) at Point 012 facing (Random angle) degrees (No Options)
                            Trigger - Run AI orders  (Check Conditions, Don't Wait until it finishes)
                        Else
    

    For those who cannot be bothered, it simply says that if a player isn't present, it spawns the hero Jim Raynor for them and runs the next trigger.

    AI orders
        Events
            Timer - Every 30.0 seconds of Game Time
        Local Variables
        Conditions
        Actions
            General - Pick each integer from 1 to 4, and do (Actions)
                Actions
                    General - If (Conditions) then do (Actions) else do (Actions)
                        If
                            (Status of player (Picked integer)) != Playing
                        Then
                            Unit - Order all units in (Any units in (Entire map) owned by player (Picked integer) matching Excluded: Robotic, Missile, Dead, Hidden, with at most Any Amount) to ( Attack targeting (Position of (Random Living unit from (Any units in (Entire map) owned by player Any Player matching Required: Hover; Excluded: Missile, Dead, Hidden, with at most Any Amount)))) (Replace Existing Orders)
                        Else
    

    For those who cannot be bothered, it tells all the AI units (except the "Robotic" hero Jim Raynor) to attack any living zombie in the map.

    Everything above is almost useless when it comes to the real problem, but I just wanted it said so this following part isn't confusing.

    AI periodic spawn variable
        Events
            Timer - Every 119.9 seconds of Real Time
        Local Variables
        Conditions
        Actions
            Variable - Modify Ai kills: + 120
    

    Again, this only means that 0.1 seconds before the auto-spawn army spawns, the integer variable "Ai kills" is being modified to +120.

    Now, here's the actual problem.

    My dialog code says that "Whenever the first dialog option is clicked, it sets (playerchoice[triggering_player] to 0 and (playerunits[triggering_player]) to (Unit types[0]). (Unit types) was set earlier - Unit types[0] means Marines.

    This carries on for all the 20 units available.

    "Whenever the second dialog option is clicked, it sets (playerchoice[triggering_player]) to 1 and (playerunits[triggering_player]) to (Unit types[1]). (Unit types) was set earlier - Unit types[1] means Ghosts.

    Now, obviously, the AI can't press any dialogs themselves - but couldn't that simply be fixed by changing the dialogs another way? For example, instead of using "When dialog option clicked", you can use "When timer elapsed" or even "When any unit dies" if you'd like.

    That's what I've tried here and I'm aware of my problem, but not a solution.

    AI periodic spawn variable 2
        Events
            Timer - Every 120.0 seconds of Real Time
        Local Variables
        Conditions
        Actions
            General - If (Conditions) then do (Actions) else do (Actions)
                If
                    Ai kills == 120
                Then
                    Variable - Set Player choice[(Triggering player)] = 0
                    Variable - Set Player units[(Triggering player)] = Unit types[0]
    
                    General - Pick each integer from 0 to Choices Max, and do (Actions)
                        Actions
                            Dialog - Enable Units dialog items[(Picked integer)] for (Player group((Triggering player)))
                    Dialog - Disable (Used dialog item) for (Player group((Triggering player)))
                Else
           
            General - If (Conditions) then do (Actions) else do (Actions)
                If
                    Ai kills == 240
                Then
                                   Variable - Set Player choice[(Triggering player)] = 1
                    Variable - Set Player units[(Triggering player)] = Unit types[1]
    
                    General - Pick each integer from 0 to Choices Max, and do (Actions)
                        Actions
                            Dialog - Enable Units dialog items[(Picked integer)] for (Player group((Triggering player)))
                    Dialog - Disable (Used dialog item) for (Player group((Triggering player)))
                Else
    

    Noticed my problem yet? No? Let's look again.

    AI periodic spawn variable 2
        Events
           Timer - EVERY 120.0 SECONDS OF REAL TIME
        Local Variables
        Conditions
        Actions
            General - If (Conditions) then do (Actions) else do (Actions)
                If
                    Ai kills == 120
                Then
                    Variable - Set Player choice[(TRIGGERING PLAYER)] = 0
                    Variable - Set Player units[(TRIGGERING PLAYER)] = Unit types[0]
    
                    General - Pick each integer from 0 to Choices Max, and do (Actions)
                        Actions
                            Dialog - Enable Units dialog items[(Picked integer)] for (Player group((Triggering player)))
                    Dialog - Disable (Used dialog item) for (Player group((Triggering player)))
                Else
           
            General - If (Conditions) then do (Actions) else do (Actions)
                If
                    Ai kills == 240
                Then
                                   Variable - Set Player choice[( TRIGGERING PLAYER) ] = 1
                    Variable - Set Player units[(TRIGGERING PLAYER] = Unit types[1]
    
                    General - Pick each integer from 0 to Choices Max, and do (Actions)
                        Actions
                            Dialog - Enable Units dialog items[(Picked integer)] for (Player group((Triggering player)))
                    Dialog - Disable (Used dialog item) for (Player group((Triggering player)))
                Else
    

    The problem is that my event is a timer, but my action is a Triggering player. No player has triggered the timer, so nothing will happen.

    I've tested the AI and it works perfectly, but it only spawns marines because it is stuck in the first dialog option.

    That is my question now - is there anything else I can use to make my dynamic AI change dialogs?

    Sorry for this long and incredibly boring post, this has just been tormenting me for days and any help I could get would be appreciated.

    ((Side note: I realise that this way of doing it isn't dynamic at all - I just wanted to see if I could make the AI change dialogs.))

    ((Also, I do know that the last trigger would trigger the change for everyone, not only the AI. I'm sure I can figure that out on my own, though.))

    Posted in: Triggers
  • To post a comment, please or register a new account.