Frictional Games Forum (read-only)
Nothing happens when player collides with area. - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: Nothing happens when player collides with area. (/thread-14542.html)



Nothing happens when player collides with area. - Datguy5 - 04-06-2012

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?



RE: Nothing happens when player collides with area. - SilentStriker - 04-06-2012

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



RE: Nothing happens when player collides with area. - flamez3 - 04-06-2012

Wrong syntax


RE: Nothing happens when player collides with area. - Datguy5 - 04-06-2012

(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



RE: Nothing happens when player collides with area. - SilentStriker - 04-06-2012

(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