End game when NPC is killed? Created 8 years ago2016-01-20 20:18:41 UTC by EsprimoP EsprimoP

Created 8 years ago2016-01-20 20:18:41 UTC by EsprimoP EsprimoP

Posted 8 years ago2016-01-20 20:18:41 UTC Post #328419
How to end the game when an NPC is killed? For example monster_barney dies then the screen fades and text appears, for example "Subject: Freeman Status: Evaluation Terminated..."
EsprimoP EsprimoPwEight
Posted 8 years ago2016-01-20 22:48:02 UTC Post #328420
It's a bunch of entities that will need to be triggered so you need the following entities.

monster_whatever (the NPC)
multimanager (to trigger each of the below entities)
env_fade (fade to black)
env_message (to show the endgame text)
player_loadsaved (to load the last saved game)

Set the npc to target the multimanager, with the trigger condition set to "Death" (basically when the npc dies, it triggers the multimanager)

Set the multimanager to trigger the env_fade immediatly and the env_message after one second. Then, have it trigger the player_loadsaved after a few more seconds. (Not too long because essential NPCs dying is really annoying and you don't want the player waiting for ages for their game to reload)
monster_urby monster_urbyGoldsourcerer
Posted 8 years ago2016-01-21 09:28:33 UTC Post #328424
Do the trigger conditions work on all monsters? I was having trouble getting an Apache to fire off any trigger conditions. (In standard HL1 steam)
Posted 8 years ago2016-01-21 10:21:54 UTC Post #328426
I had the same issue with the Apache in TWHL Tower and wrote it off as a spirit bug, but I guess it might simply not work with the apache. Standard NPCs should all work though, as far as I am aware.
monster_urby monster_urbyGoldsourcerer
Posted 8 years ago2016-01-22 07:07:58 UTC Post #328434
It should work on the Apache since it uses base monsters code, Spirit has some systems coded in a weird way in my opinion.
Posted 8 years ago2016-01-22 07:23:40 UTC Post #328435
download the half life map 'into the frying pan' from planetphillip. it has a apache at the end and te game fades when you defeat it. If I remembered correctly. No trigger_endsection though
You must be logged in to post a response.