HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Simple attack script.

12-29-2002, 01:59 AM#1
Guest
Is there a premade simple "Computer throws all it's units against the enemy" script? If not, what would I need to include in one?

Appreciate any help.
12-29-2002, 02:15 AM#2
Guest
Well, unfortunately there are very few 'premade' AI scripts of any kind, since each one needs to be at least somewhat specific to the scenario.

As far as making a simple build-and-attack script, that's not too hard at all.

something like this might work (for humans):

Code:
function main takes nothing returns nothing

call CampaignAI(HOUSE, null)

loop
call InitAssaultGroup()
call CampaignAttacker(EASY,3,FOOTMAN)
call CampaignAttacker(EASY,3,RIFLEMAN)
call CampaignAttacker(EASY,3,MORTAR)
call SuicideOnPlayer(180,Player(0))
endloop

This would just tell the AI to send 3 footmen, 3 riflemen, and 3 mortar teams after Red every 3 minutes. Of course it wouldn't do anything else besides some basic resourse gathering, but you get the idea. Just tweak the attacking units and the times some and you'll be good to go.


Of course if you didn't want a specific attack group makeup every time, and just wanted the AI to send any units it has (assuming those units are acquired through triggers) then it would change a bit...