• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[AI] Melee AI

Status
Not open for further replies.
Level 2
Joined
Apr 10, 2004
Messages
13
how do i set melee AI for just 1 player?
i know i have to do "AI- set melee ai for player"
but when it says "set melee ai for player: "
what do i put after the :
 
Level 13
Joined
Jan 9, 2004
Messages
1,037
I'm not sure what you are asking. Did you make a melee map and are trying to give it AI? If so, don't do add any triggers. But if you made a custom map that you want a specific player to have melee AI, just set it to the player you want to have AI.
 
Level 6
Joined
Jun 16, 2004
Messages
237
You must create an AI script by using the AI editor or JASS. You import that script into the map by using the Import Manager (or Add to Map command in the AI editor) and insert the script after ":".

Hope it helped!

Cheers,

Tommi
 
Level 2
Joined
Apr 10, 2004
Messages
13
thx, i was asking what darkshadow said.
but is there any way for me 2 get the melee
AI script blizzard created to run for only one computer
player?
 
Level 6
Joined
Jun 16, 2004
Messages
237
Wow! Now I understood your question!

I think you have to do it the hard way. Import all racial AI scripts to your map (they are in AI Scripts folder under WarCraft III), check the race of the computer player, and start an appropriate script for the player.
 
Level 6
Joined
Jun 16, 2004
Messages
237
Well, actually the AI scripts need not be imported. I misrecalled things. They are not found in the AI folder either. However, I found the solution. I tested it and it works. See the example below:

Code:
Melee Initialization
    Events
        Map initialization
    Conditions
    Actions
        Melee Game - Use melee time of day (for all players)
        Melee Game - Limit Heroes to 1 per Hero-type (for all players)
        Melee Game - Give trained Heroes a Scroll of Town Portal (for all players)
        Melee Game - Set starting resources (for all players)
        Melee Game - Remove creeps and critters from used start locations (for all players)
        Melee Game - Create starting units (for all players)
        Visibility - Create an initially Enabled visibility modifier for Player 1 (Red) emitting Visibility across (Playable map area)
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Race of Player 2 (Blue)) Equal to Human
            Then - Actions
                AI - Start melee AI script for Player 2 (Blue): Scripts/human.ai
            Else - Actions
                Do nothing
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Race of Player 2 (Blue)) Equal to Orc
            Then - Actions
                AI - Start melee AI script for Player 2 (Blue): Scripts/orc.ai
            Else - Actions
                Do nothing
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Race of Player 2 (Blue)) Equal to Undead
            Then - Actions
                AI - Start melee AI script for Player 2 (Blue): Scripts/undead.ai
            Else - Actions
                Do nothing
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Race of Player 2 (Blue)) Equal to Night Elf
            Then - Actions
                AI - Start melee AI script for Player 2 (Blue): Scripts/elf.ai
            Else - Actions
                Do nothing

The scripts are in fact in Scripts folder (inside MPQs) and they are named as in the above example (human.ai, orc.ai, undead.ai, and elf.ai).

Cheers,

Tommi
 
Status
Not open for further replies.
Top