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
Texture, Model & Animation Help Music "Lower" if player enters area
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#6
RE: Music "Lower" if player enters area

The last number in the AddEntityCollideCallback, int alStates.

PHP Code: (Select All)
AddEntityCollideCallback(string& asParentName, string& asChildName, string& asFunction, bool abDeleteOnCollide, int alStates); 

If you set it to 0, the callback calls both when entering and when leaving the area.
PHP Code: (Select All)
AddEntityCollideCallback("Player", "Area", "Function", false, 0); 

In your function you would then do:

PHP Code: (Select All)
void Function(string &in asParent, string &in asChild, int alState)
{
if(
alState == 1) //If entering
{
//Do stuff if entering
}

if(
alState == -1) //If leaving
{
//Do stuff if leaving the area
}
} 

Trying is the first step to success.
(This post was last modified: 10-06-2015, 08:10 PM by FlawlessHappiness.)
10-06-2015, 08:09 PM
Find


Messages In This Thread
RE: Music "Lower" if player enters area - by FlawlessHappiness - 10-06-2015, 08:09 PM



Users browsing this thread: 1 Guest(s)