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
Nothing happens when player collides with area.
Datguy5 Offline
Senior Member

Posts: 629
Threads: 25
Joined: Dec 2011
Reputation: 12
#1
Nothing happens when player collides with area.

So basically the problem is.When the player collides with an area called Bang nothing happens.Here is my hps file.
////////////////////////////
// Run when entering map
void OnStart()
{
PlayMusic("hall.ogg", true, 1.0f, 1.0f, 1, false);
SetEntityPlayerLookAtCallback("Areas", "Sign_1", false);
AddEntityCollideCallback("Player", "Bang", "Scare1", true, 1);
}
void Sign_1(string &in asEntity, int alState)
{
SetMessage("Signs", "Sign3", 2);
}
void Scare1(string &in asTimer)
{
PlaySoundAtEntity("", "scare_male_terrified5.ogg", "Player", 0, false);
CreateParticleSystemAtEntity("", "Phaa", "Particle", false);
AddTimer("", 0.2, "Thimer");
}
void Thimer(string &in asTimer)
{
GiveSanityDamage(10.0f, true);
PlaySoundAtEntity("", "react_sigh.snt", "Player", 0, false);
}
////////////////////////////
// Run when entering map
void OnEnter()
{
}
////////////////////////////
// Run when leaving map
void OnLeave()
{
}
Help?

(This post was last modified: 04-06-2012, 05:24 PM by Datguy5.)
04-06-2012, 04:00 PM
Find
SilentStriker Offline
Posting Freak

Posts: 950
Threads: 26
Joined: Jul 2011
Reputation: 43
#2
RE: Nothing happens when player collides with area.

Check so everything is named right.

Off topic are you going to be able to get back to this map? Then I would suggest having PlayMusic on OnEnter

04-06-2012, 04:07 PM
Find
flamez3 Offline
Posting Freak

Posts: 1,281
Threads: 48
Joined: Apr 2011
Reputation: 57
#3
RE: Nothing happens when player collides with area.

Wrong syntax

04-06-2012, 04:21 PM
Find
Datguy5 Offline
Senior Member

Posts: 629
Threads: 25
Joined: Dec 2011
Reputation: 12
#4
RE: Nothing happens when player collides with area.

(04-06-2012, 04:21 PM)flamez3 Wrote: Wrong syntax


I knew it!But i wasnt sure D: Thanks flamez and silentstriker.Btw does it matter if the playmusic is on OnStart?Ive always placed it there and it has worked fine

(This post was last modified: 04-06-2012, 05:23 PM by Datguy5.)
04-06-2012, 05:22 PM
Find
SilentStriker Offline
Posting Freak

Posts: 950
Threads: 26
Joined: Jul 2011
Reputation: 43
#5
RE: Nothing happens when player collides with area.

(04-06-2012, 05:22 PM)Datguy5 Wrote:
(04-06-2012, 04:21 PM)flamez3 Wrote: Wrong syntax


I knew it!But i wasnt sure D: Thanks flamez and silentstriker.Btw does it matter if the playmusic is on OnStart?Ive always placed it there and it has worked fine
If you have PlayMusic on OnStart it only works one time, if you put it in OnEnter it starts every time you leave and come back to the map Smile

04-06-2012, 05:24 PM
Find




Users browsing this thread: 1 Guest(s)