Facebook Twitter YouTube Frictional Games | Forum | Newsletter | Dev Blog | Dev Wiki | Support | Shelf | Store

Privacy Policy


Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Solved Nothing happens when player collides with area.
Author Message
Datguy5 Offline
Senior Member

Posts: 622
Joined: Dec 2011
Reputation: 12
Post: #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 all posts by this user Quote this message in a reply
SilentStriker Offline
Posting Freak

Posts: 939
Joined: Jul 2011
Reputation: 39
Post: #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 all posts by this user Quote this message in a reply
flamez3 Offline
Posting Freak

Posts: 1,320
Joined: Apr 2011
Reputation: 57
Post: #3
RE: Nothing happens when player collides with area.
Wrong syntax

04-06-2012 04:21 PM
Find all posts by this user Quote this message in a reply
Datguy5 Offline
Senior Member

Posts: 622
Joined: Dec 2011
Reputation: 12
Post: #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 all posts by this user Quote this message in a reply
SilentStriker Offline
Posting Freak

Posts: 939
Joined: Jul 2011
Reputation: 39
Post: #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 all posts by this user Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)