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
Script Help Picking up an item gets a sound played
Adny Offline
Posting Freak

Posts: 1,766
Threads: 6
Joined: Mar 2012
Reputation: 173
#2
RE: Picking up an item gets a music played

In the thread title it says "music" but in your description it says sound. You can play music by using the function:

PlayMusic(string& asMusicFile, bool abLoop, float afVolume, float afFadeTime, int alPrio, bool abResume);
asMusicFile = name of file and the extension ".ogg", (i.e. "song.ogg")
abLoop = will the music continuously loop? True/False
afVolume = a float of the volume of the music, max volume being 1.0f
afFadeTimer = The amount of time it takes the music to fade out before stopping (or looping)
alPrio = The priority, 0 being the highest (meaning it will always be heard)
abResume = idk, just use false

or, you can play sounds by using one of 2 functions:

PlaySoundAtEntity(string& asSoundName, string& asSoundFile, string& asEntity, float afFadeTime, bool abSaveSound);

asSoundName = Internal Name of the sound (can leave blank)
asSoundFile = name of the sound file
asEntity = the entity to play the sound at (can be "Player")
afFadeTime = see music's function
abSaveSound = false


PlayGuiSound(string& asSoundFile, float afVolume);
asSoundFile = see "PlaySoundAtEntity"
afVolume = a float value for the volume of the sound


PlayGuiSound will play a sound at the player.

To use 1 of these 3 functions, simply copy/paste one into the same part of the script where you set the entity active, and fill out the information accordingly.

Hope that helped!

I rate it 3 memes.
07-29-2012, 06:11 AM
Find


Messages In This Thread
RE: Picking up an item gets a music played - by Adny - 07-29-2012, 06:11 AM



Users browsing this thread: 1 Guest(s)