maybe you could add a checkpoint, then when you die, make it roll the credits right away, you may have to look into checkpoints, 'cos i've never actually used them myself, but i know that they execute when you die, and can be used to set death hints. If you use notepad++ with the .hps plugins (
http://wiki.frictionalgames.com/hpl2/thi...xt/notepad) you should just be able to type checkpoint, and use arrow keys untill you find the right function. hope this helps
yep, i found the function on the wiki:
here it is:
CheckPoint (string& asName, string& asStartPos, string& asCallback, string& asDeathHintCat, string& asDeathHintEntry);
Sets a checkpoint at which the player will respawn in case he dies.
Callback syntax: void MyFunc(string &in asName, int alCount)
Count is 0 on the first checkpoint load!
asName - the internal name
asStartPos - the name of the StartPos in the editor
asCallback - the function to call when the player dies/respawns
asDeathHintCat - the category of the death hint message to be used in the .lang file
asDeathHintEntry - the entry in the .lang file
so in your case the code will go like this:
void OnStart()
{
AddEntityCollideCallback("Player", "monster_death", "MonsterFunc1", true, 1);
}
void MonsterFunc1(string &in asParent , string &in asChild , int alState)
{
SetEntityActive("monster_grunt" , true);
SetPlayerActive(false);
CheckPoint ("EndGame", "Player_Start", "StartCredits", "DeathHintCategory", "DeathHintEntry");
}
void StartCredits(string &in asName , int &in alState)
{
StartCredits("", true, "Credits", "End", 10);
}
DeathHintCategory is the category name of your choice in the .lang file
DeathHintEntry is the name of your choice, and the text will be "The End" in your case
Credits is the category for your credits in the .lang file
End is the entry for your credits also in .lang
ps: I have copied some of the code above from jenniferOrange, All of the stuff after "SetPlayerActive(false);" is new stuff
Hope this helps you out!