Frictional Games Forum (read-only)
[SCRIPT] New Checkpoint problem second Checkpoint - 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] New Checkpoint problem second Checkpoint (/thread-16542.html)

Pages: 1 2


RE: How do you make Check points?(still help needed) - Steve - 06-28-2012

(06-28-2012, 03:29 PM)FastHunteR Wrote: I tried it out and this one should work:
place a script area for when you should make a checkpoint, and place a PlayerStartArea where you want to spawn after you died.
.hps file:
PHP Code:
void OnStart()
{
AddEntityCollideCallback("Player""ScriptAreaNameHere""CheckpointMaker"true1);
}
void CheckpointMaker(string &in asParentstring &in asChildint alState)
{
 
CheckPoint ("""PlayerStartAreaNameHere""""CategoryNameHere""EntrynameHere");

.lang file:
Code:
<LANGUAGE>
<CATEGORY Name="CategoryNameHere">
<Entry Name="EntryNameHere">DeathMessageHere</Entry>
</CATEGORY>
</LANGUAGE>

Replace all "...NameHere" with the ones you used in the level editor/want to use.
This sounds stupid but it workedthanks but now I made a second one Adn when I die I do get the other message but I don't get at the second respwan point any ideas?


RE: New Checkpoint problem second Checkpoint - Cruzore - 06-28-2012

the checkpoint command for the second checkpoint must have something wrong then. make sure it's a new playerStartArea.


RE: New Checkpoint problem second Checkpoint - Your Computer - 06-29-2012

All checkpoint names must be unique in order to issue multiple checkpoints.


RE: New Checkpoint problem second Checkpoint - Steve - 06-29-2012

PHP Code:
void OnEnter()
{
 
AddEntityCollideCallback("Player""CP""CheckpointMaker"true1);
 
AddEntityCollideCallback("Player""AreaTwo""Two"true1);
void CheckpointMaker(string &in asParentstring &in asChildint alState)
{
 
CheckPoint ("""RA""""RespawnDeath""Respawne");
void Two(string &in asParentstring &in asChildint alState)
{
 
CheckPoint ("""WQ""""Death""Deaths");

This is the code of my check points I've checked the names they are like what there stands there.(bad english :S)
The text does seem to work so I have no idea what's wrong.
does anybody might know something?


RE: New Checkpoint problem second Checkpoint - Cruzore - 06-29-2012

the first string at a checkpoint command is for the name of that checkpoint. What YC said is to difference them by their names(I myself didn't know that). And at your code you got both checkpoints called "". So change the first option at both, name it like "FirstCheckpoint" and "SecondCheckpoint" or something, whatever you want.


RE: New Checkpoint problem second Checkpoint - Steve - 06-29-2012

(06-29-2012, 02:44 PM)FastHunteR Wrote: the first string at a checkpoint command is for the name of that checkpoint. What YC said is to difference them by their names(I myself didn't know that). And at your code you got both checkpoints called "". So change the first option at both, name it like "FirstCheckpoint" and "SecondCheckpoint" or something, whatever you want.
It worked thanks a lot. now I only have to make that when if you respawn at the second checkpoint the monster is there again and walks through my pathnodes.
I think I can handle that my self, but a little example would be appreciated. Big Grin


RE: New Checkpoint problem second Checkpoint - Cruzore - 06-29-2012

the third string at CheckPoint is:
asCallback - the function to call when the player dies/respawns
so, you just make a new function, let it get called when the player dies/respawns, and inside that new function make the grunt appear again and add the pathnodes.
For him appearing again, you could try using
CreateEntityAtArea(string& asEntityName, string& asEntityFile, string& asAreaName, bool abFullGameSave);
to create an enemy again. Even though they do not chase properly along Pathnodes, you could still try.