Frictional Games Forum (read-only)
Scripting help - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: Scripting help (/thread-11663.html)

Pages: 1 2


RE: Scripting help - Mine Turtle - 12-05-2011

(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!! Big Grin 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? ^^


RE: Scripting help - GreyFox - 12-05-2011

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



RE: Scripting help - Urakozachok - 12-28-2011

Tell us who else, please use a ready example script AddPropImpulse. I would be very grateful.