johnnyboy wrote:Thanks for posting that, it was helpful. I tried it and sometimes he drops napalm, and sometimes some other type of bombs. How do you get the CAS plane to only drop napalm?
Hello johnnyboy, real fan of your work!
This seems to work better: [casAirplane, ["vn_bomb_500_blu1b_fb_ammo"], 4] call VN_ms_fnc_dropOrdnance;
I ran it a dozen times and dropped 4 napalm bombs every time.
This also works in editor from bardosy @ https://forums.bohemia.net/forums/topic/234692-how-sog-campaign-does-these/:
"You need 3 gamelogic on the map: planspawn (where the plane spawn), plantarget (it's not where the napalm will end, it's just where the plane release the napalm, and planend (where the plane fly away and then disappear)". Align game logics in one line, if you can.
NapalmStrike.sqf:
if (not isServer) exitWith {};
_dropPosX = getPos planspawn select 0;
_dropPosY = getPos planspawn select 1;
_dropPosZ = getPos planspawn select 2;
sleep 0.1;
planespawnpos = [dropPosX, _dropPosY, _dropPosZ + 250];
pilotspawnpos = [dropPosX, _dropPosY, _dropPosZ + 250];
//=========CREATE=======================
sleep 0.1;
_plane = "vn_b_air_f4c_hcas" createvehicle _planespawnpos;
_plane setpos [(getpos _plane select 0),(getpos _plane select 1),250];
_group_i = createGroup West;
_pilot1 = _group_i createUnit ["vn_b_men_jetpilot_10",planspawn, [], 0, "NONE"];
_pilot1 setBehaviour "CARELESS";
_pilot1 setRank "SERGEANT";
_pilot1 setskill 1;
_group_i selectLeader _pilot1;
_pilot2 = _group_i createUnit ["vn_b_men_jetpilot_10",planspawn, [], 0, "NONE"];
_pilot2 setBehaviour "CARELESS";
_pilot2 setRank "SERGEANT";
_pilot2 setskill 1;
_dir = getDir planspawn;
_plane setDir _dir;
_speed = 100;
_plane setVelocity [(sin dirspeed),(cos dirspeed),1];
sleep 0.1;
_pilot1 assignAsDriver _plane;
_pilot1 MoveInDriver _plane;
_pilot1 setdamage 0;
_pilot1 setBehaviour "CARELESS";
_pilot2 assignAsGunner _plane;
_pilot2 MoveInGunner _plane;
_pilot2 setdamage 0;
_pilot2 setBehaviour "CARELESS";
//_pilot1 action ["gear_up", vehicle _pilot1];
_pilot1 action ["engineOn", vehicle _pilot1];
_plane FlyInHeight 250;
_plane SetSpeedMode "full";
for [{i=1},{i<=3},{i=i+1}] do {
_pilot1 doMove getpos plantarget;
sleep 0.3;
_plane setpos [(getpos _plane select 0),(getpos _plane select 1),250];
_plane setVelocity [(sin dirspeed),(cos dirspeed),1];
sleep 0.2;
};
_plane FlyInHeight 250;
_plane SetSpeedMode "normal";
_pilot1 doMove getpos plantarget;
sleep 0.3;
while {(_plane distance plantarget) > 350} do {
_pilot1 setBehaviour "CARELESS";
_plane FlyInHeight 250;
_pilot1 doMove getpos plantarget;
_pilot1 doTarget plantarget;
_pilot1 dowatch plantarget;
sleep 0.5;
};
_pilot1 doMove getPos planend;
_pilot1 doWatch planend;
sleep 0.5;
_plane fire "vn_bomb_blu1b_750_fb_launcher";
sleep 0.5;
_plane fire "vn_bomb_blu1b_750_fb_launcher";
sleep 0.3;
_plane fire "vn_bomb_blu1b_750_fb_launcher";
sleep 1;
_plane fire "vn_bomb_blu1b_750_fb_launcher";
_pilot1 setBehaviour "CARELESS";
_plane FlyInHeight 300;
_pilot1 doMove getPos planend;
_pilot1 doWatch planend;
sleep 10;
deletevehicle _plane;
deletevehicle _pilot2;
deletevehicle _pilot1;