- Joined
- Nov 2, 2004
- Messages
- 1,993
I have a very simple AI script for an allied player hero in a campaign mission. The hero is preplaced and set to level 4 and has 4 skills learned through triggers at init. The next two skills are learned through the AI script.
When he levels up, he correctly learns the skills, and he uses his ult (
The script:
When he levels up, he correctly learns the skills, and he uses his ult (
A00J
/Charge) when in combat. But he doesn't seem to use his basic abilities (except the passive Bash) for some reason. The enemy heroes do use all their abilities as far as I can tell.The script:
JASS:
//============================================================================
// Human 03 -- gavinrad -- AI Script
//============================================================================
function GavinradAI takes nothing returns integer
local integer level = GetHeroLevelAI()
if level == 5 then
return 'AHbh' // Bash
endif
if level == 6 then
return 'A00J' // Charge
endif
return 0
endfunction
//============================================================================
// main
//============================================================================
function main takes nothing returns nothing
call CampaignAI(HOUSE, null)
call SetCaptainHome(BOTH_CAPTAINS, 2400, 250)
call SetBuildUnitEx(1, 1, 1, 'halt')
call SetBuildUnitEx(1, 1, 1, 'Hmkg')
call SetHeroLevels(function GavinradAI)
call CampaignDefenderEx(1, 1, 1, 'Hmkg') // Commander/Gavinrad
call SleepForever()
endfunction
Last edited: