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
Respawn in a cell.
4WalledKid Offline
Member

Posts: 107
Threads: 23
Joined: Oct 2012
Reputation: 1
#1
Question  Respawn in a cell.

Ok so I want the player to get killed by a grunt but respawn in a cell instead of respawning in the playerstartarea_1. How do I do this? Thanks!

[Image: 4walledkidbanner_zps1514b7f6.png]
(This post was last modified: 10-26-2012, 11:46 AM by 4WalledKid.)
10-23-2012, 06:09 PM
Website Find
Robby Offline
Posting Freak

Posts: 2,549
Threads: 38
Joined: Jun 2009
Reputation: 47
#2
RE: Respawn in a cell.

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



string &in asName - leave this one empty, but include 2 quotation marks, like ""
string &in asStartPos - The start area to go to ("StartArea_1")
string &in asCallback - leave this empty unless you want something else (will clarify if you have something else in mind here)
string &in asDeathHintCat
string &in asDeathHintEntry -Leave these 2 empty, unless you want to give the player a hint.

Like this:
void CheckPoint("", "StartArea_1", "', "", "");

This has to be called in a script area, some time before the event itself (which, in turn, kills the player). If you call it after the player dies, it won't work.

Infrequently active. Don't expect an immediate response. Best to contact me at a different locale. If I create a thread, expect me to be quite active.
(This post was last modified: 10-23-2012, 06:28 PM by Robby.)
10-23-2012, 06:14 PM
Website Find
4WalledKid Offline
Member

Posts: 107
Threads: 23
Joined: Oct 2012
Reputation: 1
#3
RE: Respawn in a cell.

(10-23-2012, 06:14 PM)Nemet Robert Wrote: void CheckPoint (string& asName, string& asStartPos, string& asCallback, string& asDeathHintCat, string& asDeathHintEntry);



string &in asName - leave this one empty, but include 2 quotation marks, like ""
string &in asStartPos - The start area to go to ("StartArea_1")
string &in asCallback - leave this empty unless you want something else (will clarify if you have something else in mind here)
string &in asDeathHintCat
string &in asDeathHint -Leave these 2 empty, unless you want to give the player a hint.

Like this:
void CheckPoint("", "StartArea_1", "', "", "");

This has to be called in a script area, some time before the event itself (which, in turn, kills the player). If you call it after the player dies, it won't work.
What is the string &in asDeathHintCat?

[Image: 4walledkidbanner_zps1514b7f6.png]
10-23-2012, 06:16 PM
Website Find
Robby Offline
Posting Freak

Posts: 2,549
Threads: 38
Joined: Jun 2009
Reputation: 47
#4
RE: Respawn in a cell.

The category for the Death Hint. As I said, leave that, along with Death Hint Entry empty.

Infrequently active. Don't expect an immediate response. Best to contact me at a different locale. If I create a thread, expect me to be quite active.
10-23-2012, 06:27 PM
Website Find
The chaser Offline
Posting Freak

Posts: 2,486
Threads: 76
Joined: Jun 2012
Reputation: 113
#5
RE: Respawn in a cell.

You can do this with checkpoints. But, be completely sure that the grunt kills the player or it will respawn in the cell without a reason.

So:

Put the Start area in the desired place-now, do this:

void OnStart()

{

AddEntityCollideCallback(“Player”, “ScriptArea_1”, “Restart”, true, 1);

}



void Restart(string &in asParent, string &in asChild, int alState)

{

CheckPoint (“FirstCheckpoint”, “PlayerStartArea_1”, “Happening”, “DeathCategory”, “Deathtext”);

}



void Happening(string &in asName, int alCount)

{

/Stuff you want to happen after you die/

}


<LANGUAGE>

<CATEGORY Name=“DeathCategory”>

<Entry Name=“Deathtext”>Text you want in the black screen after you die </Entry>

</CATEGORY>

</LANGUAGE>

Aaand you're done Wink

THE OTHERWORLD (WIP)
[Image: k6vbdhu]

Aculy iz dolan.
10-23-2012, 06:30 PM
Find
4WalledKid Offline
Member

Posts: 107
Threads: 23
Joined: Oct 2012
Reputation: 1
#6
RE: Respawn in a cell.

(10-23-2012, 06:30 PM)The chaser Wrote: You can do this with checkpoints. But, be completely sure that the grunt kills the player or it will respawn in the cell without a reason.

So:

Put the Start area in the desired place-now, do this:

void OnStart()

{

AddEntityCollideCallback(“Player”, “ScriptArea_1”, “Restart”, true, 1);

}



void Restart(string &in asParent, string &in asChild, int alState)

{

CheckPoint (“FirstCheckpoint”, “PlayerStartArea_1”, “Happening”, “DeathCategory”, “Deathtext”);

}



void Happening(string &in asName, int alCount)

{

/Stuff you want to happen after you die/

}


<LANGUAGE>

<CATEGORY Name=“DeathCategory”>

<Entry Name=“Deathtext”>Text you want in the black screen after you die </Entry>

</CATEGORY>

</LANGUAGE>

Aaand you're done Wink


This completely worked! thanks guys! really! Big Grin

[Image: 4walledkidbanner_zps1514b7f6.png]
10-23-2012, 06:45 PM
Website Find




Users browsing this thread: 1 Guest(s)