If you want Bots that will "Mortar", "Attack" and "Repair" Vehicle Stations automatically.
Well then here you go.
Copy and Paste these lines to the end of your .mis file (that has Bots and Vehicle pads in it !)
Of course you don't have to have the line "//---OBJECT WRITE END---" more than
once at the end of your mission file
[PHP]//--- OBJECT WRITE END ---
//place this script at the end of .mis file that
//has vehicle stations and bots - Lagg-Alot 5-9-2003
//thanks go to DR.Pimento for his help with these functions
function GameStartUp()
{
$ObjectiveCounter[1] = 0;
$ObjectiveCounter[2] = 0;
if ($missionRunning == false)
{
schedule(500, 0, GameStartUp);
return;
}
SweepForPads(NameToID(MissionGroup));
}
function SweepForPads(%simGroup)
{
if(%SimGroup.getClassName() $= "SimGroup")
{
for (%i = 0; %i < %SimGroup.getCount(); %i++)
{
%obj = %SimGroup.getObject(%i);
if (%obj.getClassName() $= "SimGroup")
SweepForPads(%obj);
if (%obj.getClassName() $= "StaticShape")
{
if (%obj.getDataBlock().getName() $= "StationVehicle")
addVPadObjective(%obj);
}
}
}
}
function addVPadObjective(%object)
{
if(%object.team > 0)
{
%homeTeam = %object.team;
if(%homeTeam == 1)
%enemyTeam = 2;
else
%enemyTeam = 1;
//create the repair objective
%repairVPad = new AIObjective(AIORepairObject)
{
dataBlock = "AIObjectiveMarker";
weightLevel1 = $AIWeightRepairTurret[1];
weightLevel2 = $AIWeightRepairTurret[2];
description = "Repair the " @ %object.getDataBlock().getName();
targetObject = %object.getDataBlock().getName();
targetObjectId = %object;
targetClientId = -1;
offense = true;
equipment = "RepairPack";
buyEquipmentSet = "MediumRepairSet";
location = %object.getWorldBoxCenter();
position = %object.getWorldBoxCenter();
};
MissionCleanup.add(%repairVPad);
$ObjectiveQ[%homeTeam].add(%repairVPad);
//create the mortar objective
%mortarVPad = new AIObjective(AIOMortarObject)
{
dataBlock = "AIObjectiveMarker";
weightLevel1 = $AIWeightMortarTurret[1];
weightLevel2 = $AIWeightMortarTurret[2];
description = "Mortar the " @ %object.getDataBlock().getName();
targetObject = %object.getDataBlock().getName();
targetObjectId = %object;
targetClientId = -1;
offense = true;
equipment = "Mortar MortarAmmo";
buyEquipmentSet = "HeavyAmmoSet";
location = %object.getWorldBoxCenter();
position = %object.getWorldBoxCenter();
};
MissionCleanup.add(%mortarVPad);
$ObjectiveQ[%enemyTeam].add(%mortarVPad);
//create the attack objective
%attackVPad = new AIObjective(AIOAttackObject)
{
dataBlock = "AIObjectiveMarker";
weightLevel1 = $AIWeightAttackGenerator[1];
weightLevel2 = $AIWeightAttackGenerator[2];
description = "Attack the " @ %object.getDataBlock().getName();
targetObject = %object.getDataBlock().getName();
targetObjectId = %object;
targetClientId = -1;
offense = true;
equipment = "Plasma PlasmaAmmo";
buyEquipmentSet = "HeavyAmmoSet";
location = %object.getWorldBoxCenter();
position = %object.getWorldBoxCenter();
};
MissionCleanup.add(%attackVPad);
$ObjectiveQ[%enemyTeam].add(%attackVPad);
}
}
GameStartUp(); [/PHP]