Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Script for Kill the player when a Grunt kills me?
Nare Offline
Junior Member

Posts: 2
Threads: 1
Joined: Sep 2012
Reputation: 0
#1
Script for Kill the player when a Grunt kills me?

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
09-09-2012, 11:39 PM
Find
Adny Offline
Posting Freak

Posts: 1,766
Threads: 6
Joined: Mar 2012
Reputation: 173
#2
RE: Script for Kill the player when a Grunt kills me?

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!

I rate it 3 memes.
09-09-2012, 11:48 PM
Find
Nare Offline
Junior Member

Posts: 2
Threads: 1
Joined: Sep 2012
Reputation: 0
#3
RE: Script for Kill the player when a Grunt kills me?

(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?
(This post was last modified: 09-10-2012, 12:00 AM by Nare.)
09-09-2012, 11:59 PM
Find
Adny Offline
Posting Freak

Posts: 1,766
Threads: 6
Joined: Mar 2012
Reputation: 173
#4
RE: Script for Kill the player when a Grunt kills me?

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.

I rate it 3 memes.
09-10-2012, 12:21 AM
Find




Users browsing this thread: 1 Guest(s)