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!

  • Like 1

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

Hi Folks,

 

I'm strictly SP - man - what a fine script. I'm trying to make a cut scene for a helicopter rescue - in Nam. Most of the Helicopter scripts are DOA because they are so old. I set this up for a test mission and with some minor editing (I don't plan on being on the aircraft) - works perfectly.

 

WOW!!!

 

____________________________________________________________________________________________________

 

 

Here's my full test mission - just to get your script working.

 

Launch - wait 60 seconds or so - and watch.

 

Only mods needed - CBA and SOG Prairie Fire. Using ALTIS for good visibility.

 

Helicopter Crash Test Mission:

https://mega.nz/file/U9owlQCK#tNldWGw-K8obsmAW-LgMu_Ztx_XiPdQBkl2zucr7TS0

 

Thanks so much.

 

Regards,
Scott

  • Like 2

Share this post


Link to post
Share on other sites

Hi Folks,

 

TAKE TWO - if anyone has interest.

 

Same mission I posted before but now with full cinematic camara usage - as my proof of concept.

 

I think it adds depth for the mission with the opening crash cinematic - to know what the rescue mission is based off of.

 

I added ACE and 3DEN - to the required mods - plus SOG PF and CBA.

 

I'm so happy with how your crash script worked out. I did change the explosion audio.

 

No action required - just enjoy the cinematic.

 

Cinematic Camera Helo Crash:

https://mega.nz/file/00wg2SrA#n91oHjl-8UfcDuI3Gb1MT2Olb8cKNcuij5PmDPvAXrM

 

Regards,
Scott

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

×