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


Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
"AddEntityCollideCallback" issue
Author Message
Nitrowing Offline
Junior Member

Posts: 16
Joined: Dec 2010
Reputation: 0
Post: #1
Question "AddEntityCollideCallback" issue

Trying to make a sound play as the player touches an entity. Areas don't seem to work so I'm resorting to using a patch-o-blood entity as my trigger.

OnEnter part:
////////////////////////////
// Run when entering map
void OnEnter()
    {
{
AddEntityCollideCallback("Player" , "blood" , "bloodscare" , true, 0);
}
}

and the voidfunctions:
////////////////////////////
// Actual functions

void bloodscare(string &in asParent, string &in asChild, int alState)
{
    PlaySoundAtEntity("", "scare_animal_squeal.snt", "Player", 0.0f, false);
    AddDebugMessage("Sound Trigger Activated.", false);
}

I'm not really sure why it doesn't trigger. If someone could alternatively tell me how to make script_area's trigger events that would be nice too. Any help is appreciated.
12-24-2010 02:38 AM
Find all posts by this user Quote this message in a reply
Dark88 Offline
Junior Member

Posts: 48
Joined: Dec 2010
Reputation: 0
Post: #2
RE: "AddEntityCollideCallback" issue

(12-24-2010 02:38 AM)Nitrowing Wrote:  Trying to make a sound play as the player touches an entity. Areas don't seem to work so I'm resorting to using a patch-o-blood entity as my trigger.

OnEnter part:
////////////////////////////
// Run when entering map
void OnEnter()
    {
{
AddEntityCollideCallback("Player" , "blood" , "bloodscare" , true, 0);
}
}

and the voidfunctions:
////////////////////////////
// Actual functions

void bloodscare(string &in asParent, string &in asChild, int alState)
{
    PlaySoundAtEntity("", "scare_animal_squeal.snt", "Player", 0.0f, false);
    AddDebugMessage("Sound Trigger Activated.", false);
}

I'm not really sure why it doesn't trigger. If someone could alternatively tell me how to make script_area's trigger events that would be nice too. Any help is appreciated.

I used you're exact functions the way you have them except using a ScriptArea named "blood" and it worked perfect not sure why it's not working for you.
12-24-2010 03:08 AM
Find all posts by this user Quote this message in a reply
Nitrowing Offline
Junior Member

Posts: 16
Joined: Dec 2010
Reputation: 0
Post: #3
RE: "AddEntityCollideCallback" issue

Awesome! A script_area titled "blood" seems to work now. Thanks!
12-24-2010 03:12 AM
Find all posts by this user Quote this message in a reply
Dark88 Offline
Junior Member

Posts: 48
Joined: Dec 2010
Reputation: 0
Post: #4
RE: "AddEntityCollideCallback" issue

(12-24-2010 03:12 AM)Nitrowing Wrote:  Awesome! A script_area titled "blood" seems to work now. Thanks!

No problem, bro. Happy Holidays! Big Grin
12-24-2010 03:15 AM
Find all posts by this user Quote this message in a reply
Post Reply 




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