campaign ia help

Level 4
Joined
Feb 28, 2025
Messages
27
Hello guys

I made this ia code and i put it into my campaign but when i start the mission the ia doesn't start but on a normal map he works... does someone can help me?
:)



globals
player user = Player(1)
endglobals

function main takes nothing returns nothing
call CampaignAI ('otrb' , null)
call SetReplacements (1,2,3)
call SetPeonsRepair (true )

call SetBuildUnitEx (0,0,0, 'opeo')
call SetBuildUnitEx (1,1,1, 'ogre')
call SetBuildUnitEx (1,1,1, 'oalt')
call SetBuildUnitEx (1,1,1, 'ostr')
call SetBuildUnitEx (1,1,1, 'ofor')
call SetBuildUnitEx (2,2,2, 'obar')
call SetBuildUnitEx (2,2,2, 'obea')
call SetBuildUnitEx (9,9,9, 'otrb')
call SetBuildUnitEx (8,8,8, 'owtw')
call SetBuildUnitEx (1,1,1, 'osld')

call CampaignDefenderEx (4,4,5, 'orai')
call CampaignDefenderEx (1,1,1, 'Ofar')


call InitAssaultGroup ()
call CampaignAttackerEx (2,2,3, 'orai')
call SuicideOnPlayerEx (M1,M2,M3,user)
endfunction


and this is the ia base in the mission
1745677394471.png
 
Last edited:
Level 4
Joined
Feb 28, 2025
Messages
27
In the main function, replace call CampaignAI ('otrb' , null) with call CampaignAI(BURROW,null) and see if that changes anything

Apart from that there are no syntax errors so the issue comes from something else
hello thanks for your answer !
I found the problem it was into the players properties XD. But i have another problem, when i add in this script other units with customs units and start my mission the ia doesn't work... this is the version with custom units



(on se parle en anglais alors que l'on vient tout les deux de France x) )
 

Attachments

  • M1clansombreesprit - Copie.ai
    1.2 KB · Views: 3
Level 4
Joined
Feb 28, 2025
Messages
27
Hello another question.
My ia works correctly but i've made another one who also works. But it is for a campaign and i don t no how to automaticaly add computer players into the campaign when the mission starts. In melee game we can add the computer manually before start the game but in campaign no. Can someone help me?
Thanks
 
Top