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
I'm a dumb person.
Anxt Offline
Senior Member

Posts: 588
Threads: 12
Joined: Mar 2011
Reputation: 10
#4
RE: I'm a dumb person.

As Tanshaydar said, there are multiple ways to call functions. Thepaleking's example is how you would go about making it so a sound plays when a character enters an area.

Check the script functions page for more information, but here's the general format for what you are trying to do:

/*The 1 signifies that the function will be called upon entering the area.  -1 means it will be called upon leaving the area.  0 means both.
*/
void OnStart()
{
   AddEntityCollideCallback("Player", "NameOfArea", "NameOfFunction", "DestroyCallbackOnUse(true or false)", 1);  
}

void NameOfFunction(string &in asParent, string &in asChild, int alState)
{
    PlaySoundAtEntity("soundname", "soundfile", "entity", "fadetime", "savesound")
}

Note that you should probably keep "savesound" as false, because it will loop otherwise. Soundname isn't important, just pick something that no other sound uses.

03-21-2011, 04:05 AM
Find


Messages In This Thread
I'm a dumb person. - by evertuy - 03-21-2011, 03:27 AM
RE: I'm a dumb person. - by Tanshaydar - 03-21-2011, 03:41 AM
RE: I'm a dumb person. - by thepaleking - 03-21-2011, 03:42 AM
RE: I'm a dumb person. - by Anxt - 03-21-2011, 04:05 AM
RE: I'm a dumb person. - by evertuy - 03-21-2011, 04:07 AM
RE: I'm a dumb person. - by Tanshaydar - 03-21-2011, 04:28 AM



Users browsing this thread: 1 Guest(s)