Frictional Games Forum (read-only)
Script for Kill the player when a Grunt kills me? - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: Script for Kill the player when a Grunt kills me? (/thread-18245.html)



Script for Kill the player when a Grunt kills me? - Nare - 09-09-2012

Hi everybody. I need if possible a script when a Grunt kills the player and show the credits. Normally when Grunt Kills me the game show me a message that i have to continue, and I want that game ends and show credits. Can you help me? Thanks guys and sorry for my english, i'm a spanish guy Sad


RE: Script for Kill the player when a Grunt kills me? - Adny - 09-09-2012

Something like this should work:


void OnStart()
{
CheckPoint ("", "", "Credits", "", "");
}

void Credits(string &in asName, int alCount)
{
StartCredits("name_of_music.ogg", true, "name_of_text_category", "name_of_text_entry", 5);
}

name_of_music.ogg = name of the music file you want to be played
name_of_text_category = name of category in the lang file
name_of_text_entry = name of entry in the lang file


Hope that helped!


RE: Script for Kill the player when a Grunt kills me? - Nare - 09-09-2012

(09-09-2012, 11:48 PM)andyrockin123 Wrote: Something like this should work:


void OnStart()
{
CheckPoint ("", "", "Credits", "", "");
}

void Credits(string &in asName, int alCount)
{
StartCredits("name_of_music.ogg", true, "name_of_text_category", "name_of_text_entry", 5);
}

name_of_music.ogg = name of the music file you want to be played
name_of_text_category = name of category in the lang file
name_of_text_entry = name of entry in the lang file


Hope that helped!
But, i have to put a script area? and what i have to write into ""?

CheckPoint ("", "", "Credits", "", "");

i'm noob in scripts Sad

Edit: and this script is for show credits only? i want a grunt kill me and show credits :S do you understand?


RE: Script for Kill the player when a Grunt kills me? - Adny - 09-10-2012

Assuming the grunt is the only thing capable of killing the player, this will work fine. Checkpoint is similar to adding a callback under OnStart; it triggers its own function (in this case "Credits"). The first time the player dies, the function "Credits" will be used.

As for you question about the missing strings in the CheckPoint function, I'm still not 100% sure what the game needs for it to work, so here is a version of it with none of the arguments filled out:

CheckPoint (string& asName, string& asStartPos, string& asCallback, string& asDeathHintCat, string& asDeathHintEntry);


Keep in mind it is okay to leave certain arguments blank (just leave 2 quotation marks: ""); like I said before, I'm not sure which ones are okay, so you will have to do some trial & error.