
Oh that was a little error, I fixed it now though

Code: Select all
//All are ready to attack.
//Set attack strategy.
ai_attack_strategy = Replace(ai_attack_strategy,base,Rand(1,4));
Not sure what you mean.For future maps would it be easier to have 2 attack paths using attack_hexs or to make a list of the dangerous vehicles and use ComAggressiveMove?
In the preparation part you set "ai_attack_strategy" for the base to something appropriate given the current situation. In the attack control code you build up "attack_hexes" and "init_attack_hexes" according to the value of "ai_attack_strategy". I admit it's a little silly. Why not just build the attack hexes in the preparation? That would also improve performance a bit. But under some circumstances it's convenient, e.g. when dealing with behemoths.Oh and where exactly do I define each strategy, is it just each set of Attack_hexs?
I just meant which is easier for planning attacks but nevermindNot sure what you mean.
I understand now, very good generic command for setting attacksIn the preparation part you set "ai_attack_strategy" for the base to something appropriate given the current situation. In the attack control code you build up "attack_hexes" and "init_attack_hexes" according to the value of "ai_attack_strategy". I admit it's a little silly. Why not just build the attack hexes in the preparation? That would also improve performance a bit. But under some circumstances it's convenient, e.g. when dealing with behemoths.
Code: Select all
//All are ready to attack.
//Set attack strategy.
case base of
1: begin
ai_attack_strategy = Replace(ai_attack_strategy,base,1);
end;
Code: Select all
1: begin //Russians
//Strategy 1 - Attack Alliance and later Americans.
init_attack_hexes = [[44,17],[72,29],[72,29]]; //Double indended to make vehicles gather at that hex
attack_hexes = init_attack_hexes;
if ai_attack_strategy[base] = 1 then
begin
attack_hexes = attack_hexes ^ [[69,37],[67,46],[59,55],[56,66],[56,66],[64,84],[67,99]]; //Attack Alliance. Double indended to make vehicles gather at that hex
end;
Code: Select all
Every 0$1 do
var a;
begin a = [1,2]; a = a[10]; end;
[some code]
Every 0$2 do
var a;
begin a = [1,2]; a = a[10]; end;
[some more code]
Every 0$3 do
var a;
begin a = [1,2]; a = a[10]; end;
Code: Select all
//Order the vehicles to attack an enemy unit near the base.
case base of
1: temp_list = DangerousUnits(FilterAllUnits([[f_enemy,side],[f_inarea,ru_vehicle_defend_area]]));
2: temp_list = DangerousUnits(FilterAllUnits([[f_enemy,side],[f_inarea,am_vehicle_defend_area]]));
3: temp_list = DangerousUnits(FilterAllUnits([[f_enemy,side],[f_inarea,ar_vehicle_defend_area]]));
end; DangerousUnits( ListFilterNearBaseArea( FilterAllUnits([f_enemy,side]), area) ); //***1
Code: Select all
wait(0$1 mod (ai_bases diff 2));
for base in (ai_bases diff 2) do
begin
wait(0$1 div (ai_bases diff 2));
Code: Select all
wait(0$1 mod (ai_bases+0));
for base in ai_bases do
begin
wait(0$1 div (ai_bases+0));