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


Thread Rating:
  • 1 Vote(s) - 4 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Checkpoints
Datguy5 Offline
Senior Member

Posts: 629
Threads: 25
Joined: Dec 2011
Reputation: 12
#1
Checkpoints

Hello people!
I have made that when an player enters a area he gets killed and then he should spawn in a jail.It needs checkpoints but how would i do it?Oh and i also want that when the player starts from the jail.And is it possible to make a short intro when the player spawns in the jail?Or does that need another map or something.

////////////////////////////
// Run when the map starts
void OnStart()
{
SetPlayerHealth(10);
SetPlayerSanity(40);
SetPlayerActive(false);
FadeIn(3.0f);
MovePlayerHeadPos(0, -1.0f, 0, 13, 11);
PlayMusic("amb_extra02.ogg", true, 1.0f, 1.0f, 1, false);
SetPlayerCrouching(true);
FadeRadialBlurTo(2.0f, 1);
AddTimer("", 6, "Player");
AddTimer("", 2, "Cough");
StartPlayerLookAt("Look", 2, 4, "StopPlayerLookAt");
PlaySoundAtEntity("", "player_cough.snt", "Player", 0, false);
AddEntityCollideCallback("Player", "Message_1", "Message1", true, 1);
AddEntityCollideCallback("Player", "Message_2", "Message2", true, 1);
AddEntityCollideCallback("Player", "Message_3", "Message3", true, 1);
AddEntityCollideCallback("Player", "Blood", "Message4", true, 1);
AddEntityCollideCallback("Player", "Sound", "Hear", true, 1);
AddEntityCollideCallback("Player", "Sound2", "Hear2", true, 1);
AddEntityCollideCallback("Player", "Trap", "Omg", true, 1);
AddEntityCollideCallback("Player", "Say", "Here", true, 1);
SetEntityPlayerLookAtCallback("Sign_1", "Look_1", false);
SetEntityPlayerLookAtCallback("Sign_2", "Look_2", false);
}
void Cough(string &in asTimer)
{
PlaySoundAtEntity("", "player_cough.snt", "Player", 0, false);
SetMessage("Messages", "Message1", 4);
}
void Player(string &in asTimer)
{
PlaySoundAtEntity("", "react_sigh.snt", "Player", 0, false);
SetPlayerActive(true);
MovePlayerHeadPos(0, 0, 0, 10, 20);
SetPlayerCrouching(false);
FadeRadialBlurTo(0, 3);
}
void Message1(string &in asChild, string &in asParent, int alState)
{
SetMessage("Messages", "Popup1", 4);
}
void Message2(string &in asChild, string &in asParent, int alState)
{
SetMessage("Messages", "Popup2", 4);
}
void Sign_1(string &in asEntity, int alState)
{
SetMessage("Signs", "Sign1", 2);
}
void Sign_2(string &in asEntity, int alState)
{
SetMessage("Signs", "Sign2", 2);
}
void Message3(string &in asChild, string &in asParent, int alState)
{
SetMessage("Messages", "Popup3", 3);
}
void Message4(string &in asChild, string &in asParent, int alState)
{
SetMessage("Messages", "Popup4", 3);
PlaySoundAtEntity("", "react_scare", "Player", 0, false);
PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false);
GiveSanityDamage(10.0f, true);
}
void Hear(string &in asChild, string &in asParent, int alState)
{
PlaySoundAtEntity("", "enabled.snt", "Player", 0, false);
SetMessage("Messages", "Popup5", 3);
GiveSanityDamage(10.0f, true);
}
void Hear2(string &in asChild, string &in asParent, int alState)
{
PlaySoundAtEntity("", "ambience_haunting.ogg", "Player", 0, false);
}
void Here(string &in asChild, string &in asParent, int alState)
{
SetMessage("Messages", "Popup6", 3);
}
void Omg(string &in asChild, string &in asParent, int alState)
{
SetEntityActive("Este", true);
SetEntityActive("Este2", true);
SetEntityActive("Este3", true);
SetEntityActive("Grunt", true);
ShowEnemyPlayerPosition("Grunt");
PlaySoundAtEntity("", "pickaxe_hit.snt", "Player", 0, false);
SetMessage("Messages", "Popup7", 3);
}
////////////////////////////
// Run when entering map
void OnEnter()
{
SetPlayerLampOil(0);
}
////////////////////////////
// Run when leaving map
void OnLeave()
{
}

And how do i make death hint saying something then.Here is my lang file:

<LANGUAGE>
<CATEGORY Name="CustomStoryMain">
<Entry Name="Description">YOUR DESCRIPTION HERE</Entry>
</CATEGORY>
<CATEGORY Name="Messages">
<Entry Name="Popup1">Ugh,what happened...</Entry>
<Entry Name="Popup2">I should pick up that torch and try to find a way out of here.</Entry>
<Entry Name="Popup3">Hmm,this place looks like an abandoned mine.</Entry>
<Entry Name="Popup4">Is that blood!?</Entry>
<Entry Name="Popup5">What was that!!?</Entry>
<Entry Name="Popup6">This must be the right way.</Entry>
<Entry Name="Popup7">Im trapped!!</Entry>

</CATEGORY>
<CATEGORY Name="Signs">
<Entry Name="Sign1">Storage</Entry>
<Entry Name="Sign2">Equipment</Entry>
</CATEGORY>
<CATEGORY Name="Levels">
</CATEGORY>
</LANGUAGE>




(This post was last modified: 03-05-2012, 06:39 PM by Datguy5.)
03-04-2012, 05:11 PM
Find
Stepper321 Offline
Senior Member

Posts: 263
Threads: 26
Joined: Nov 2011
Reputation: 8
#2
RE: Checkpoints and ambient sounds

I only know the ambience sound thing.

Use this when he enters a script area:


Quote:void PlaySoundAtEntity(string& asSoundName, string& asSoundFile, string& asEntity, float afFadeTime, bool abSaveSound);


Creates a sound on an entity.
asSoundName - internal name
asSoundFile - the sound to use + extension .snt
asEntity - the entity to create the sound at, can be “Player”
afFadeTime - time in seconds the sound needs to fade
abSaveSound - determines whether a sound should “remember” its state. If true, the sound is never attached to the entity! Also note that saving should on be used on looping sounds!



Signature to awesome to be displayed.
(This post was last modified: 03-04-2012, 05:30 PM by Stepper321.)
03-04-2012, 05:29 PM
Find
Datguy5 Offline
Senior Member

Posts: 629
Threads: 25
Joined: Dec 2011
Reputation: 12
#3
RE: Checkpoints and ambient sounds

(03-04-2012, 05:29 PM)Stepper321 Wrote: I only know the ambience sound thing.

Use this when he enters a script area:


Quote:void PlaySoundAtEntity(string& asSoundName, string& asSoundFile, string& asEntity, float afFadeTime, bool abSaveSound);


Creates a sound on an entity.
asSoundName - internal name
asSoundFile - the sound to use + extension .snt
asEntity - the entity to create the sound at, can be “Player”
afFadeTime - time in seconds the sound needs to fade
abSaveSound - determines whether a sound should “remember” its state. If true, the sound is never attached to the entity! Also note that saving should on be used on looping sounds!
Thank you : ) i know that script but i was kinda confused : D

(This post was last modified: 03-05-2012, 01:44 PM by Datguy5.)
03-04-2012, 05:52 PM
Find
Datguy5 Offline
Senior Member

Posts: 629
Threads: 25
Joined: Dec 2011
Reputation: 12
#4
RE: Checkpoints and ambient sounds

Help?

03-05-2012, 02:44 PM
Find
trollox Offline
Member

Posts: 215
Threads: 16
Joined: Dec 2011
Reputation: 3
#5
RE: Checkpoints and ambient sounds

ambinet sonds? as for example that a sound plays as the player his the area ? if so i know , but i'm unsure of your question. As for the jail part you could set the playing inactive and make him slowly look at a targate. As your intro and for the checkpoints i don't know :C i wish i did. But i you need help with the music script / how to do it i know exacly how.

Trollox.
03-05-2012, 02:55 PM
Find
Datguy5 Offline
Senior Member

Posts: 629
Threads: 25
Joined: Dec 2011
Reputation: 12
#6
RE: Checkpoints and ambient sounds

(03-05-2012, 02:55 PM)trollox Wrote: ambinet sonds? as for example that a sound plays as the player his the area ? if so i know , but i'm unsure of your question. As for the jail part you could set the playing inactive and make him slowly look at a targate. As your intro and for the checkpoints i don't know :C i wish i did. But i you need help with the music script / how to do it i know exacly how.

Trollox.
Thanks but i solved the ambient sound thingy.And now mostly the problem is the checkpoints :/

03-05-2012, 03:05 PM
Find
trollox Offline
Member

Posts: 215
Threads: 16
Joined: Dec 2011
Reputation: 3
#7
RE: Checkpoints and ambient sounds

Well i guess you'd have to ask someone more experienced for that. I really want to know how to creat a checkpoint aswell. Tell me if you figgure out somthing.

Trollox.
03-05-2012, 03:31 PM
Find
Datguy5 Offline
Senior Member

Posts: 629
Threads: 25
Joined: Dec 2011
Reputation: 12
#8
RE: Checkpoints and ambient sounds

(03-05-2012, 03:31 PM)trollox Wrote: Well i guess you'd have to ask someone more experienced for that. I really want to know how to creat a checkpoint aswell. Tell me if you figgure out somthing.

Trollox.
Keep checking this post : D i hope someone experienced helps me :/

03-05-2012, 03:40 PM
Find
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#9
RE: Checkpoints

Checkpoints are no different than any other callback. Why do you have trouble with checkpoints when you appear to know how to set up collision and player look-at callbacks? Checkpoints get triggered when the player dies.

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

Posts: 629
Threads: 25
Joined: Dec 2011
Reputation: 12
#10
RE: Checkpoints

(03-05-2012, 06:06 PM)Your Computer Wrote: Checkpoints are no different than any other callback. Why do you have trouble with checkpoints when you appear to know how to set up collision and player look-at callbacks? Checkpoints get triggered when the player dies.

Umm yes...But how about the death hint?Where do i put it in my lang file?

03-05-2012, 06:10 PM
Find




Users browsing this thread: 1 Guest(s)