Jump to content
Sign in to follow this  
Dynamic Echo

Helicopter Destruction Help

Recommended Posts

OK, my objective is to make an intro cutscene in which a helicopter (specifically a Wildcat, once BAF is released), gets hit by an RPG, which destabilises it, then gets hit by a second RPG which destroys it.

For the RPG firing I had experimented with attaching an empty ground vehicle (using attachto) to the chopper, then ordering a man to fire an RPG at that. Unfortunately, he seems unwilling to fire at it.

As such, I decided to spawn explosions on the chopper via a script, which works admirably. Also with this script I want to set allowDamage false for the chopper to false initially, so the first explosion doesn't destroy it, and to have a short progression of systems failures before a second explosion. Now, the explosions and the system failures work fine, but with no delay, so the chopper just explodes. Additionally, I can't get the script to set allowDamage false before hand, so the chopper just dies.

Here is the script I am using:

_Heli = _this
{_X allowDamage false} forEach (crew _Heli) + [_Heli]
_bombLoc =  GetPos _Heli
_bombLocX = _bombLoc select 0
_bombLocY = _bombLoc select 1
_bombLocZ = _bombLoc select 2
"R_57mm_HE" createVehicle[_bombLocX, _bombLocY, _bombLocZ]

sleep 1;
_Heli setHit ["mala vrtule", 1]

sleep 4;
_Heli setHit ["motor", 1]

sleep 25;
_bombLoc =  GetPos _Heli
_bombLocX = _bombLoc select 0
_bombLocY = _bombLoc select 1
_bombLocZ = _bombLoc select 2
"R_57mm_HE" createVehicle[_bombLocX, _bombLocY, _bombLocZ]
{_X setDamage 1} forEach (crew _Heli) + [_Heli]

exit

Please help?

Additionally, is it possible to set the camera for the intro to be from the perspective a UAV, and have the camera follow the progress of the chopper to which unfortunate things are happening described above. If so, how would I go about this. (the camera would have to remain fixed on the wreckage as well, as I want the player to see hostiles swarming toward the crash site). Further, would it be possible to script RPGs coming up from the ground to strike the chopper, as this would mean less faffing around with explosions and would look better.

Any help would be gratefully received.

Edited by Dynamic Echo

Share this post


Link to post
Share on other sites

OK, I finally remembered that sleep only works with sqfs, so I converted to that, but now the explosions don't work (allowDamage still seems to be true as well), though the setHits are working fine.

Current script:

sleep 1;
{_X allowDamage false} forEach (crew _Heli) + [_Heli];
_bombLoc =  GetPos _Heli;
_bombLocX = _bombLoc select 0;
_bombLocY = _bombLoc select 1;
_bombLocZ = _bombLoc select 2;
"R_57mm_HE" createVehicle[_bombLocX, _bombLocY, _bombLocZ];

sleep 4;
_Heli setHit ["mala vrtule", 1];

sleep 10;
_Heli setHit ["motor", 1];

sleep 5;
_bombLoc =  GetPos _Heli;
_bombLocX = _bombLoc select 0;
_bombLocY = _bombLoc select 1;
_bombLocZ = _bombLoc select 2;
"R_57mm_HE" createVehicle[_bombLocX, _bombLocY, _bombLocZ];
{_X setDamage 1} forEach (crew _Heli) + [_Heli];

OK, further testing shows that the explosion happens, but induces only the firing of what appears to be a hydra rocket at 45 degrees to the left of the chopper. What the hell? Also the setDamage part of the code works, but the allowDamage part definitely does not.

Still need help with the intro camera and hopefully RPG launches too mind.

Edited by Dynamic Echo

Share this post


Link to post
Share on other sites

This works

{_X allowDamage false} forEach (units _groupname) + [_Heli]

I tried this in a trigger and it works as well.

{_X allowDamage false} forEach (crew heli) + [Heli]

Edited by cobra4v320

Share this post


Link to post
Share on other sites

Oh aye, I know it works in triggers, I was just hoping I could put pretty much everything into the sqs. I'll try the first in the sqs, but I don't think it will cover the pilots (who may die in the explosion otherwise). Ah well, any ideas on the weird rocket effect I'm experiencing in place of the expected explosion?

Also I wouldn't worry about the camera following thing, I think I'll go for a first-person from the eyes of some guy in the chopper style intro. Well, assuming I can get the explosions working (still no luck with getting RPGs to fire at the chopper).

Share this post


Link to post
Share on other sites

If it's just the explosion effect you're looking for, there are such effects which can be used via createVehicle.

"HelicopterExploSmall"
"HelicopterExploBig"
"SmallSecondary"

Share this post


Link to post
Share on other sites

I'm assuming that I would just transplant those in place of the 57mm HE, I'll give it a try.

Edit: OK, that works well. Now, would there be a way for me to set up a blurring effect followed by the game (intro) ending. I tried this (full code) below:

//nul = [Wildcat] exec "heliDamage.sqf"

_Heli = _this select 0;
_height = (position _Heli) select 2;

sleep 1;
_bombLoc =  GetPos _Heli;
_bombLocX = _bombLoc select 0;
_bombLocY = _bombLoc select 1;
_bombLocZ = _bombLoc select 2;
"HelicopterExploSmall" createVehicle[_bombLocX, _bombLocY, _bombLocZ];

sleep 4;
_Heli setHit ["mala vrtule", 1];
_bombLoc =  GetPos _Heli;
_bombLocX = _bombLoc select 0;
_bombLocY = _bombLoc select 1;
_bombLocZ = _bombLoc select 2;
"SmallSecondary" createVehicle[_bombLocX, _bombLocY, _bombLocZ];

sleep 7;
_Heli setHit ["motor", 1];

if ( _height < 7) then
{
   titleCut ["", "BLACK FADED", 999];
   [] Spawn {
	"dynamicBlur" ppEffectEnable true;   
"dynamicBlur" ppEffectAdjust [6];   
"dynamicBlur" ppEffectCommit 0;     
"dynamicBlur" ppEffectAdjust [0.0];  
"dynamicBlur" ppEffectCommit 7;
	titleCut ["", "BLACK OUT", 5]
};
_bombLoc =  GetPos _Heli;
_bombLocX = _bombLoc select 0;
_bombLocY = _bombLoc select 1;
_bombLocZ = _bombLoc select 2;
"HelicopterExploBig" createVehicle[_bombLocX, _bombLocY, _bombLocZ];
"HelicopterExploBig" createVehicle[_bombLocX, _bombLocY, _bombLocZ];
"HelicopterExploBig" createVehicle[_bombLocX, _bombLocY, _bombLocZ];

sleep 3;
ForceEnd;
};

But nothing happened once I dipped below 7 metres. Additionally, what is the maximum speed of a chopper at which AI infantry will target it with small arms? Further, how would I set the helicopter to move at that speed. Full is too fast, but normal is painfully slow. Incidentally, how could I get the pilot of the chopper to say things (preferably as part of the script)? I know how to get VOs in via triggers, is the procedure the same for inclusion via an sqf?

Edited by Dynamic Echo

Share this post


Link to post
Share on other sites

This should give you a start as everything is working at least.

You should call the code with execvm and not how you have it it your script exec

//nul = [Wildcat] execVM "heliDamage.sqf"

_Heli = _this select 0;

_heli allowdamage false;

sleep 1;
"HelicopterExploSmall" createVehicle[getpos _heli select 0, getpos _heli select 1, getpos _heli select 2];
sleep 2;
_Heli setHit ["mala vrtule", 1];
Hint "Tail Rotor Hit";

sleep 7;
"SmallSecondary" createVehicle [getpos _heli select 0, getpos _heli select 1, getpos _heli select 2];
_heli allowdamage true;
_heli setdamage 0.7;
_Heli setHit ["motor", 1];
hint "Motor Damaged";

waitUntil {(getpos _heli select 2) < 7};

"HelicopterExploSmall" createVehicle[getpos _heli select 0, getpos _heli select 1, getpos _heli select 2];
sleep 0.5;

   // titleCut ["Black Fade text here", "BLACK FADED", 1]; 

   [] Spawn {
	"dynamicBlur" ppEffectEnable true;   
"dynamicBlur" ppEffectAdjust [6];   
"dynamicBlur" ppEffectCommit 0;     
"dynamicBlur" ppEffectAdjust [0.0];  
"dynamicBlur" ppEffectCommit 7;
	titleCut ["Black Out Text Here", "BLACK OUT", 5]
};   

sleep 3;
ForceEnd;

There are a few hints that pop up you can remove those as they were just for testing.

I'm not sure you can set the speed of aircraft like you can with land vehicles.

Edited by F2k Sel

Share this post


Link to post
Share on other sites

Oh aye, I know that I should call it with execVM, I just never updated that part (except the sqf and nul = bit) since I switched it from being an sqs. Many thanks for the help with the script, most appreciated. I'll probably just fiddle with triggers to get the speed just right for it and the right moment.

Additionally, I'll be using voiceovers throughout, will these work if I just transplant "unitname say "nameoffile"" in place of the Hints? Anyhoo, many thanks for the aid, most appreciated.

Edit: Somewhat strange issue now - all of the guys in the chopper bail out at the earliest opportunity. Is there any way I can stop them doing this (I tried locking the vehicle).

Edited by Dynamic Echo

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
Sign in to follow this  

×