Jump to content
Necropaulo

Scripted helicrash and MP

Recommended Posts

Hi everyone, I'm having a problem with the MP again. In my mission, I planned a helicopter crash, called by a script. In SP everything works perfectly, but I'm not sure how to make sure it works in MP.

My chopper is called heli1, its pilots heli1D and heli1G and my group Grognon.

Just before the crash, I force a change in time and weather via two triggers:

 

  • for time:

OnAct

Quote

[[2035, 06, 25, 21, 00], true, true] call BIS_fnc_setDate; // works well in MP

 

  • for weather :

OnAct

Quote

 

{0 setOvercast 0.7;

0 setRain 0.7;

forceWeatherChange;

simulWeatherSync;} foreach units grognon; // not sure it works

 

 

Then, the chopper passes a trigger to call the crash script:

 

OnAct

Quote

[] execVM "scripts\crash.sqf"

 

Maybe using  remoteExec is better, but i'm affraid it didn't work well with a multiple "same script ate same time".

Quote

"scripts\crash.sqf" remoteExec ["execVM", allUnits select { isPlayer _x }];

 

 

  • Crash.sqf
Spoiler

_groupMembers = units grognon;


{_x allowDamage false;} forEach _groupMembers;

 

sleep 1;

 

{playSound3D [ "a3\sounds_f\weapons\explosion\explosion_antitank_1.wss", player, true, ( player getPos [ 15, getDir player ] ) vectorAdd [ 0, 0, 5 ], 5, 1, 0 ];} forEach _groupMembers;

 

heli1 setDamage .98;
heli1 setHitPointDamage ["HitHRotor",.88];
heli1 setHitPointDamage ["HitVRotor",.98];
heli1 setHitPointDamage ["HitEngine",.99];
heli1 allowDamage false;

 

helismoke = "test_EmptyObjectForSmoke" createVehicle (position heli1);
helismoke attachto [heli1, [0,0,0]];

                {
  [] spawn {

    addCamShake [20, 20, 0.2];
    setCamShakeParams [0, 5, 1, 2, true];

              private ["_blur"];
               _blur = ppEffectCreate ["DynamicBlur", 474];
               _blur ppEffectEnable true;
               _blur ppEffectAdjust [0];
               _blur ppEffectCommit 0;

               waitUntil {ppEffectCommitted _blur};

               _blur ppEffectAdjust [20];
               _blur ppEffectCommit 0;


               _blur ppEffectAdjust [0];
               _blur ppEffectCommit 10;

               waitUntil {ppEffectCommitted _blur};

               _blur ppEffectEnable false;
               ppEffectDestroy _blur;}

               ;} forEach _groupMembers;


_pos = getMarkerPos "respawn_west";
deleteMarker "respawn_west";
_mrk = createMarker ["FOB", _pos];
_mrk setMarkerType "Faction_NATO_EP1";
_mrk setMarkerText "FOB Revolver";


waituntil {isTouchingGround heli1};

heli1D setDamage 1;
heli1G setDamage 1;

 

{unassignVehicle (_x);
 (_x) action ["EJECT", vehicle _x];} foreach _groupMembers;

 

waitUntil {isTouchingGround u1};

sleep 2;

heli1 allowDamage true;

sleep 0.5;

heli1 setDamage 1;

sleep 15;

 

{_x allowDamage true;} forEach _groupMembers;


_respawnmrk = createMarker ["respawn_west", player];
_respawnmrk setMarkerType "empty";
_respawnmrk setMarkerText "Site du crash";

 

 

 

Does this seem like an appropriate way of proceeding, or am I missing something?

 

Thanks in advance for your replies!

Share this post


Link to post
Share on other sites

man this brings back memories. messed with this alot in A2. Couple suggestions.

1. if its not super immersion breaking, you may consider just playing the sound of a heli-crash behind a black screen. AI is generally bad at landing extremely damaged helis before fuel leaks out. and even if they do, sometimes it'll be upside-down or some other weird position, that will cause it to look very 'video-gamey'
2. If you do need the helicopter crash to be a visual thing, killing the engine entirely should be enough, this way the rotors keep turning freely so it can autorotate to the ground. Check which heli youre using, they may have multiple engines you need to kill
3. take a look at the biki for https://community.bistudio.com/wiki/isTouchingGround. Depending on where your helicopter is going down, it may not be reliable enough to eject everyone when theyre on the ground, because it may never touch. It could land on top of a building or something.


have fun!
 

  • Like 1

Share this post


Link to post
Share on other sites

if you take a look at this forum maybe you will find something that you can use.
 

 

  • Like 1

Share this post


Link to post
Share on other sites

Thank guys, i'm still working on it !

 

Weather and time skip : check  in SP and MP, with BIS_fnc_setDate and BIS_fnc_setOvercast

Effect, landing and new respawn : check on SP (still testing in MP)

I will explain the global script when i'm sure it is ready to play 😊

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

×