• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Campaign AI Script

Status
Not open for further replies.
Level 20
Joined
Jul 14, 2011
Messages
877
I've been trying to edit this campaign AI, but with no avail. No matter what I try it doesn't seem to work. I tested it by importing it into a melee map and made sure I was playing as the right player and I gave the AI the command it was waiting for (although I doubt that was the problem). I also made sure the raw codes were correctly typed, but it wont build anything.

JASS:
//============================================================================
//  Orc 08 -- purple player -- AI Script
//============================================================================
globals
	player user	 = Player(0)
endglobals


//============================================================================
//  main
//============================================================================
function main takes nothing returns nothing

    call CampaignAI('otrb',null)
	call SetReplacements(3,3,3)
	set do_campaign_farms = false

	call SetBuildUnitEx	( 1,1,1, 'ogre'					)
	call SetBuildUnit	( 1, 'ncpn'					)
    call SetBuildUnit	( 1, 'obar'					)
	call SetBuildUnit	( 5, 'otrb'					)
    call SetBuildUnit	( 1, 'ofor'					)
    call SetBuildUnit	( 8, 'ncpn'					)
	call SetBuildUnit	( 1, 'ostr'					)
	call SetBuildUnit	( 1, 'obea'					)
	call SetBuildUnit	( 1, 'osld'					)

    call CampaignDefenderEx( 1,1,1, 'nchg'  	    )
	call CampaignDefenderEx( 1,1,1, 'nchw'			)
    call CampaignDefenderEx( 1,1,1, 'nchr'			)

	call SetBuildUpgrEx	( 3,3,3, 'Rosp'					)
	call SetBuildUpgrEx	( 1,1,1, 'Robs'					)
	call SetBuildUpgr	( 1, 'Roen'					)

    call WaitForSignal()

    //*** WAVE 1 ***
    call InitAssaultGroup()
    call CampaignAttackerEx( 8,8,8, 'nchg'		)
    call SuicideOnPlayer(M3,user)

    //*** WAVE 2 ***
    call InitAssaultGroup()
    call CampaignAttackerEx( 4,4,4, 'nchg'		)
    call CampaignAttackerEx( 4,4,4, 'nchr'	)
	call SuicideOnPlayer(M9,user)

    //*** WAVE 3 ***
    call InitAssaultGroup()
    call CampaignAttackerEx( 3,3,3, 'nchg'     )
    call CampaignAttackerEx( 2,2,2, 'nchr'    )
	call CampaignAttackerEx( 2,2,2, 'nchw'   )
	//call CampaignAttackerEx( 1,1,1, 'U000:Udea'	)
    call SuicideOnPlayer(M6,user)

    //*** WAVE 4 ***
    call InitAssaultGroup()
    call CampaignAttackerEx( 5,5,5, 'nchg'     )
	call CampaignAttackerEx( 1,1,1, 'nckb'		)
	call CampaignAttackerEx( 2,2,2, 'ocat'		)
    call SuicideOnPlayer(M7,user)

    //*** WAVE 5 ***
    call InitAssaultGroup()
    call CampaignAttackerEx( 6,6,6, 'nchr'    )
	call CampaignAttackerEx( 3,3,3, 'nchw'   )
	//call CampaignAttackerEx( 1,1,1, 'U000:Udea'	)
    call SuicideOnPlayer(M6,user)

    //*** WAVE 6 ***
    call InitAssaultGroup()
    call CampaignAttackerEx( 7,7,7, 'nchg'     )
    call CampaignAttackerEx( 2,2,2, 'ocat'		)
	call CampaignAttackerEx( 4,4,4, 'nchw'   )
    call SuicideOnPlayer(M7,user)

    //*** WAVE 7 ***
    call InitAssaultGroup()
    call CampaignAttackerEx( 7,7,7, 'nchr'    )
	call CampaignAttackerEx( 1,1,1, 'nckb'		)
	call CampaignAttackerEx( 2,2,2, 'nchw'   )
	//call CampaignAttackerEx( 1,1,1, 'U000:Udea'	)
    call SuicideOnPlayer(M6,user)

    //*** WAVE 8 ***
    call InitAssaultGroup()
    call CampaignAttackerEx( 10,10,10, 'nchg'		)
	call CampaignAttackerEx( 3,3,3, 'nchw'   )
    call SuicideOnPlayer(M7,user)

    //*** WAVE 9 ***
    call InitAssaultGroup()
    call CampaignAttackerEx( 5,5,5, 'nchg'     )
    call CampaignAttackerEx( 2,2,2, 'ocat'		)
	call CampaignAttackerEx( 2,2,2, 'nchw'   )
	//call CampaignAttackerEx( 1,1,1, 'U000:Udea'	)
    call SuicideOnPlayer(M6,user)

    //*** WAVE 10 ***
    call InitAssaultGroup()
    call CampaignAttackerEx( 5,5,5, 'nchg'     )
    call CampaignAttackerEx( 5,5,5, 'nchr'    )
	call CampaignAttackerEx( 2,2,2, 'nchw'   )
    call SuicideOnPlayer(M7,user)

    loop
		//*** WAVE 11 ***
		call InitAssaultGroup()
		call CampaignAttackerEx( 5,5,5, 'nchg'     )
		call CampaignAttackerEx( 2,2,2, 'nckb'		)
		call CampaignAttackerEx( 2,2,2, 'ocat'		)
		call CampaignAttackerEx( 2,2,2, 'nchw'   )
		//call CampaignAttackerEx( 1,1,1, 'U000:Udea'	)
		call SuicideOnPlayer(M6,user)

		//*** WAVE 12 ***
		call InitAssaultGroup()
		call CampaignAttackerEx( 5,5,5, 'nchg'     )
		call CampaignAttackerEx( 5,5,5, 'nchr'    )
		call CampaignAttackerEx( 2,2,2, 'nchw'   )
		call SuicideOnPlayer(M7,user)
        
		//*** WAVE 13 ***
		call InitAssaultGroup()
		call CampaignAttackerEx( 8,8,8, 'nchr'	)
		//call CampaignAttackerEx( 1,1,1, 'U000:Udea'	)
        call SuicideOnPlayer(M6,user)

		//*** WAVE 14+ ***
        call InitAssaultGroup()
        call CampaignAttackerEx( 10,10,10, 'nchg'		)
		call CampaignAttackerEx( 5,5,5, 'nchw'   )
        call SuicideOnPlayer(M7,user)
    endloop
endfunction

nchg = Chaos Orc Grunt
nchr = Chaos Orc Raider
nchw = Chaos Orc Warlock
nckb = Chaos Kodo Beast
ocat = Catapult/Demolisher
ocbw = Chaos/Fel Orc Burrow
ncpn = Chaos Orc Peon

EDIT: I managed to solve it and I have no idea how; I edited it again 'from scratch' and it worked. I even ran the texts through a difference checker and they were identicle. Thread can be closed now.
 
Last edited:
Status
Not open for further replies.
Top