Frictional Games Forum (read-only)
[SCRIPT] how to add checkpoints - 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: [SCRIPT] how to add checkpoints (/thread-14427.html)



how to add checkpoints - zombiehacker595 - 04-02-2012

so im onto my third map and i am starting to bring in the monster and i was wondering how do i set checkpoints so when if you die you dont go back to the beggining of the map?


RE: how to add checkpoints - heyitsrobert97 - 04-02-2012

To Create Checkpoints you add a Script Area to walk into. So Add A Collide Callback on The Box. Create A Player Start area and call it what you want. And Create a Checkpoint Script in the Callback Function.
To add more than one checkpoint, in the first section write 'checkpoint1' and checkpoint 2 and so on.
So Basically,,

{
AddEntityCollideCallback("Player", "spawnareabox", "checkpoint1", true, 1);
}

void checkpoint1(string &in asParent, string &in asChild, int alState)
{
CheckPoint ("checkpoint1", "playerstart_2", "ADD A CALLBACK BUT NOT NEEDED", "DEATH HINT CATEGORY", "DEATH HINT CATEGORY");
}

To add more than 1 checkpoint repeat but change the first box of the checkpoint to 'checkpoint2' and so on.




RE: how to add checkpoints - flamez3 - 04-02-2012

(04-02-2012, 07:05 AM)heyitsrobert97 Wrote: To Create Checkpoints you add a Script Area to walk into. So Add A Collide Callback on The Box. Create A Player Start area and call it what you want. And Create a Checkpoint Script in the Callback Function.
To add more than one checkpoint, in the first section write 'checkpoint1' and checkpoint 2 and so on.
So Basically,,

{
AddEntityCollideCallback("Player", "spawnareabox", "checkpoint1", true, 1);
}

void checkpoint1(string &in asParent, string &in asChild, int alState)
{
CheckPoint ("checkpoint1", "playerstart_2", "ADD A CALLBACK BUT NOT NEEDED", "DEATH HINT CATEGORY", "DEATH HINT CATEGORY");
}

To add more than 1 checkpoint repeat but change the first box of the checkpoint to 'checkpoint2' and so on.
Actually it's

CheckPoint ("checkpoint1", "playerstart_2", "ADD A FUNCTION BUT NOT NEEDED", "DEATH HINT CATEGORY", "DEATH HINT ENTRY");
}