Because I am confused greatly as to the placement of AI stuff if not in AIProc itself.
For starters, the best advise i can give you, is DON'T use AIProc for anything.
Triggers for disasters can be put in InitProc:
EXPORT void Quake()
{
TethysGame::SetEarthquake(TethysGame::GetRand(128)+32,TethysGame::GetRand(128)-1,1);
}
EXPORT int InitProc()
{
// some init stuff here..
CreateTimeTrigger(1,0,3000,7000,"Quake");
return 1;
}
The above will create quakes every 30~70 time-marks.
The same can be done for other AI functions:
FightGroup grp1;
EXPORT void CreateTanks()
{
Unit u;
grp1=CreateFightGroup(Player[1]);
grp1.SetRect(MAP_RECT(130,8,134,12));
TethysGame::CreateUnit(u,mapLynx,LOCATION(158,2),1,mapLaser,SouthWest);
grp1.TakeUnit(u);
TethysGame::CreateUnit(u,mapLynx,LOCATION(158,4),1,mapLaser,SouthWest);
grp1.TakeUnit(u);
}
EXPORT void Attack()
{
grp1.AttackEnemy();
}
EXPORT int InitProc()
{
// some init stuff here..
CreateTimeTrigger(1,1,2000,"CreateTanks");
CreateTimeTrigger(1,1,4000,"Attack");
return 1;
}
That code will create 2 lynx at time-mark 20 and send them on the MAP_RECT(130,8,134,12). Then at time-mark 40, they will start attacking enemies.