CR-4267 Dutch 1 Posted July 18, 2017 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
lexx 1392 Posted July 18, 2017 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
CR-4267 Dutch 1 Posted July 18, 2017 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
7erra 629 Posted July 18, 2017 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". 1 Share this post Link to post Share on other sites
sarogahtyp 1109 Posted July 19, 2017 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
7erra 629 Posted July 19, 2017 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
lappihuan 178 Posted July 19, 2017 getIn EH to the heli which adds a HandleDamage EH to it when someone enters, getOut EH to remove the HandleDamage EH 1 Share this post Link to post Share on other sites
sarogahtyp 1109 Posted July 19, 2017 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
lappihuan 178 Posted July 19, 2017 indeed, these EHs will help in that case:https://community.bistudio.com/wiki/Arma_3:_Event_Handlers#Localhttps://community.bistudio.com/wiki/Arma_3:_Event_Handlers#SeatSwitchedhttps://community.bistudio.com/wiki/Arma_3:_Event_Handlers#SeatSwitchedMan Share this post Link to post Share on other sites
lappihuan 178 Posted July 19, 2017 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
pierremgi 4906 Posted July 19, 2017 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