Jump to content

Recommended Posts

Hello!

 

I'm trying to make a huge and long battle, where bots dinamically creating as waves, and sometimes both sides launch artillery and air strikes to the random choosen enemy target.

Method of choosing the target is simple.

I set big trigger on the map (wich covering area of battle), and choose randomly as

 

Target = list Trigger1 select _rndm;call{[Target] execVM "L39CAS.sqf"}

 

Command DoartilleryTarget makes artillery strikes pretty easy, and i have not problems with realisation.

But i can't to make airstrike;

 

I tried to make something by this method:

1)I created mission on the VirtualReality map, and manually maked airstrike as pilot. And i wrote each "step" by this script

 

_plane = _this select 0;

_string = "";
while {Zapis} do {sleep 0.001;_arp = [velocityModelSpace _plane,vectorDir _plane,vectorUp _plane];_str = format[",%1",_arp];_string = _string + _str;};
copyToClipboard _string;

This _string was copied into separate file "bombrun.sqf". It is a huge array with vectors in each part of time. Size around 240 Kb.

 

2)I set trigger with activation "Radio Alfa", and initiation. It must run the script, when palyer witch into binocular on the tank or building, and call airstrike by radio

call{[CursorTarget] execVM "L39CAS.sqf"}
_target = _this select 0;
_pos = getpos _target;
_posA = getposASL _target;
_h = (_posA select 2) - (_pos select 2);
_ha = 500 + _h;
_y = (_pos select 1) - 5000;
_x = _pos select 0;
_pl = [[_x,_y,_ha], 0, "CUP_O_L39_TK", EAST] call bis_fnc_spawnvehicle;
_plane = _pl select 0;
{_x setBehaviour "Careless";} foreach crew _plane;
call{[_plane] execVM "manevr.sqf"};
_grp = group driver _plane;
_wp = _grp addWaypoint [[_x,_y + 5000,_ha], 0]; 
_wp setWaypointType "MOVE";
[_plane] spawn {sleep 29;while {true} do {[_this select 0, "CUP_Vmlauncher_S5_veh"] call BIS_fnc_fire;sleep 0.02}};
[_plane] spawn {sleep 28;while {true} do {[_this select 0, "CUP_Vacannon_GSh23L_L39"] call BIS_fnc_fire;sleep 0.05}};
sleep 60;
{deletevehicle _x} foreach crew _plane;
deletevehicle _plane;

 

Sub-sqript "manevr.sqf", wich forces plane to make writed manuver

_plane = _this select 0;
_array = call compile preprocessFileLineNumbers "bombrun.sqf";
_count = count _array;
_m = 0;
hint format ["%1",_count];
while {_m < _count} do {sleep 0.001;_vel = (_array select _m) select 0;_dir = (_array select _m) select 1;_up = (_array select _m) select 2;hint format ["%1",_array select _m];_plane setVelocityModelSpace _vel;_plane setVectorDirAndUp [_dir,_up];_m = _m + 1};

 

3)I run this on the Virtual Reality map. And it's working pretty well on this map. Each time created planes hit the target, choosed by player with binocular.

4)I copied it to the mission on Altis. And it is not work.Plane just shaking a little bit, but flying straight forward.

What's a problem?

I'm not very experienced in the sqripting, and i can miss thothing in the command behaviour.

 

Thank you for your attention and help!

 

Share this post


Link to post
Share on other sites

[_plane] spawn {sleep 29;while {true} do {[_this select 0, "CUP_Vmlauncher_S5_veh"] call BIS_fnc_fire;sleep 0.02}};

[_plane] spawn {sleep 28;while {true} do {[_this select 0, "CUP_Vacannon_GSh23L_L39"] call BIS_fnc_fire;sleep 0.05}};

 

while {true}? really? Two never ending spawned scripts for firing a target!

... with a railed plane by setVelocity huge array, instead of waypoint!

 

Well... Ii's a long road to script a workable CAS. Sorry I can't help with your choices. You can save a huge time using the @beno_83au  code.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×