Mine Turtle
Senior Member
Posts: 647
Threads: 32
Joined: Mar 2011
Reputation:
29
|
RE: Scripting help
(12-05-2011, 01:37 PM)flamez3 Wrote: (12-05-2011, 01:19 PM)darkadders Wrote: [quote='flamez3' pid='103884' dateline='1323085779']
Quote:void OnStart
{
AddEntityCollideCallback("ScriptArea_1", "Player", "Scare1", false, 1)
}
void Scare1(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "sound.snt", "Player", 0, false);
}
You would use that to make a noise play somewhere.
You would need a global.hps file to have a sound playing through out different maps. AWESOME!! thanks a bunch! can i use an mp3 file to play the noise? or do i need to convert it to another format? (snt). do you have a code for playing music? ^^
To play music:
Quote: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
do i put this in the actual scriptfile of the map? or do i put it in the .snt file? ^^
|
|
12-05-2011, 08:04 PM |
|
GreyFox
Member
Posts: 162
Threads: 23
Joined: Jul 2011
Reputation:
2
|
RE: Scripting help
PlayMusic(string& asMusicFile, bool abLoop, float afVolume, float afFadeTime, int alPrio, bool abResume);
That part goes in your script, the rest
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
Is so you know what each thing means.
Example:
PlayMusic("02_amb_safe.ogg", true, 1, 0, 0);
-Grey Fox
Current Project
Forgotten
|
|
12-05-2011, 09:17 PM |
|
Urakozachok
Junior Member
Posts: 12
Threads: 6
Joined: Nov 2011
Reputation:
0
|
RE: Scripting help
Tell us who else, please use a ready example script AddPropImpulse. I would be very grateful.
|
|
12-28-2011, 10:33 AM |
|
|