Jump to content
CR-4267 Dutch

How can I make only the tail rotor of a helicopter invincible?

Recommended Posts

Hi,

 

I'm working on a mission and I need a helicopter to have an invincible tail rotor but have every other part of the helicopter take damage as normal. Ideally I would want this to work with a vehicle respawn for multiplayer.

 

Does anyone know if this is possible? My apologies if this is a silly question. I'm pretty new to this and a couple hours of google didn't yield me anything that would work.

 

Thank you.

Share this post


Link to post
Share on other sites

I guess you have to use the damage event handler and check for the vehicle part. If it is damaged > 0.1, set its condition back to 0 to "fix" it again. No idea how reliable this is going to work, though.

Share this post


Link to post
Share on other sites
10 hours ago, lexx said:

I guess you have to use the damage event handler and check for the vehicle part. If it is damaged > 0.1, set its condition back to 0 to "fix" it again. No idea how reliable this is going to work, though.

 

Is VRotor the right variable for this? Can it change from vehicle to vehicle? I'm finding everything from VRotor, tail_rotor, or stuff in other languages. 

Share this post


Link to post
Share on other sites

Here's some code:

this addMPEventHandler ["MPHit", {
	_heli = _this select 0;
	if ( _heli getHit "tail_rotor_hit" > 0) then {
		_heli setHit ["tail_rotor_hit",0];
	};
}];

This prevents the tail rotor from getting shot off. The only problem is that collisions are not registered as a "hit".

  • Like 1

Share this post


Link to post
Share on other sites
13 hours ago, 7erra said:

Here's some code:


this addMPEventHandler ["MPHit", {
	_heli = _this select 0;
	if ( _heli getHit "tail_rotor_hit" > 0) then {
		_heli setHit ["tail_rotor_hit",0];
	};
}];

This prevents the tail rotor from getting shot off. The only problem is that collisions are not registered as a "hit".

 

Maybe the Dammaged EH is more suitable?

Share this post


Link to post
Share on other sites

The problem with EH is the locality. The vehicle has to be local when the eventhandler is added, meaning if you put this addEventhandler ["ehName", {_code}];  in the init I am not sure if the eh will fire when the driver is not the server (can't test, no MP). But if it actually works I'd use the HandleDamage eventhandler since the selection of the hit part is already passed into the script. But watch out here's an example video from @killzone_kid what might happen: 

 

Share this post


Link to post
Share on other sites

getIn EH to the heli which adds a HandleDamage EH to it when someone enters,
getOut EH to remove the HandleDamage EH

  • Like 1

Share this post


Link to post
Share on other sites
5 minutes ago, lappihuan said:

getIn EH to the heli which adds a HandleDamage EH to it when someone enters,
getOut EH to remove the HandleDamage EH

but u miss the case of switching seats whereas locallity will probably shift to another driver.

Share this post


Link to post
Share on other sites

actually i'm not sure about that, but if you just check to who the heli is local at init and remoteExec the HandleDamage EH to the client who is the owner then when the heli changes locality it should keep it's EHs applied.

but that would need testing

Share this post


Link to post
Share on other sites

Really? Not sure to understand why it so difficult. Just test:

 

MyHelo addEventHandler ["HandleDamage", {
  private _unit = _this select 0;
   _unit setHitPointDamage ["HitVRotor",0];
   _unit setHitPointDamage ["HitTail",0]
}];

 

On each PC. Nothing more! ... but yes, same code for respawn if needed.

 

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

×