Frictional Games Forum (read-only)
Checkpoints. How do they work? - 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 (https://www.frictionalgames.com/forum/forum-35.html)
+--- Thread: Checkpoints. How do they work? (/thread-6852.html)



Checkpoints. How do they work? - Viperdream - 03-11-2011

I didn't find anything with a search and I don't really understand this script.

So this is what I should do to get a checkpoint.
CheckPoint(string& asName,string& asStartPos ,string& asCallback, string &asDeathHintCat, string &asDeathHintEntry);

I understand everything in that one. But I don't really understand what I have to do with this one

MyFunc(string &in asName, int alCount)

I know what to fill in at the name and for count it should be. But I don't understand the count. So if a player dies. How does the game know that he has to load at that point?
Does the player have to collide with the checkpoint first? Or does the game take care of that?


RE: Checkpoints. How do they work? - Linus Ă…gren - 03-11-2011

I make a collidebox and put the checkpoint code in it. If the player collides with it, he will spawn at the checkpoint if he dies.


RE: Checkpoints. How do they work? - Viperdream - 03-11-2011

How do I connect the collidebox with the checkpoint?


RE: Checkpoints. How do they work? - Pandemoneus - 03-11-2011

Create a PlayerStartArea.
Then make a ScriptArea somewhere else that will trigger the checkpoint.
Add a EntityCollideCallback with that script area and put CheckPoint(string& asName,string& asStartPos ,string& asCallback, string &asDeathHintCat, string &asDeathHintEntry); into the function, whereas the StartPos is your new PlayerStartArea.

Quote:I know what to fill in at the name and for count it should be. But I don't understand the count. So if a player dies. How does the game know that he has to load at that point?
The count means the amount of deaths the player already had. That function will always be called when the player dies (like in the main story, where monsters spawned at other spots and after some deaths didn't spawn at all anymore).