panicsferd 25 Posted July 21, 2016 What I would like to know how to do is make it so that when the player is killed on this mission that I'm working on it will not go to the death screen where you load/restart and to then have the mission fail with the briefing and whatnot. A thing I would like to have happen would be to have it once the player dies and before the end briefing scene would happen would be for my credits to roll for my mission (this mission would be the last mission of my campaign) I tried messing with the onPlayerKilled.sqf or onPlayerKilled.sqs but I don't seem to doing it correctly or don't know what I'm doing and when I die while in the editor it locks Arma 3 completely up and I have to task manager exit it. Share this post Link to post Share on other sites
theend3r 83 Posted July 21, 2016 To avoid editing the death screen, you could try using the dammaged event handler to check if the damage would kill the player. If it were fatal then you'd player enableDamage false and roll the credits. Share this post Link to post Share on other sites
panicsferd 25 Posted July 21, 2016 To avoid editing the death screen, you could try using the dammaged event handler to check if the damage would kill the player. If it were fatal then you'd player enableDamage false and roll the credits. It looks like using that will work, I will have to tweak with the number I use for the damage... since with testing it in the editor it works better if the player if pretty far from the enemy, if it is more close range then the player dies and then it goes to the regular death screen. as of now I have it set, at .45, I will just have to tweak with the values... Also if other people want to know how to do the syntax it is here below: this addEventHandler ["Dammaged", {if ((_this select 2) >= .45) then {p1 allowdamage false; p1 setCaptive true; nul = [] execVM "credits.sqf";};}]; What this code would do is when the player as damaged greater than .45 it will then make it so he is set as a captive (so the enemy would stop shooting) then it will make it so the player can't be damaged anymore. I placed this in my unit p1's init field. Share this post Link to post Share on other sites
theend3r 83 Posted July 21, 2016 It looks like using that will work, I will have to tweak with the number I use for the damage... since with testing it in the editor it works better if the player if pretty far from the enemy, if it is more close range then the player dies and then it goes to the regular death screen. as of now I have it set, at .45, I will just have to tweak with the values... Also if other people want to know how to do the syntax it is here below: this addEventHandler ["Dammaged", {if ((_this select 2) >= .45) then {p1 allowdamage false; p1 setCaptive true; nul = [] execVM "credits.sqf";};}]; What this code would do is when the player as damaged greater than .45 it will then make it so he is set as a captive (so the enemy would stop shooting) then it will make it so the player can't be damaged anymore. I placed this in my unit p1's init field. It should be _this select 2 >= 1 - damage player, imo. Still, it's a not good solution to your problem, just a workaround. Share this post Link to post Share on other sites
panicsferd 25 Posted July 21, 2016 It should be _this select 2 >= 1 - damage player, imo. Still, it's a not good solution to your problem, just a workaround. After searching I found another way to do it, that seems to work a lot better. I found a way to make it so that the player can be damaged, but he can't be killed. Then with using my above script from above I have it set at _this select 2 >=.95 and with the added script from below it seems to work perfectly; whereas, the player can still be damaged but not damaged enough where he will die before the first code is called. I have both of these placed in my players init. this addEventHandler ["HandleDamage", { _dam = _this select 2; if (_dam > 0.95) then {_dam = 0.9}; _dam }]; 1 Share this post Link to post Share on other sites