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

Campaign ai script problem

Status
Not open for further replies.
Level 4
Joined
Dec 1, 2008
Messages
48
Hello. I recently started learning JASS. I was trying to make an .ai file with script for Undead player but the script doesn't work. The Undead player does nothing.

JASS:
    globals
        player orc = Player(0) // Red player
    endglobals

function main takes nothing returns nothing
    call CampaignAI(ZIGGURAT_1,null)
    call SetCaptainHome(ATTACK_CAPTAIN,1246,-1401)

    call SetBuildUnit( 1, NECROPOLIS_1 )
    call SetBuildUnit( 5, ACOLYTE )
    call SetBuildUnit( 6, ZIGGURAT_2 )
    call SetBuildUnit( 2, CRYPT )
    call SetBuildUnit( 1, UNDEAD_ALTAR )
    call SetBuildUnit( 1, GRAVEYARD )
    call SetBuildUnit( 1, DAMNED_TEMPLE )
    call SetBuildUnit( 1, SLAUGHTERHOUSE )
    call SetBuildUnit( 1, UNDEAD_MINE )
    call SetBuildUnit( 1, NECROPOLIS_3 )

    call CampaignDefenderEx( 2, 3, 3, GHOUL )
    call CampaignDefenderEx( 3, 3, 3, ABOMINATION )
    call CampaignDefenderEx( 1, 1, 1, LICH )
    call CampaignDefenderEx( 3, 3, 3, NECRO )

    call WaitForSignal()
    
    //*** WAVE 1 *** AI will begin to attack in 1 minute
    call InitAssaultGroup()
    call CampaignAttackerEx( 3, 3, 3, GHOUL )
	call CampaignAttackerEx( 1, 1, 1, LICH )
    call CampaignAttackerEx( 2, 2, 2, ABOMINATION )  
    call SuicideOnPlayerEx(M1,orc)
    
    //*** WAVE 2 *** Time elapsed 1min ***
    call InitAssaultGroup()
    call CampaignAttackerEx( 4,4,4, GHOUL )
    call CampaignAttackerEx( 2,2,2, ABOMINATION )
    call CampaignAttackerEx( 4,4,4, NECRO )
    call SuicideOnPlayer(M1,orc)
endfunction

I used as an example the JASS script for the purple player from the the Human's fifth mission (March Of The Scourge) from RoC.

Also I've added 350000 gold and lumber to the purple player (which is the one that has to obey the script).
Here are the triggers in the WE:
  • Events
    • Map initiliazation
  • Conditions
  • Actions
    • Player - Set Player 4 (Purple) Current gold to 350000
    • Player - Set Player 4 (Purple) Current lumber to 350000
  • Events
    • Player - Player 2 (Blue) types a chat message containing -start as An exact match
  • Conditions
  • Actions
    • Trigger - Run AI <gen> (ignoring conditions)
    • Trigger - Turn off (This trigger)
  • Events
  • Conditions
  • Actions
    • Wait 4.00 seconds
    • AI - Start campaign AI script for Player 4 (Purple): war3mapImported\ai_testing.ai
    • Wait 2.00 seconds
    • AI - Send Player 4 (Purple) the AI Command (0, 0)
The imported file is called testing_ai.ai
I've been bumping my head trying to find the problem but I have 0 experience with JASS, and I mainly need JASS just for the campaign AI scripts. I also checked moyackx tutorial while making my script.
 
Status
Not open for further replies.
Top