mcnools 62 Posted November 13, 2010 I'm just wondering if there's any way to override the "You died" ending when you.. well, die. I'm working in a mission where at the end, after completing all the main objectives, the player has to fight to the end. And I want a mission complete-screen with score etc. despite dying. Is there any way to accomplish this? Share this post Link to post Share on other sites
madrussian 347 Posted November 15, 2010 Yes. Couple of things to try. First of all you can override the normal death sequence by creating a file called one of the following: onPlayerKilled.sqs onPlayerRepsawnAsSeagull.sqs More info on that here: http://community.bistudio.com/wiki/Event_Scripts Then, depending on which way the mission ends, you get a different dialog at the end. For instance, endMission and failMission present different end game dialogs I believe. Either that or using those commands with different "end types" will result in different end dialogs ("CONTINUE","KILLED","LOSER","END1","END2","END3","END4","END5", or "END6"). Finally if you just get killed in SP I think you just see that simple small dialog with minimal options. Share this post Link to post Share on other sites
mcnools 62 Posted November 16, 2010 Thanks mate, I'll have a look. :) Share this post Link to post Share on other sites
mcnools 62 Posted December 26, 2011 Sorry for bringing this old topic up again, but I'm not sure how to do this. What I want preferably is that if the player dies after a certain time (not just after a minute) the image should fade out to black and the mission will be complete. How would I accomplish that in the onPlayerKilled.sqs? is it even possible to prevent it from activating until after a certain time, or do I just have to skip that idea? Share this post Link to post Share on other sites
sxp2high 23 Posted December 26, 2011 It's for Singleplayer i suppose? If the player dies in Singleplayer the mission ends immediately. Not sure if that can be changed. But i wouldn't actually kill the player to accomplish that. Just play a death animation. Try this: [] spawn { sleep 5; player switchMove "AdthPercMstpSlowWrflDnon_8"; sleep 5; cutText ["", "BLACK OUT", 5]; sleep 5; endMission "End1"; }; The player will "drop dead" after 5 seconds... Share this post Link to post Share on other sites
mcnools 62 Posted December 26, 2011 Singleplayer indeed, creating an empty onPlayerKilled.sqs in the mission-folder makes the end-screen not show up, however, the game sort of locks up aswell, you can't press escape to bring the menu up etc. So I guess something could be done using that script, although I don't now what the code would be. About the death-animation, is it possible to activate it once the player is hit a certain amount of times or such? since I want the player to be killed by the AI, (it's a "last stand" sort of mission where a small squad or special forces are surrounded by overwhelming numbers of enemies, and have to fight to the death). Share this post Link to post Share on other sites
demonized 20 Posted December 26, 2011 One way to work around the custom end is to fake it with a new unit on killed eventhandler. Demo mission OA required Share this post Link to post Share on other sites
sxp2high 23 Posted December 26, 2011 Well i tried that myself now, and the onPlayerKilled.sqs seems to work just fine for that. These three lines do just fine for example: cutText ["", "BLACK OUT", 5] ~5 endMission "End1" Once the player died, the debriefing shows up. :) Share this post Link to post Share on other sites
mcnools 62 Posted December 26, 2011 (edited) Thanks mate! I'll try that at once! Worked like a charm! Edited December 26, 2011 by McNools Share this post Link to post Share on other sites