• 🏆 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!

why my ai not working?

Status
Not open for further replies.
Level 1
Joined
Oct 1, 2021
Messages
3
i have some problem

my ai not working

JASS:
globals
    player user     = PlayerEx(1)

    constant integer OGRE_MAULER        = 'o10i' // Ogre Mauler
    constant integer ORC_WARLOCK        = 'o605' // Orc Warlock
    constant integer ORC_WARCHIEF       = 'owar' // Orc Warchief
endglobals

//--------------------------------------------------------------------------------------------------
//  main
//--------------------------------------------------------------------------------------------------
function main takes nothing returns nothing
    call CampaignAI(BURROW,null)

    call SetReplacements(2,3,4)
    call SetHeroesFlee(false)
    call SetGroupsFlee(false)
    call GroupTimedLife(true)
    call SetTargetHeroes(false)
    call SetUnitsFlee(false)
    call SetHeroesTakeItems(false)
    call SetPeonsRepair(true)
    call SetSlowChopping(true)
    set campaign_wood_peons = 2

    call SetBuildUnitEx( 1,1,1, GREAT_HALL      )
    call SetBuildUnitEx( 3,3,3, PEON            )
    call SetBuildUnitEx( 1,1,1, ORC_ALTAR       )
    call SetBuildUnitEx( 1,1,1, ORC_BARRACKS    )
    call SetBuildUnitEx( 5,5,5, PEON            )
    call SetBuildUnitEx( 1,1,1, FORGE           )
    call SetBuildUnitEx( 7,7,7, PEON            )
    call SetBuildUnitEx( 1,6,6, BURROW          )
    call SetBuildUnitEx( 1,2,2, ORC_BARRACKS    )
    call SetBuildUnitEx( 1,1,1, STRONGHOLD      )
    call SetBuildUnitEx( 1,2,2, BESTIARY        )
    call SetBuildUnitEx( 1,2,2, LODGE           )
    call SetBuildUnitEx( 1,1,1, FORTRESS        )
    call SetBuildUnitEx( 1,2,2, TOTEM           )
                                                    
    call CampaignDefenderEx( 1,1,1, BLADE_MASTER         )
    call CampaignDefenderEx( 2,2,2, OGRE_MAULER          )
    call CampaignDefenderEx( 1,2,2, OGRE_MAGI            )
    call CampaignDefenderEx( 1,1,2, HEAD_HUNTER          )
    call CampaignDefenderEx( 1,1,1, TAUREN               )
    call CampaignDefenderEx( 2,3,3, ORC_WARLOCK          )

    call SetBuildUpgrEx( 1,2,3, UPG_ORC_SPIKES      )

    //*** WAVE 1 ***
    call InitAssaultGroup()
    call CampaignAttackerEx( 1,2,2, OGRE_MAULER     )
    call CampaignAttackerEx( 1,1,2, OGRE_MAULER     )
    call CampaignAttackerEx( 2,3,3, ORC_WARLOCK     )
    call CampaignAttackerEx( 2,3,3, OGRE_MAGI       )
    call SuicideOnPlayerEx(M6,user)

    call SetBuildUpgrEx( 1,1,1, UPG_ORC_PILLAGE     )
    call SetBuildUpgrEx( 1,1,1, UPG_ORC_ARMOR       )
    call SetBuildUpgrEx( 1,1,1, UPG_ORC_SPIKES      )

    //*** WAVE 2 ***
    call InitAssaultGroup()
    call CampaignAttackerEx( 1,1,1, BLADE_MASTER    )
    call CampaignAttackerEx( 3,3,4, RAIDER          )
    call CampaignAttackerEx( 3,3,3, ORC_WARLOCK     )
    call CampaignAttackerEx( 2,3,3, OGRE_MAGI       )
    call SuicideOnPlayerEx(M5,M5,M4,user)

    //*** WAVE 3 ***
    call InitAssaultGroup()
    call CampaignAttackerEx( 5,5,6, RAIDER          )
    call CampaignAttackerEx( 2,3,3, ORC_WARLOCK     )
    call CampaignAttackerEx( 2,3,3, OGRE_MAGI       )
    call CampaignAttackerEx( 1,2,2, OGRE_MAULER     )
    call SuicideOnPlayerEx(M5,M5,M4,user)

    call SetBuildUpgrEx( 1,1,2, UPG_ORC_MELEE       )
    call SetBuildUpgrEx( 1,1,2, UPG_ORC_RANGED      )
    call SetBuildUpgrEx( 1,1,1, UPG_ORC_SHAMAN      )

    loop
        //*** WAVE 4 ***
        call InitAssaultGroup()
        call CampaignAttackerEx( 3,4,5, OGRE_MAULER     )
        call CampaignAttackerEx( 2,3,3, OGRE_MAGI       )
        call CampaignAttackerEx( 2,3,3, OGRE_MAGI       )
        call SuicideOnPlayerEx( M5,M5,M4,user)
   
        //*** WAVE 5 ***
        call InitAssaultGroup()
        call CampaignAttackerEx( 3,4,4, OGRE_MAULER     )
        call CampaignAttackerEx( 2,3,3, ORC_WARLOCK     )
        call CampaignAttackerEx( 2,2,2, OGRE_MAGI       )
        call SuicideOnPlayerEx( M5,M5,M4,user)
   
        //*** WAVE 6 ***
        call InitAssaultGroup()
        call CampaignAttackerEx( 1,1,1, BLADE_MASTER    )
        call CampaignAttackerEx( 2,3,3, ORC_WARLOCK     )
        call CampaignAttackerEx( 2,2,2, OGRE_MAULER     )
        call SuicideOnPlayerEx( M5,M5,M4,user)
   
        //*** WAVE 7 ***
        call InitAssaultGroup()
        call CampaignAttackerEx( 2,3,3, ORC_WARLOCK     )
        call CampaignAttackerEx( 2,2,2, OGRE_MAULER     )
        call CampaignAttackerEx( 2,2,2, ORC_WARCHIEF    )
        call SuicideOnPlayerEx( M5,M5,M4,user)
    endloop
endfunction


  • Events:
  • Conditions:
  • Actions:
    • AI - Start melee AI script for Player 2 (Blue):MYAI.ai
 
Last edited:
Level 28
Joined
May 14, 2021
Messages
1,095
I'm not sure but to better understand the problem you'll have to post the detailed issues with that AI. I'm not the professional mapmakers.
 
Level 1
Joined
Oct 1, 2021
Messages
3
i made ai for my campaign map but my ai is not running i have run ai on trigger but still not working, I've checked my ai to jass demo but it still doesn't work
 
Last edited:
Level 1
Joined
Oct 1, 2021
Messages
3
thanks for the reply I've found the solution myself if anyone has a problem like me, if ai doesn't work check your ai with jass demo if it still doesn't work check trigger AI - Start melee AI script for Player that you want to input ai my example
  • Run AI
    • Events:
    • Conditions:
    • Actions:
      • AI - Start melee AI script for Player 2 (Blue): YourAi.ai
or check trigger initializations remove Melee Game - Run melee AI script (for computer players)
  • initializations
    • Events:
    • Conditions:
    • Actions:
      • Melee Game - Run melee AI scripts (for computer players)
 
Last edited:
Status
Not open for further replies.
Top