06-27-2012, 10:08 PM
Pages: 1 2
06-27-2012, 10:17 PM
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
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
06-28-2012, 07:21 AM
(06-27-2012, 10:17 PM)andyrockin123 Wrote: [ -> ]This might help:Well thanx but I know the code I don't get the other stuff look I have this.
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
PHP Code:
void OnStart(){
some AddUseItemCallbacks
AddEntityCollideCallback("Player", "RD", "DeathSpawn", false, 1);
}void DeathSpawn(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("RA", false);
CheckPoint("CP", "RA", "DeathFunc1", "RespawnDeath", "RespawnEntr");
}void DeathFunc1(string &in asName, int alCount)
{
SetEntityActive("RA", true);
}
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?
06-28-2012, 08:05 AM
(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.
06-28-2012, 02:33 PM
(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
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
06-28-2012, 02:46 PM
Try by deleting the SetEntityActive parts.
06-28-2012, 03:00 PM
(06-28-2012, 02:46 PM)FastHunteR Wrote: [ -> ]Try by deleting the SetEntityActive parts.Doesn't seem to work :S
06-28-2012, 03:28 PM
(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
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?
06-28-2012, 03:29 PM
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:
.lang file:
Replace all "...NameHere" with the ones you used in the level editor/want to use.
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", true, 1);
}
void CheckpointMaker(string &in asParent, string &in asChild, int alState)
{
CheckPoint ("", "PlayerStartAreaNameHere", "", "CategoryNameHere", "EntrynameHere");
}
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.
06-28-2012, 03:47 PM
(06-28-2012, 03:29 PM)FastHunteR Wrote: [ -> ]I tried it out and this one should work:Thanks it worked I'm very gratefull
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:
.lang file:PHP Code:void OnStart()
{
AddEntityCollideCallback("Player", "ScriptAreaNameHere", "CheckpointMaker", true, 1);
}
void CheckpointMaker(string &in asParent, string &in asChild, int alState)
{
CheckPoint ("", "PlayerStartAreaNameHere", "", "CategoryNameHere", "EntrynameHere");
}
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.
It works like a charm.
Pages: 1 2