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
An eager newcomer who wants to learn...
Acies Offline
Posting Freak

Posts: 1,643
Threads: 60
Joined: Feb 2011
Reputation: 73
#13
RE: An eager newcomer who wants to learn...

Script functions can be found here: http://wiki.frictionalgames.com/hpl2/amn..._functions

-- I have taken the liberty to copy paste the functions regarding sound --

This is for playing music:
void PlayMusic(string& asMusicFile, bool abLoop, float afVolume, float afFadeTime, int alPrio, bool abResume);
Plays music.

asMusicFile - the music to play + extension .ogg
abLoop - determines whether a music track should loop
afVolume - volume of the music
afFadeTime - time in seconds until music reaches full volume
alPrio - priority of the music. Note that only the music with the highest priority can be heard! 0 - highest, 1 - lower, etc

Can be used to play a sound (without any specific location):

void PlayGuiSound(string& asSoundFile, float afVolume);
Plays a sound, not using 3D.

asSoundFile - the sound to play (extension is .snt) **Acies comment: The extension might very well be .ogg - I don't know why the user set it so be .snt , but .snt works too.**
afVolume - the volume of the sound

This functions plays a sound at a specific location:

void PlaySoundAtEntity(string& asSoundName, string& asSoundFile, string& asEntity, float afFadeTime, bool abSaveSound);
Creates a sound on an entity.

asSoundName - internal name
asSoundFile - the sound to use + extension .snt
asEntity - the entity to create the sound at, can be “Player”
afFadeTime - time in seconds the sound needs to fade
abSaveSound - determines whether a sound should “remember” its state. If true, the sound is never attached to the entity! Also note that saving should on be used on looping sounds!

I think that for a "location sound" the extension must be ".snt".

Some other comments on playing sounds:
- Playgui works on every sound.
- PlaySoundAtEntity can use a scriptarea as an entity (good to create an invisible place from where the sound is played).
- The "alPrio" concerning playing music is important when stopping music.
void StopMusic(float afFadeTime, int alPrio);
Stops music.

afFadeTime - time in seconds until music stops
alPrio - the priority of the music that should stop

When stopping music the alPrio must be the same number as issued at Playmusic.

[Image: mZiYnxe.png]


(This post was last modified: 08-11-2011, 11:35 PM by Acies.)
08-11-2011, 11:34 PM
Find


Messages In This Thread
RE: An eager newcomer who wants to learn... - by Acies - 08-11-2011, 11:34 PM



Users browsing this thread: 1 Guest(s)