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
Script Help How to create a music area trigger?
Viuffuz Offline
Junior Member

Posts: 13
Threads: 4
Joined: Jan 2012
Reputation: 0
#1
How to create a music area trigger?

Hello there! I'm new with scripting and I need help with creating an area that makes music start playing when player walks in that area. I've tried a few things but with no results. Thank you for your time!
01-01-2012, 01:35 PM
Find
Dobbydoo Offline
Member

Posts: 50
Threads: 6
Joined: Aug 2011
Reputation: 0
#2
RE: How to create a music area trigger?

You just need to have a script area, and script a collidecallback with it. Then use the PlayMusic function to start the music when you collide with the script area.
(This post was last modified: 01-01-2012, 01:38 PM by Dobbydoo.)
01-01-2012, 01:38 PM
Find
Viuffuz Offline
Junior Member

Posts: 13
Threads: 4
Joined: Jan 2012
Reputation: 0
#3
RE: How to create a music area trigger?

Can you give me an example of a working one please? Big Grin
01-01-2012, 04:44 PM
Find
flamez3 Offline
Posting Freak

Posts: 1,281
Threads: 48
Joined: Apr 2011
Reputation: 57
#4
RE: How to create a music area trigger?

Quote:void OnStart()
{
AddEntityCollideCallback("Player", "ScriptArea1", "MusicPlay", true, 1);

}

void MusicPlay(string &in asParent, string &in asChild, int alState)
PlayMusic(string& asMusicFile, bool abLoop, float afVolume, float afFadeTime, int alPrio, bool abResume);
}

(This post was last modified: 01-01-2012, 05:16 PM by flamez3.)
01-01-2012, 05:15 PM
Find
Viuffuz Offline
Junior Member

Posts: 13
Threads: 4
Joined: Jan 2012
Reputation: 0
#5
RE: How to create a music area trigger?

Oh yeah! Big Grin Thank you really much!!! ^^
01-01-2012, 05:28 PM
Find




Users browsing this thread: 1 Guest(s)