AI Bonus Script (example)
Posted: Sun Mar 27, 2011 7:35 pm
Some folks were wondering about the script on "how-to" make the AI use a Bonus ...
Note: globals need to be setup beforehand.
- ARTILLERY -
This is a snipet from the D-DAY.BSF ...
For airstrikes you can find that yourself ... But, it's probably going to look basically like it does above, except the following change :
Example ... Hurricane Airstrike :
Hope that explains it.... All cut-n-paste ... takes a few minutes to do.
Merr
Note: globals need to be setup beforehand.
- ARTILLERY -
This is a snipet from the D-DAY.BSF ...
Code: Select all
FUNCTION StartTurn(side)
{
if(side == 1)
{
if (GetGlobal("gTrigger") == 1)
{
if (GetGlobal("gTurn") == 2) // 2 turns after start of the first turn with a unit over the river
{
targetx = Rand (24,28) ;
targety = Rand (38,42) ;
SetBonusBaseValue("GermanArtHitWait", 1, 0) ;
CallBonusFunction("BONUS_GERMAN_BATTERY", 1, targetx, targety, -1) ; // Artillery strike after check-point
}
if (GetGlobal("gTurn") == 4) // 4 turns after start of the first turn with a unit over the river
{
targetx = Rand (25,27) ;
targety = Rand (46,50) ;
SetBonusBaseValue("GermanArtHitWait", 1, 0) ;
CallBonusFunction("BONUS_GERMAN_BATTERY", 1, targetx, targety, -1) ; // Artillery strike on main road
}
}
}
}Example ... Hurricane Airstrike :
Code: Select all
SetBonusBaseValue("HurricaneHitWait", 1, 0) ;
CallBonusFunction("BONUS_HURRICANE_BATTERY", 1, targetx, targety, -1) ;Merr