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


Thread Rating:
  • 1 Vote(s) - 1 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help with sounds!
MulleDK19 Offline
Senior Member

Posts: 545
Threads: 21
Joined: Jun 2009
Reputation: 10
#2
RE: Help with sounds!

In your script in the function called OnStart() you add callbacks.

Example:
//This function is called the first time the map is loaded
void OnStart()
{
    //Add a collision callback between the Player and the area called MyArea
    AddEntityCollideCallback("Player", "MyArea", "CollideMyArea", true, 1);
    
    //Add a interaction callback for the lantern called lantern_1
    SetEntityPlayerInteractCallback("lantern_1", "LanternTaken", true);
}

/**
* This function is called when the Player collides with the area called MyArea,
* because we added a collision callback.
**/
void CollideMyArea(string &in asParent, string &in asChild, int alState)
{
    //Play sound at player
    PlaySoundAtEntity("", "11_animal_squeal", "Player", 0, false);
}


/**
* This function is called when the Player interacts with the lantern called lantern_1
* because we added an interaction callback.
**/
void LanternTaken(string &in asEntity)
{
    //Play sound at player
    PlaySoundAtEntity("", "05_wall_scratch", "Player", 0, false);
}

[Image: 16455.png]
09-16-2010, 07:54 PM
Find


Messages In This Thread
Help with sounds! - by Cgturner - 09-16-2010, 07:42 PM
RE: Help with sounds! - by MulleDK19 - 09-16-2010, 07:54 PM
RE: Help with sounds! - by Armored Cow - 09-16-2010, 08:01 PM
RE: Help with sounds! - by Cgturner - 09-16-2010, 08:18 PM
RE: Help with sounds! - by MulleDK19 - 09-16-2010, 08:19 PM
RE: Help with sounds! - by Cgturner - 09-17-2010, 01:00 AM
RE: Help with sounds! - by MulleDK19 - 09-17-2010, 01:07 AM
RE: Help with sounds! - by Cgturner - 09-17-2010, 01:18 AM
RE: Help with sounds! - by MulleDK19 - 09-17-2010, 01:31 AM
RE: Help with sounds! - by Cgturner - 09-17-2010, 01:45 AM
RE: Help with sounds! - by Armored Cow - 09-17-2010, 02:11 AM
RE: Help with sounds! - by Cgturner - 09-17-2010, 03:21 AM
RE: Help with sounds! - by MulleDK19 - 09-17-2010, 03:25 AM
RE: Help with sounds! - by Cgturner - 09-17-2010, 03:51 AM
RE: Help with sounds! - by MulleDK19 - 09-17-2010, 04:06 PM
RE: Help with sounds! - by Cgturner - 09-17-2010, 03:56 PM
RE: Help with sounds! - by jens - 09-17-2010, 04:17 PM
RE: Help with sounds! - by Armored Cow - 09-17-2010, 04:04 PM
RE: Help with sounds! - by Cgturner - 09-17-2010, 04:25 PM
RE: Help with sounds! - by Cgturner - 09-18-2010, 06:58 AM
RE: Help with sounds! - by gosseyn - 09-18-2010, 07:19 AM
RE: Help with sounds! - by Cgturner - 09-18-2010, 07:51 AM



Users browsing this thread: 3 Guest(s)