Re: AI mod suggestions.
Posted: Sun Nov 26, 2017 10:57 am
Not until I have a computer at home again. Everything to do with this game is currently on hiatus until my 'personal issues' are in order.
Army Men RTS Forums, Maps, Cheats, Trainers, Multiplayer, Studio, & More!
https://clanexf.com/forums/
Code: Select all
// Defense Sarge script
CreateScript("personality.tens.offense.scorch")
{
InitialState("Recruit");
CreateVarString("%.types", "");
//CreateVarFloat("%.range", 100.0);
CreateVarInteger("%.acceptInsufficient", 0);
//CreateVarFloat("%.danger", 0.2);
CreateVarInteger("%.cluster.target");
CreateVarString("%.base");
CreateVarString("%.tag", "");
State("Recruit")
{
Action("Recruit", "TypeBase")
{
Config("%.types");
Location()
{
Base("Base", "%.base");
}
Range("%.range");
AcceptInsufficient("%.acceptInsufficient");
Base("%.base");
}
Conditions()
{
Condition("ObjectiveCondition")
{
Condition("Timer")
{
Time(10); // Wait 10 seconds. If we don't have a sarge then abort.
}
Transition()
{
GoToState("HaveSarge");
}
}
}
}
// Do I have a Sarge?
State("HaveSarge")
{
Settings()
{
Setting("Tag")
{
Tag("%.tag");
Append(1);
}
}
Conditions()
{
Condition("Count")
{
Amount(0);
Operator(">");
Transition()
{
GoToState("Find");
}
}
Condition("Count")
{
Amount(0);
Operator("<=");
Transition()
{
GoToState("Abort");
}
}
}
}
State("Find");
CreateVarInteger("%.cluster");
CreateVarString("%.base");
State("Find")
{
Action("ApplyRule")
{
Rule("FindProtectBase");
ArmourClass("structure");
Var("%.cluster");
Base("%.base");
}
Conditions()
{
Condition("Count")
{
Amount(0);
Operator("==");
Transition()
{
GoToState("Wait");
}
}
Status("Completed")
{
GoToState("Move");
}
Status("Failed")
{
GoToState("Wait");
}
}
}
State("Move")
{
Action("Move")
{
Attack(1);
Location()
{
Base("VarCluster", "%.cluster");
}
}
Conditions()
{
Condition("ObjectiveCondition")
{
Condition("Timer")
{
Time(10);
}
Transition()
{
GoToState("Find");
}
}
}
}
State("Wait")
{
Conditions()
{
Condition("Count")
{
Amount(1);
Operator(">");
Transition()
{
GoToState("Find");
}
}
}
}
}
Code: Select all
//CreateVarFloat("%.range", 100.0);
Code: Select all
Action("Recruit", "TypeBase")
{
Config("%.types");
Location()
{
Base("Base", "%.base");
}
Range("%.range");
AcceptInsufficient("%.acceptInsufficient");
Base("%.base");
}
Code: Select all
State("Find");
CreateVarInteger("%.cluster");
CreateVarString("%.base");
State("Find")
{
Code: Select all
CreateVarString("%.types", "");
//CreateVarFloat("%.range", 100.0);
CreateVarInteger("%.acceptInsufficient", 0);
//CreateVarFloat("%.danger", 0.2);
CreateVarInteger("%.cluster.target");
CreateVarString("%.base");
CreateVarString("%.tag", "");
State("Find");
CreateVarInteger("%.cluster");
CreateVarString("%.base");
State("Find")
Code: Select all
Condition("Count")
{
Amount(0);
Operator("<=");
Transition()
{
GoToState("Abort");
}
}
Code: Select all
// Defense infantry
CreateBase::Orderer("personality.default.defense.infantry")
{
Manifest("Level")
{
Script("defense.infantry");
Types()
{
Add("army.unit.grunt",2);
Add("army.unit.grenadier",2);
}
CanBuild(1);
Random(1);
//NoBeyondWeighting(1);
}
}
Code: Select all
// Defense vehicles
CreateBase::Orderer("personality.default.defense.vehicles")
{
Manifest("Level")
{
Script("defense.land");
Types()
{
Add("army.unit.halftrack", 1);
Add("army.unit.tank", 1);
Add("army.unit.medicjeep", 1);
}
CanBuild(1);
Random(1);
//NoBeyondWeighting(1);
}
}
Code: Select all
ExecuteScript("defense.land", "personality.default.defense.land")
{
Op("%.base", "=", "base");
}
Code: Select all
State("Wait")
{
Conditions()
{
Condition("Count")
{
Amount(5);
Operator(">");
Transition()
{
GoToState("Find");
}
}
}
}
}
Code: Select all
///////////////////////////////////////////////////////////////////////////////
//
// Pandemic Studios
//
// AI Personality Configuration - Great Battles
//
// Don't load this for Multi
Random(0);
// Add files to the AI configuration stream
Files("AI")
{
Add("personality_gbblitz_scripts.cfg");
Add("personality_gbblitz_orderers_units.cfg");
Add("personality_gbblitz_bases.cfg");
}
StartActionAll()
{
// Create the base
AddBase("base", "personality.gbblitz.army");
// Add all units currently on the team
AssignBaseConstructors("base");
AssignBaseUnits("base");
// Set up an apropriate unit limit
SetUnitLimit(100);
// Start up the scripts
ExecuteScript("offense.land", "personality.gbblitz.offense.land")
{
Op("%.danger", "=", 0.65);
Op("%.base", "=", "base");
}
ExecuteScript("offense.advland", "personality.gbblitz.offense.advland")
{
Op("%.danger", "=", 0.6);
Op("%.base", "=", "base");
}
ExecuteScript("offense.vehicles", "personality.gbblitz.offense.vehicles")
{
Op("%.danger", "=", 0.5);
Op("%.base", "=", "base");
}
ExecuteScript("offense.air", "personality.gbblitz.offense.air")
{
Op("%.danger", "=", 0.3);
Op("%.base", "=", "base");
}
ExecuteScript("offense.dumdum", "personality.gbblitz.offense.dumdum")
{
Op("%.danger", "=", 0.2);
Op("%.base", "=", "base");
}
ExecuteScript("defense.infantry", "personality.gbblitz.defense.infantry")
{
Op("%.base", "=", "base");
}
ExecuteScript("defense.vehicles", "personality.gbblitz.defense.vehicles")
{
Op("%.base", "=", "base");
}
}
Code: Select all
///////////////////////////////////////////////////////////////////////////////
//
// Pandemic Studios
//
// AI Personality Configuration (Bases)
//
Strategic()
{
CreateBase("personality.gbblitz.army")
{
InitialState("initial");
State("initial")
{
Orderers()
{
// now, get some rudimentary base defense and upgrade
Add("personality.gbblitz.defense.infantry", 1, 10, 0);
Add("personality.gbblitz.offense.infantry", 1, 30, 0);
// start cranking out some defensive vehicles and a barracks upgrade
Add("personality.gbblitz.defense.vehicles", 1, 40, 0);
// Now that we've got a barracks2, lets crank out an attack force
Add("personality.gbblitz.offense.advinfantry", 1, 50, 0);
// vehicles are used in attacks too, y'know!
Add("personality.gbblitz.offense.vehicles", 1, 80, 0);
// go hammer and tongs cranking out units
Add("personality.gbblitz.offense.air", 1, 90, 0);
Add("personality.gbblitz.offense.dumdum", 1, 100, 0);
// and the final touches...
Add("personality.gbblitz.baserepair", 1, 100, 0);
}
}
// here until I figure out what to do with them.
// should provide base defense
State("underattack")
{
Orderers()
{
// Defense
//Add("personality.gbblitz.defense.infantry", 1, 110, 0);
//Add("personality.gbblitz.defense.vehicles", 1, 120, 0);
}
}
}
}
Code: Select all
///////////////////////////////////////////////////////////////////////////////
//
// Pandemic Studios
//
// AI Personality Configuration (Orderers)
//
Strategic()
{
// Offense infantry
CreateBase::Orderer("personality.gbblitz.offense.infantry")
{
Manifest("OrdererLevel")
{
Script("offense.land");
Types()
{
Add("army.unit.tank",2);
}
CanBuild(1);
Random(1);
//NoBeyondWeighting(1);
}
}
// Offense infantry
CreateBase::Orderer("personality.gbblitz.offense.advinfantry")
{
Manifest("OrdererLevel")
{
Script("offense.advland");
Types()
{
Add("army.unit.chopper",2);
}
CanBuild(1);
Random(1);
//NoBeyondWeighting(1);
}
}
// Offense vehicles
CreateBase::Orderer("personality.gbblitz.offense.vehicles")
{
Manifest("OrdererLevel")
{
Script("offense.vehicles");
Types()
{
Add("army.unit.tank", 4);
}
CanBuild(1);
Random(1);
//NoBeyondWeighting(1);
}
}
// Offense air
CreateBase::Orderer("personality.gbblitz.offense.air")
{
Manifest("OrdererLevel")
{
Script("offense.air");
Types()
{
Add("army.unit.chopper", 3);
}
CanBuild(1);
Random(1);
}
}
// Dumdum
CreateBase::Orderer("personality.gbblitz.offense.dumdum")
{
Manifest("OrdererLevel")
{
Script("offense.dumdum");
Types()
{
Add("army.unit.dumdum", 2);
}
CanBuild(1);
Random(1);
//NoBeyondWeighting(1);
}
}
// Defense infantry
CreateBase::Orderer("personality.gbblitz.defense.infantry")
{
Manifest("Level")
{
Script("defense.infantry");
Types()
{
Add("army.unit.machinegunner",3);
Add("army.unit.bazooka",2);
Add("army.unit.sniper",1);
}
CanBuild(1);
Random(1);
//NoBeyondWeighting(1);
}
}
// Defense vehicles
CreateBase::Orderer("personality.gbblitz.defense.vehicles")
{
Manifest("Level")
{
Script("defense.vehicles");
Types()
{
Add("army.unit.chopper",1);
Add("army.unit.tank",1);
}
CanBuild(1);
Random(1);
//NoBeyondWeighting(1);
}
}
// Base repair
CreateBase::Orderer("personality.gbblitz.baserepair")
{
Manifest("Level")
{
Types()
{
Add("army.unit.medicjeep");
}
CanBuild(1);
Random(1);
}
}
}
Code: Select all
///////////////////////////////////////////////////////////////////////////////
//
// Pandemic Studios
//
// AI Personality Configuration (Scripts)
//
Strategic()
{
// Land offense script
CreateScript("personality.gbblitz.offense.land")
{
InitialState("Start");
CreateVarFloat("%.danger", 0.2);
CreateVarInteger("%.cluster.target");
CreateVarString("%.base");
State("Start")
{
Conditions()
{
Condition("ObjectiveCondition")
{
Condition("Timer")
{
Time(270);
}
Transition()
{
GoToState("Wait");
}
}
}
}
State("Find")
{
Action("ApplyRule")
{
Rule("FindUndefendedCluster");
Var("%.cluster.target");
DangerRatio("%.danger");
}
Conditions()
{
Condition("Count")
{
Amount(1);
Operator("<=");
Transition()
{
GoToState("Wait");
}
}
Status("Completed")
{
GoToState("Move");
}
Status("Failed")
{
GoToState("Seek");
}
}
}
State("Seek")
{
Action("ApplyRule")
{
Rule("FindProtectBase");
ArmourClass("structure");
Var("%.cluster.target");
Base("%.base");
}
Conditions()
{
Condition("Count")
{
Amount(1);
Operator("<=");
Transition()
{
GoToState("Wait");
}
}
Status("Completed")
{
GoToState("Move");
}
Status("Failed")
{
GoToState("Find");
}
}
}
State("Move")
{
Action("Move")
{
Attack(1);
Location()
{
Base("VarCluster", "%.cluster.target");
}
}
Conditions()
{
Condition("Count")
{
Amount(0);
Operator("==");
Transition()
{
GoToState("Wait");
}
}
Condition("ObjectiveCondition")
{
Condition("Timer")
{
Time(30);
}
Transition()
{
GoToState("Find");
}
}
Status("Completed")
{
GoToState("Find");
}
}
}
State("Wait")
{
Conditions()
{
Condition("Count")
{
Amount(2);
Operator(">=");
Transition()
{
GoToState("Find");
}
}
}
}
}
/////////////////////////////////////////////////////////////////
// Adv Land
//
CreateScript("personality.gbblitz.offense.advland")
{
InitialState("Start");
CreateVarFloat("%.danger", 0.2);
CreateVarInteger("%.cluster.target");
CreateVarString("%.base");
State("Start")
{
Conditions()
{
Condition("ObjectiveCondition")
{
Condition("Timer")
{
Time(360);
}
Transition()
{
GoToState("Wait");
}
}
}
}
State("Find")
{
Action("ApplyRule")
{
Rule("FindUndefendedCluster");
Var("%.cluster.target");
DangerRatio("%.danger");
}
Conditions()
{
Condition("Count")
{
Amount(1);
Operator("<=");
Transition()
{
GoToState("Wait");
}
}
Status("Completed")
{
GoToState("Move");
}
Status("Failed")
{
GoToState("Seek");
}
}
}
State("Seek")
{
Action("ApplyRule")
{
Rule("FindProtectBase");
ArmourClass("structure");
Var("%.cluster.target");
Base("%.base");
}
Conditions()
{
Condition("Count")
{
Amount(1);
Operator("<=");
Transition()
{
GoToState("Wait");
}
}
Status("Completed")
{
GoToState("Move");
}
Status("Failed")
{
GoToState("Find");
}
}
}
State("Move")
{
Action("Move")
{
Attack(1);
Location()
{
Base("VarCluster", "%.cluster.target");
}
}
Conditions()
{
Condition("Count")
{
Amount(0);
Operator("==");
Transition()
{
GoToState("Wait");
}
}
Condition("ObjectiveCondition")
{
Condition("Timer")
{
Time(30);
}
Transition()
{
GoToState("Find");
}
}
Status("Completed")
{
GoToState("Find");
}
}
}
State("Wait")
{
Conditions()
{
Condition("Count")
{
Amount(2);
Operator(">=");
Transition()
{
GoToState("Find");
}
}
}
}
}
/////////////////////////////////////////////////////////////////
// Adv Land
//
CreateScript("personality.gbblitz.offense.vehicles")
{
InitialState("Start");
CreateVarFloat("%.danger", 0.2);
CreateVarInteger("%.cluster.target");
CreateVarString("%.base");
State("Start")
{
Conditions()
{
Condition("ObjectiveCondition")
{
Condition("Timer")
{
Time(540);
}
Transition()
{
GoToState("Wait");
}
}
}
}
State("Find")
{
Action("ApplyRule")
{
Rule("FindUndefendedCluster");
Var("%.cluster.target");
DangerRatio("%.danger");
}
Conditions()
{
Condition("Count")
{
Amount(3);
Operator("<=");
Transition()
{
GoToState("Wait");
}
}
Status("Completed")
{
GoToState("Move");
}
Status("Failed")
{
GoToState("Seek");
}
}
}
State("Seek")
{
Action("ApplyRule")
{
Rule("FindProtectBase");
ArmourClass("structure");
Var("%.cluster.target");
Base("%.base");
}
Conditions()
{
Condition("Count")
{
Amount(3);
Operator("<=");
Transition()
{
GoToState("Wait");
}
}
Status("Completed")
{
GoToState("Move");
}
Status("Failed")
{
GoToState("Find");
}
}
}
State("Move")
{
Action("Move")
{
Attack(1);
Location()
{
Base("VarCluster", "%.cluster.target");
}
}
Conditions()
{
Condition("Count")
{
Amount(2);
Operator("<=");
Transition()
{
GoToState("Wait");
}
}
Condition("ObjectiveCondition")
{
Condition("Timer")
{
Time(30);
}
Transition()
{
GoToState("Find");
}
}
Status("Completed")
{
GoToState("Find");
}
}
}
State("Wait")
{
Conditions()
{
Condition("Count")
{
Amount(4);
Operator(">=");
Transition()
{
GoToState("Find");
}
}
}
}
}
// Dumdum script
CreateScript("personality.gbblitz.offense.dumdum")
{
InitialState("Start");
CreateVarFloat("%.danger", 0.2);
CreateVarInteger("%.cluster.target");
CreateVarString("%.base");
State("Start")
{
Conditions()
{
Condition("ObjectiveCondition")
{
Condition("Timer")
{
Time(720);
}
Transition()
{
GoToState("Wait");
}
}
}
}
State("Find")
{
Action("ApplyRule")
{
Rule("FindUndefendedCluster");
Var("%.cluster.target");
DangerRatio("%.danger");
}
Conditions()
{
Condition("Count")
{
Amount(1);
Operator("<=");
Transition()
{
GoToState("Wait");
}
}
Status("Completed")
{
GoToState("Move");
}
Status("Failed")
{
GoToState("Seek");
}
}
}
State("Seek")
{
Action("ApplyRule")
{
Rule("FindProtectBase");
ArmourClass("structure");
Var("%.cluster.target");
Base("%.base");
}
Conditions()
{
Condition("Count")
{
Amount(1);
Operator("<=");
Transition()
{
GoToState("Wait");
}
}
Status("Completed")
{
GoToState("Move");
}
Status("Failed")
{
GoToState("Find");
}
}
}
State("Move")
{
Action("Move")
{
Attack(1);
Location()
{
Base("VarCluster", "%.cluster.target");
}
}
Conditions()
{
Condition("Count")
{
Amount(1);
Operator("<=");
Transition()
{
GoToState("Wait");
}
}
Condition("ObjectiveCondition")
{
Condition("Timer")
{
Time(30);
}
Transition()
{
GoToState("Find");
}
}
Status("Completed")
{
GoToState("Find");
}
}
}
State("Wait")
{
Conditions()
{
Condition("Count")
{
Amount(2);
Operator(">=");
Transition()
{
GoToState("Find");
}
}
}
}
}
// Air offense script
CreateScript("personality.gbblitz.offense.air")
{
InitialState("Start");
CreateVarFloat("%.danger", 0.2);
CreateVarInteger("%.cluster.target");
CreateVarString("%.base");
State("Start")
{
Conditions()
{
Condition("ObjectiveCondition")
{
Condition("Timer")
{
Time(180);
}
Transition()
{
GoToState("Wait");
}
}
}
}
State("Find")
{
Action("ApplyRule")
{
Rule("FindUndefendedCluster");
Var("%.cluster.target");
DangerRatio("%.danger");
}
Conditions()
{
Condition("Count")
{
Amount(2);
Operator("<=");
Transition()
{
GoToState("Wait");
}
}
Status("Completed")
{
GoToState("Move");
}
Status("Failed")
{
GoToState("Seek");
}
}
}
State("Seek")
{
Action("ApplyRule")
{
Rule("FindProtectBase");
ArmourClass("structure");
Var("%.cluster.target");
Base("%.base");
}
Conditions()
{
Condition("Count")
{
Amount(2);
Operator("<=");
Transition()
{
GoToState("Wait");
}
}
Status("Completed")
{
GoToState("Move");
}
Status("Failed")
{
GoToState("Find");
}
}
}
State("Move")
{
Action("Move")
{
Attack(1);
Location()
{
Base("VarCluster", "%.cluster.target");
}
}
Conditions()
{
Condition("Count")
{
Amount(1);
Operator("<=");
Transition()
{
GoToState("Wait");
}
}
Condition("ObjectiveCondition")
{
Condition("Timer")
{
Time(30);
}
Transition()
{
GoToState("Find");
}
}
Status("Completed")
{
GoToState("Find");
}
}
}
State("Wait")
{
Conditions()
{
Condition("Count")
{
Amount(3);
Operator(">=");
Transition()
{
GoToState("Find");
}
}
}
}
}
// Land defense script
CreateScript("personality.gbblitz.defense.infantry")
{
InitialState("Find");
CreateVarInteger("%.cluster");
CreateVarString("%.base");
State("Find")
{
Action("ApplyRule")
{
Rule("FindProtectBase");
ArmourClass("structure");
Var("%.cluster");
Base("%.base");
}
Conditions()
{
Condition("Count")
{
Amount(0);
Operator("==");
Transition()
{
GoToState("Wait");
}
}
Status("Completed")
{
GoToState("Move");
}
Status("Failed")
{
GoToState("Wait");
}
}
}
State("Move")
{
Action("Move")
{
Attack(1);
Location()
{
Base("VarCluster", "%.cluster");
}
}
Conditions()
{
Condition("ObjectiveCondition")
{
Condition("Timer")
{
Time(10);
}
Transition()
{
GoToState("Find");
}
}
}
}
State("Wait")
{
Conditions()
{
Condition("Count")
{
Amount(7);
Operator(">");
Transition()
{
GoToState("Find");
}
}
}
}
}
// Land defense script
CreateScript("personality.gbblitz.defense.vehicles")
{
InitialState("Find");
CreateVarInteger("%.cluster");
CreateVarString("%.base");
State("Find")
{
Action("ApplyRule")
{
Rule("FindProtectBase");
ArmourClass("structure");
Var("%.cluster");
Base("%.base");
}
Conditions()
{
Condition("Count")
{
Amount(0);
Operator("==");
Transition()
{
GoToState("Wait");
}
}
Status("Completed")
{
GoToState("Move");
}
Status("Failed")
{
GoToState("Wait");
}
}
}
State("Move")
{
Action("Move")
{
Attack(1);
Location()
{
Base("VarCluster", "%.cluster");
}
}
Conditions()
{
Condition("ObjectiveCondition")
{
Condition("Timer")
{
Time(10);
}
Transition()
{
GoToState("Find");
}
}
}
}
State("Wait")
{
Conditions()
{
Condition("Count")
{
Amount(3);
Operator(">");
Transition()
{
GoToState("Find");
}
}
}
}
}
}