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
Setting new spawn point?
Crunchygoblin Offline
Junior Member

Posts: 15
Threads: 7
Joined: Jan 2011
Reputation: 0
#1
Setting new spawn point?

How do I change what player start the player will spawn at after he dies?
02-01-2011, 11:56 PM
Find
Tanshaydar Offline
From Beyond

Posts: 3,085
Threads: 17
Joined: Mar 2009
Reputation: 67
#2
RE: Setting new spawn point?

Tried to use CheckPoints?

02-02-2011, 12:05 AM
Website Find
Crunchygoblin Offline
Junior Member

Posts: 15
Threads: 7
Joined: Jan 2011
Reputation: 0
#3
RE: Setting new spawn point?

Not sure how to use them, I looked at the game scripting, but its too complicated.
02-02-2011, 12:09 AM
Find
Tanshaydar Offline
From Beyond

Posts: 3,085
Threads: 17
Joined: Mar 2009
Reputation: 67
#4
RE: Setting new spawn point?

You can place a PlayerStart_Area and make it current checkpoint via functions. Place another one and make it current after a specific happening.

02-02-2011, 12:56 AM
Website Find
Crunchygoblin Offline
Junior Member

Posts: 15
Threads: 7
Joined: Jan 2011
Reputation: 0
#5
RE: Setting new spawn point?

Problem is, I don't know the scripting to do that. Anyone the scripting?
02-02-2011, 02:08 AM
Find
Phoroneus Offline
Member

Posts: 141
Threads: 12
Joined: Feb 2011
Reputation: 0
#6
RE: Setting new spawn point?

(02-02-2011, 02:08 AM)Crunchygoblin Wrote: Problem is, I don't know the scripting to do that. Anyone the scripting?

Here's the code lifted from "16_cistern_entrance.hps" (with the movable ladder):
/////////////////////////
//Upstairs checkpoint when completing ladder
void CollideAreaPlayerUp(string &in asParent, string &in asChild, int alState)
{
    CheckPoint("cp_up", "PlayerStartArea_2", "", "Hints", "DeathFall");
}

And here's the syntax with explanations:
void  CheckPoint(string& asName,string& asStartPos ,string& asCallback, string &asDeathHintCat, string &asDeathHintEntry);
void = Use this only if "CheckPoint" is the callback name and the function is not called within some other function, otherwise delete it (as you can see, it is gone in the example).
CheckPoint = This function.
string &asName = Checkpoint's name ("cp_up" in the example).
string &asStartPos = New start position ("PlayerStartArea_2" in the example).
string &asCallback = A function to be called when the checkpoint loads (for death counts, used to give more explicit or obvious hints when players are struggling - not used in example).
string &asDeathHintCat = Category name of the death hint that will be shown before player respawns at new checkpoint ("Hints" in the example).
string &asDeathHintEntry = Entry name of the death hint that will be shown before player respawns at new checkpoint ("DeathFall" in the example).

The function mentioned in "string &asCallback" must be given the following syntax to work:
void MyFunc(string &in asName, int alCount)
Where:
MyFunc = Function name. Change this to whatever you want.
string &in asName = The name of the death counter for this checkpoint.
int alCount = An integer (whole number, i.e. 1, 2, 3...) apparently representing the number of times the player has respawned at this checkpoint. It will be set to 0 upon first respawn, and increments by 1 thereafter.

[Image: at_9365860.png]

Follow Harvest.
02-02-2011, 06:02 AM
Find




Users browsing this thread: 3 Guest(s)