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

Privacy Policy


Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
how i do this, When i enter a area an music is played
Author Message
DeathbyNUKE Offline
Junior Member

Posts: 5
Joined: Sep 2010
Reputation: 0
Post: #1
how i do this, When i enter a area an music is played
someone know how?
10-04-2010 03:19 AM
Find all posts by this user Quote this message in a reply
Soon Offline
Junior Member

Posts: 43
Joined: Sep 2010
Reputation: 0
Post: #2
RE: how i do this, When i enter a area an music is played
Start with creating a script area in the editor and name it whatever you want. Like area_music.

Then your script should look something like this:

void OnStart()
{
AddEntityCollideCallback("area_music", "MusicStart");
}


void MusicStart(string &in asParent, string &in asChild, int alState)
{
PlayMusic("04_amb", true, 0.5, 4, 3, true);
}
Make sure the add entity collide callback is in the on start section of your script and the music start function you are calling is outside of On Start, On Enter, and On Leave.
(This post was last modified: 10-04-2010 03:34 AM by Soon.)
10-04-2010 03:31 AM
Find all posts by this user Quote this message in a reply
Post Reply 




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