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


New Checkpoint problem second Checkpoint - Steve - 06-27-2012

pls help I know the basics


RE: How do you make Check points? - Adny - 06-27-2012

This might help:

void CheckPoint (string& asName, string& asStartPos, string& asCallback, string& asDeathHintCat, string& asDeathHintEntry);


Sets a checkpoint at which the player will respawn in case he dies.
Callback syntax: void MyFunc(string &in asName, int alCount)
Count is 0 on the first checkpoint load!
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


RE: How do you make Check points? - Steve - 06-28-2012

(06-27-2012, 10:17 PM)andyrockin123 Wrote: This might help:

void CheckPoint (string& asName, string& asStartPos, string& asCallback, string& asDeathHintCat, string& asDeathHintEntry);


Sets a checkpoint at which the player will respawn in case he dies.
Callback syntax: void MyFunc(string &in asName, int alCount)
Count is 0 on the first checkpoint load!
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
Well thanx but I know the code I don't get the other stuff look I have this.
PHP Code:
void OnStart(){
 
some AddUseItemCallbacks
 AddEntityCollideCallback
("Player""RD""DeathSpawn"false1); 
}
void DeathSpawn(string &in asParentstring &in asChildint alState)
 {
 
SetEntityActive("RA"false);
 
CheckPoint("CP""RA""DeathFunc1""RespawnDeath""RespawnEntr");
 }
void DeathFunc1(string &in asNameint alCount

SetEntityActive("RA"true); 

RA = The player start's area name
CP = Script area name
RD = this is with the Area part of the script area(PlayerInteractCallback part)

Can you guys tell me what I did wrong?


RE: How do you make Check points? - Your Computer - 06-28-2012

(06-28-2012, 07:21 AM)Steve Wrote: Cany ou guys tell me what I did wrong?

Can you tell us what your issue is, what you're trying to achieve and why you decided to try to deactivate the PlayerStart area? To me it doesn't look like you understand what you're saying you understand.


RE: How do you make Check points? - Steve - 06-28-2012

(06-28-2012, 08:05 AM)Your Computer Wrote: Can you tell us what your issue is, what you're trying to achieve and why you decided to try to deactivate the PlayerStart area? To me it doesn't look like you understand what you're saying you understand.
Can you tell us what your issue is?
Well all I wan to know is which objects you have to place in the map, where you must place it and what you have to put in the "Things" names and stuff.
what you're trying to achieve
I'm just trying to achieve to make like a save point for if you die by like a monster you go back to that place.
why you decided to try to deactivate the PlayerStart area.
I guess I did that part wrong Blush
I would be very thankfull if you could explain detailed of how it works.
I also want to know if I even need the script area or if I must be something else screenshots from examples would be helpfull.
Thanks already


RE: How do you make Check points? - Cruzore - 06-28-2012

Try by deleting the SetEntityActive parts.


RE: How do you make Check points? - Steve - 06-28-2012

(06-28-2012, 02:46 PM)FastHunteR Wrote: Try by deleting the SetEntityActive parts.
Doesn't seem to work :S


RE: How do you make Check points? - Your Computer - 06-28-2012

(06-28-2012, 02:33 PM)Steve Wrote: Can you tell us what your issue is?
Well all I wan to know is which objects you have to place in the map, where you must place it and what you have to put in the "Things" names and stuff.
what you're trying to achieve
I'm just trying to achieve to make like a save point for if you die by like a monster you go back to that place.
why you decided to try to deactivate the PlayerStart area.
I guess I did that part wrong Blush
I would be very thankfull if you could explain detailed of how it works.
I also want to know if I even need the script area or if I must be something else screenshots from examples would be helpfull.
Thanks already

asName: the name you want the checkpoint to have.
asStartPos: the name of the PlayerStart area (i.e. the green box with the colorful arrows in its center) that you want the player to spawn in.
asCallback: name of the callback function you want called when the player dies (useful for resetting or modifying the environment).
asDeathHintCat: name of the LANG category that is the parent of the asDeathHintEntry entry.
asDeathHintEntry: name of the LANG entry that holds the death message you want to display when the player dies.

I'm not sure if it is possible to deactivate PlayerStart areas when dealing with checkpoints, but it's illogical to do so when checkpoints are dependent on PlayerStart areas.

Does anything else in your script work? Does the hpl.log (Documents/Amnesia/Main) provide any insight?


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

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.


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.
Thanks it worked I'm very gratefull Wink
It works like a charm.