Frictional Games Forum (read-only)
Checkpoint when the player enters an area? - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: Checkpoint when the player enters an area? (/thread-12714.html)



Checkpoint when the player enters an area? - oscar1007 - 01-19-2012

Hello!

Does anyone know how to make it?
So far i have only made a script area where the "checkpoint" is going to happen.

Someone help me?


RE: Checkpoint when the player enters an area? - flamez3 - 01-19-2012

(01-19-2012, 03:32 PM)oscar1007 Wrote: Hello!

Does anyone know how to make it?
So far i have only made a script area where the "checkpoint" is going to happen.

Someone help me?
void OnStart()
{
AddEntityCollideCallback("Player", "checkpoint", "CheckPointActive", true, 1);
}

void CheckPointActive(string &in asParent, string &in asChild, int alState)
{
CheckPoint (string& asName, string& asStartPos, string& asCallback, string& asDeathHintCat, string& asDeathHintEntry);
}


asName - the internal name
asStartPos - the name of the StartPos in the editor
asCallback - the function to call when the player dies/respawns
asDeathHintCat - the category of the death hint message to be used in the .lang file
asDeathHintEntry - the entry in the .lang file


Need more help just ask.





RE: Checkpoint when the player enters an area? - oscar1007 - 01-19-2012

(01-19-2012, 03:51 PM)flamez3 Wrote:
(01-19-2012, 03:32 PM)oscar1007 Wrote: Hello!

Does anyone know how to make it?
So far i have only made a script area where the "checkpoint" is going to happen.

Someone help me?
void OnStart()
{
AddEntityCollideCallback("Player", "checkpoint", "CheckPointActive", true, 1);
}

void CheckPointActive(string &in asParent, string &in asChild, int alState)
{
CheckPoint (string& asName, string& asStartPos, string& asCallback, string& asDeathHintCat, string& asDeathHintEntry);
}


asName - the internal name
asStartPos - the name of the StartPos in the editor
asCallback - the function to call when the player dies/respawns
asDeathHintCat - the category of the death hint message to be used in the .lang file
asDeathHintEntry - the entry in the .lang file


Need more help just ask.
Great man! Smile