(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.