Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Script Help New Checkpoint problem second Checkpoint
Steve Offline
Member

Posts: 178
Threads: 17
Joined: Jun 2012
Reputation: 7
#1
New Checkpoint problem second Checkpoint

pls help I know the basics
(This post was last modified: 06-28-2012, 08:47 PM by Steve.)
06-27-2012, 10:08 PM
Find
Adny Offline
Posting Freak

Posts: 1,766
Threads: 6
Joined: Mar 2012
Reputation: 173
#2
RE: How do you make Check points?

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

I rate it 3 memes.
06-27-2012, 10:17 PM
Find
Steve Offline
Member

Posts: 178
Threads: 17
Joined: Jun 2012
Reputation: 7
#3
RE: How do you make Check points?

(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: (Select All)
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?
(This post was last modified: 06-28-2012, 02:26 PM by Steve.)
06-28-2012, 07:21 AM
Find
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#4
RE: How do you make Check points?

(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.

Tutorials: From Noob to Pro
06-28-2012, 08:05 AM
Website Find
Steve Offline
Member

Posts: 178
Threads: 17
Joined: Jun 2012
Reputation: 7
#5
RE: How do you make Check points?

(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
(This post was last modified: 06-28-2012, 03:08 PM by Steve.)
06-28-2012, 02:33 PM
Find
Cruzore Offline
Senior Member

Posts: 301
Threads: 2
Joined: Jun 2012
Reputation: 37
#6
RE: How do you make Check points?

Try by deleting the SetEntityActive parts.
06-28-2012, 02:46 PM
Find
Steve Offline
Member

Posts: 178
Threads: 17
Joined: Jun 2012
Reputation: 7
#7
RE: How do you make Check points?

(06-28-2012, 02:46 PM)FastHunteR Wrote: Try by deleting the SetEntityActive parts.
Doesn't seem to work :S
06-28-2012, 03:00 PM
Find
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#8
RE: How do you make Check points?

(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?

Tutorials: From Noob to Pro
(This post was last modified: 06-28-2012, 03:29 PM by Your Computer.)
06-28-2012, 03:28 PM
Website Find
Cruzore Offline
Senior Member

Posts: 301
Threads: 2
Joined: Jun 2012
Reputation: 37
#9
RE: How do you make Check points?(still help needed)

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: (Select All)
void OnStart()
{
AddEntityCollideCallback("Player""ScriptAreaNameHere""CheckpointMaker"true1);
}
void CheckpointMaker(string &in asParentstring &in asChildint alState)
{
 
CheckPoint ("""PlayerStartAreaNameHere""""CategoryNameHere""EntrynameHere");

.lang file:
<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:29 PM
Find
Steve Offline
Member

Posts: 178
Threads: 17
Joined: Jun 2012
Reputation: 7
#10
RE: How do you make Check points?(still help needed)

(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: (Select All)
void OnStart()
{
AddEntityCollideCallback("Player""ScriptAreaNameHere""CheckpointMaker"true1);
}
void CheckpointMaker(string &in asParentstring &in asChildint alState)
{
 
CheckPoint ("""PlayerStartAreaNameHere""""CategoryNameHere""EntrynameHere");

.lang file:
<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.
06-28-2012, 03:47 PM
Find




Users browsing this thread: 3 Guest(s)