• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

AI: i need help

Status
Not open for further replies.
Level 3
Joined
Apr 16, 2009
Messages
30
hi again

i'm wondering how i can make AI be playable in my map.

my map doesnt have any recource gathering just building units.
but for some reason the AI doesnt do anything when i play singleplayer, can someone help me?

the map im reffering to should be on the first page of maps.

thnx
 
Level 4
Joined
Jun 9, 2008
Messages
86
now i don't think i can help you much but i think people here and I will be glad if you gave a link to the map.
so we don't have to look after it. :D
 
Level 3
Joined
Apr 16, 2009
Messages
30
i havnt added any new AI and i dont really know how to add any, if possible one that is compatible with this map
 
Level 4
Joined
Jun 9, 2008
Messages
86
hmm, now i have some kind of same problem on my map XD

you can make you own but it is hard for beginners, i think ( im beginner :D )

what should you AI do?
spawn things when it hve ress or just keep spawning? or...?
 
Level 3
Joined
Apr 16, 2009
Messages
30
i want my AI to spawn units from a single structure (just one with all the units in it) and also choose heros from a Tavern like hero building.
 
Level 4
Joined
Jun 9, 2008
Messages
86
if the money don't matter you can make it by trigger.
and if you want to pick the same hero each time i know how to do that by trigger, but in make custom AI i'm new and don't know how.
 
Level 3
Joined
Apr 16, 2009
Messages
30
well, maybe it could be like choosing a random unit to create, and choosing the same hero is fine :)
 
Level 4
Joined
Jun 9, 2008
Messages
86
how meny difrent units is it?

only one type ?

and how long should there be betwreen they spawn?
 
Level 3
Joined
Apr 16, 2009
Messages
30
no i already have an auto-spawn for 2 computer players (permanent P11 & P12) i want players 1-8 to have a possible AI available, so like it builds units (and as for how many units its 7 different ones available at the barracks, and 3 different heroes available at the hero shop. :p
 
Level 4
Joined
Jun 9, 2008
Messages
86
well i can't figur out how to make them play like a normal AI because im bad at AI, but i think you should made you own custom AI then.

what i can do ( you can proberly 2 ) is made some triggers there do that when you say ''-AI on'' in chat it start make units and a hero.... i can't get it to play bacause you need to make custom AI, and thats the same problem i have on my map XD
 
Level 4
Joined
Mar 14, 2009
Messages
98
Make triggers that only work for computer-controlled players. Under conditions, in player controller comparison there is something there so you can prevent the triggers from activating with player-controlled units. I believe that the AI editor only works for melee maps, so you'll have to make your own with triggers. A very simple example would be something like this.
  • Run to Fountain
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Percentage life of (Triggering unit)) Less than or equal to 50.00
      • ((Owner of (Triggering unit)) controller) Equal to Computer
    • Actions
      • Unit - Order (Triggering unit) to Move To Fountain
Of course, you'll need more than one event happening to make a good AI. You could make triggers that make the computer train units whenever he gains enough gold, or make the computer regroup his forces whenever he's about to attack. You can also introduce a bit of randomness to it to make it seem more like an actual player is playing (e.g. attacking different points or making an army with different unit compositions). Making an AI is really all about allowing a computer-controlled player to react to events much like a normal player would.
 
Level 3
Joined
Apr 16, 2009
Messages
30
sad face! so is there any way of making it so that it spawns random units from their bases? like.......the ones available, i know how to do constant ones like over a time limit, but how do you do random ones? :p and also ones that are bound to a resource limit?
 
Level 4
Joined
Jun 9, 2008
Messages
86
Make triggers that only work for computer-controlled players. Under conditions, in player controller comparison there is something there so you can prevent the triggers from activating with player-controlled units. I believe that the AI editor only works for melee maps, so you'll have to make your own with triggers. A very simple example would be something like this.
  • Run to Fountain
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Percentage life of (Triggering unit)) Less than or equal to 50.00
      • ((Owner of (Triggering unit)) controller) Equal to Computer
    • Actions
      • Unit - Order (Triggering unit) to Move To Fountain
Of course, you'll need more than one event happening to make a good AI. You could make triggers that make the computer train units whenever he gains enough gold, or make the computer regroup his forces whenever he's about to attack. You can also introduce a bit of randomness to it to make it seem more like an actual player is playing (e.g. attacking different points or making an army with different unit compositions). Making an AI is really all about allowing a computer-controlled player to react to events much like a normal player would.

that make sense :D
one of ht eproblem i had in my map...

so you can't made a AI in the AI editor and then use it for custom map?

(sorry for posting a questin in you thread )
 
Level 4
Joined
Mar 14, 2009
Messages
98
@wuss15 I've tried using the AI editor. It didn't work. Of course, I was making a Hero Arena map when I made an AI, so it didn't work out. By default the computer knew how to cast spells like it would in a normal game (e.g. it would use a silence-based spell like it would use silence in a normal warcraft 3 game even if all the data fields were set to 0 and the skill was completely triggered), but it doesn't work out very well. They didn't seem to run around nor use the fountain or whatever. They just stood there and cast spells when you attacked. But, if you're making an altered melee map, I've read that the AI editor would for those.

@Cherios Of course there are.
  • Train Units
  • Train Units
    • Events
      • Time - Every 15.00 seconds of game time
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player 1 (Red) controller) Equal to Computer
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Number of living Footman units owned by Player 1 (Red)) Less than 4
            • Then - Actions
              • Unit - Order Barracks 0003 <gen> to train/upgrade to a Footman
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Number of living Priest units owned by Player 1 (Red)) Less than 3
                • Then - Actions
                  • Unit - Order Barracks 0003 <gen> to train/upgrade to a Priest
                • Else - Actions
                  • Unit - Order Barracks 0003 <gen> to train/upgrade to a Knight
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player 2 (Blue) controller) Equal to Computer
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Number of living Footman units owned by Player 2 (Blue)) Less than 4
            • Then - Actions
              • Unit - Order Barracks 0006 <gen> to train/upgrade to a Footman
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Number of living Priest units owned by Player 2 (Blue)) Less than 3
                • Then - Actions
                  • Unit - Order Barracks 0006 <gen> to train/upgrade to a Priest
                • Else - Actions
                  • Unit - Order Barracks 0006 <gen> to train/upgrade to a Knight
        • Else - Actions
  • Train Random
    • Events
      • Time - Every 15.00 seconds of game time
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player 1 (Red) controller) Equal to Computer
        • Then - Actions
          • Set RandomVariable = (Random integer number between 1 and 3)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • RandomVariable Equal to 1
            • Then - Actions
              • Unit - Order Barracks 0003 <gen> to train/upgrade to a Footman
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • RandomVariable Equal to 2
                • Then - Actions
                  • Unit - Order Barracks 0003 <gen> to train/upgrade to a Priest
                • Else - Actions
                  • Unit - Order Barracks 0003 <gen> to train/upgrade to a Knight
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player 2 (Blue) controller) Equal to Computer
        • Then - Actions
          • Set RandomVariable = (Random integer number between 1 and 3)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • RandomVariable Equal to 1
            • Then - Actions
              • Unit - Order Barracks 0006 <gen> to train/upgrade to a Footman
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • RandomVariable Equal to 2
                • Then - Actions
                  • Unit - Order Barracks 0006 <gen> to train/upgrade to a Priest
                • Else - Actions
                  • Unit - Order Barracks 0006 <gen> to train/upgrade to a Knight
        • Else - Actions
It's really up to you which one you believe would make a better AI. You can even use a combination of the two if you want.
 
Level 4
Joined
Jun 9, 2008
Messages
86
@wuss15 I've tried using the AI editor. It didn't work. Of course, I was making a Hero Arena map when I made an AI, so it didn't work out. By default the computer knew how to cast spells like it would in a normal game (e.g. it would use a silence-based spell like it would use silence in a normal warcraft 3 game even if all the data fields were set to 0 and the skill was completely triggered), but it doesn't work out very well. They didn't seem to run around nor use the fountain or whatever. They just stood there and cast spells when you attacked. But, if you're making an altered melee map, I've read that the AI editor would for those.

i will use it for map:

red alert 2 :D

we will soon post it under te map maker forum.

its pritty normal map just with others models and a few triggers... but the AI just stand still....
 
Level 3
Joined
Apr 16, 2009
Messages
30
erm.....i have no idea where to find If (All Conditions are True) then do (Then Actions) else do (Else Actions)
can someone please give a step-by-step on how to do this?
thnx
 
Status
Not open for further replies.
Top