Help with Melee AI Script

Volkof

Well-Known Member
Reaction score
31
Hi all.

Im not good in Jass so I need all you guys' help.

I need to know how to allow only Players contolled by Computer and is Playing to be run by the default Melee AI. HOWEVER I do not want player 12 to be run by melee AI.

I searched and came across this jass script:

JASS:
function MeleeStartingAI takes nothing returns nothing
    local integer index
    local player  indexPlayer
    local race    indexRace

    set index = 0
    loop
        set indexPlayer = Player(index)
        if (GetPlayerSlotState(indexPlayer) == PLAYER_SLOT_STATE_PLAYING) then
            set indexRace = GetPlayerRace(indexPlayer)
            if (GetPlayerController(indexPlayer) == MAP_CONTROL_COMPUTER) then
                // Run a race-specific melee AI script.
                if (indexRace == RACE_HUMAN) then
                    call PickMeleeAI(indexPlayer, "human.ai", null, null)
                elseif (indexRace == RACE_ORC) then
                    call PickMeleeAI(indexPlayer, "orc.ai", null, null)
                elseif (indexRace == RACE_UNDEAD) then
                    call PickMeleeAI(indexPlayer, "undead.ai", null, null)
                    call RecycleGuardPosition(bj_ghoul[index])
                elseif (indexRace == RACE_NIGHTELF) then
                    call PickMeleeAI(indexPlayer, "elf.ai", null, null)
                else
                    // Unrecognized race.
                endif
                call ShareEverythingWithTeamAI(indexPlayer)
            endif
        endif

        set index = index + 1
        exitwhen index == bj_MAX_PLAYERS
    endloop
endfunction


So now I would like someone to guide me on how to edit this script so that Player 12 will NOT be controlled by AI.


Thanks in advance.
 

Faust

You can change this now in User CP.
Reaction score
123
Why do you want JASS for that?
Trigger:
  • For each (Integer A) from 1 to 11, do (Actions)
    • Loop - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • -=Whatever conditions you need=-
        • Then - Actions
          • AI - Start melee AI script for (Player((Integer A))): map.ai
        • Else - Actions
 

Volkof

Well-Known Member
Reaction score
31
Trigger:
  • Then - Actions
    • AI - Start melee AI script for (Player((Integer A))): map.ai



Can you tell me where I can find this GUI function? I cant find it
 

Faust

You can change this now in User CP.
Reaction score
123
AI - Start Melee AI Script

Conversion - Convert Player Index to Player
 

Volkof

Well-Known Member
Reaction score
31
It doesnt allow me to change.
If you check your Trigger Editor, you will realize that that GUI function is FIXED! There is no dropdown, no hyperlink.

Trigger:
  • Melee Game - Run melee AI scripts (for computer players)



So back to the Jass Script. Any idea?

I need a condition that goes something like
JASS:
If playerIndex != 12 then
Run AI for other players


but as I said Im not good with jass. So what is the exact code?
 

Faust

You can change this now in User CP.
Reaction score
123
Well, considering that I did not type that trigger freehand, but used copy text, it probably exist.

Do you have uptodate editor?
 

Volkof

Well-Known Member
Reaction score
31
Are you using NewGen or World Editor Unlimited?

I hav neither. my Warcraft is patch v1.23
 

Artificial

Without Intelligence
Reaction score
326
Note that it's "AI - ...", not "Melee - ...". You're not gonna find it if you search from the wrong place. If you can't find the 'AI' category, you could use the '- Search for text -->' one (type 'Start Melee AI' there, and the right action should pop up). =)
 

jig7c

Stop reading me...-statement
Reaction score
123
can't you do this

event
map init
condition
action
set Undead = all players matching (matching race equal to Undead)
set Orc = all players matching (matching race equal to Orc
set Human = all players matching (matching race equal to Human)
set Elf = all players matching (matching race equal to Night Elf)

Trig 1
event
elasped game time is 1.00 sec
condition
Pick every player in Undead and do actions
loop actions - AI - Start melee AI script for (Picked Player):undead.ai
Pick every player in Orc and do actions
loop actions - AI - Start melee AI script for (Picked Player):eek:rc.ai
Pick every player in Human and do actions
loop actions - AI - Start melee AI script for (Picked Player):human.ai
Pick every player in Elf and do actions
loop actions - AI - Start melee AI script for (Picked Player):elf.ai
 

Volkof

Well-Known Member
Reaction score
31
Opps you guys are right. I didnt notice that AI function

Thanks for all y our help :)
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top