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
Need help with scripting music to areas
DnALANGE Offline
Banned

Posts: 1,549
Threads: 73
Joined: Jan 2012
#13
RE: Need help with scripting music to areas

PHP Code: (Select All)
AddEntityCollideCallback("Player""YOURAREAINTHEEDITOR""SoundatGarden"false0); 

PHP Code: (Select All)
void SoundatGarden(string &in asParentstring &in asChildint alState)
{
if(
alState == 1)
{
PlaySoundAtEntity("STOPGARDENSOUNDS""YOUR.snt""Player"0false);
}

if(
alState == -1)
{
StopSound("STOPGARDENSOUNDS"3);// the number 3 is 3 seconds to fade out to no sounds.
}

Quote:*-*-* You should play a little bit around for the loops and loudness, this is just one of my examples i show to you.
---
What this does is :
IF you are INSIDE the scriptarea (in your editor) the music {Playsoundatentity} will be played.
then..
IF you are NOT inside the area anymore the sound will stop playing .. after the 3 seconds of fadeout.

THIS is a very heplfull thing, remeber this, you can do a lot with this function.

Good luck with your story.
(This post was last modified: 04-04-2014, 01:29 PM by DnALANGE.)
04-04-2014, 01:16 PM
Find


Messages In This Thread
RE: Need help with scripting music to areas - by DnALANGE - 04-04-2014, 01:16 PM



Users browsing this thread: 1 Guest(s)