Facebook Twitter YouTube Frictional Games | Forum | Newsletter | Dev Blog | Dev Wiki | Support


Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
"On dead" possible?
Author Message
Brute Offline
Member

Posts: 197
Joined: Aug 2011
Reputation: 3
Post: #1
"On dead" possible?

Hey guys. It's me... again. Rolleyes
I wonder if there is an script, which activates, when the player dies? Is this possible?





(This post was last modified: 09-26-2011 03:04 PM by Brute.)
09-25-2011 07:37 AM
Find all posts by this user Quote this message in a reply
palistov Offline
Posting Freak

Posts: 1,213
Joined: Mar 2011
Reputation: 57
Post: #2
RE: "On dead" possible?

Checkpoints. Set a checkpoint before the player dies, and the callback function will run once the player revives. That's about as close to a death event you can get--your other option is a loop which checks player health every second (or even shorter intervals if you want)

(This post was last modified: 09-25-2011 07:55 AM by palistov.)
09-25-2011 07:54 AM
Find all posts by this user Quote this message in a reply
Brute Offline
Member

Posts: 197
Joined: Aug 2011
Reputation: 3
Post: #3
RE: "On dead" possible?

Hmm... Ok. The checkpoint sounds good. Can you tell an example please? Rolleyes
The player died and a door closed. Would be nice and thanks for the answer! Big Grin





09-25-2011 09:20 AM
Find all posts by this user Quote this message in a reply
Khyrpa Offline
Senior Member

Posts: 637
Joined: Apr 2011
Reputation: 24
Post: #4
RE: "On dead" possible?

Try using search
I think there is a ton of threads about checkpoints.
heres one:
http://www.frictionalgames.com/forum/thr...checkpoint

09-25-2011 01:03 PM
Find all posts by this user Quote this message in a reply
Brute Offline
Member

Posts: 197
Joined: Aug 2011
Reputation: 3
Post: #5
RE: "On dead" possible?

Thanks Khyrpa!
I had often used the search for my other problems but I found very rare a solution to my problem, like by making a lever, so I am sorry, when the answer so obvious existed. Big Grin
I will check it out!





09-25-2011 01:10 PM
Find all posts by this user Quote this message in a reply
Brute Offline
Member

Posts: 197
Joined: Aug 2011
Reputation: 3
Post: #6
RE: "On dead" possible?

Confused It doesn't work! The door is still unlocked...
Maybe I should make a loop, but I have no idea, what this is or how I must define that. Can you help me?
// Yes I have tried the search. Don't worry! Tongue





09-25-2011 03:28 PM
Find all posts by this user Quote this message in a reply
RawkBandMan Offline
Posting Freak

Posts: 1,146
Joined: Nov 2010
Reputation: 5
Post: #7
RE: "On dead" possible?

Maybe using an if command to call the script when the player's health hits 0?

I've come to learn to not fear the living, nor the dead... But the monsters that hide in closets.
09-25-2011 04:25 PM
Find all posts by this user Quote this message in a reply
Delirium92 Offline
Senior Member

Posts: 465
Joined: Mar 2011
Reputation: 18
Post: #8
RE: "On dead" possible?

hmm i wonder if you could do something like

if(GetPlayerHealth = 0)
{
// what ever you want here
}

but you would need some sort of loop or something to check the players health if it reaches 0, never tryed it but ive often thought of it.

what i wrote wont work btw!

[Image: mrvQlSN.gif]
(This post was last modified: 09-25-2011 04:34 PM by Delirium92.)
09-25-2011 04:34 PM
Find all posts by this user Quote this message in a reply
Brute Offline
Member

Posts: 197
Joined: Aug 2011
Reputation: 3
Post: #9
RE: "On dead" possible?

Ok I see. I thought about something like this, and I still have check the Script Function Page at the wiki but I don't check it Rolleyes . You know I am a beginner in scripting, so I am very helpless without you. But it is nice, that you try to help me. I am still trying something... Huh

@Saffire192
what i wrote wont work btw!

Ok, thats good to know Big Grin





09-25-2011 05:01 PM
Find all posts by this user Quote this message in a reply
Khyrpa Offline
Senior Member

Posts: 637
Joined: Apr 2011
Reputation: 24
Post: #10
RE: "On dead" possible?

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

When you put this inside the void OnStart()
The next time the player dies, that function is ran.
So to make things happen after the player dies you can use the asCallback.
example script:

void OnStart() //I just changed things to happen right when the map is ran
{CheckPoint ("", "NameOfSomeStartPos", "LockDoor", "", "");
}
void LockDoor(string &in asName, int alCount)
{
SetSwingDoorClosed("doorname", true, false);
SetSwingDoorLocked("doorname", true, false);
}


Copied my older post and changed some things. Is this what you were trying to accomplish?

09-25-2011 05:52 PM
Find all posts by this user Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)