Frictional Games Forum (read-only)
[SCRIPT] Musik won't play [Solved] - 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: [SCRIPT] Musik won't play [Solved] (/thread-24685.html)



[SCRIPT] Musik won't play [Solved] - ethics - 02-23-2014

After picking up a note and reading it, I wanted that music starts playing.
My script for this:

void OnStart()
{
SetEntityPlayerInteractCallback("notiz", "playdatshiat", true);
}

void playdatshiat(string &in item)
{
PlayMusic("", "attic_ambience.snt", "Player", 0, false);
}


I tried everything.
Please help!


RE: [SCRIPT] Musik won't play - PutraenusAlivius - 02-23-2014

You're using PlayMusic, but that is the signature of the PlaySoundAtEntity.
Spoiler below!

PlayMusic(string& asMusicFile, bool abLoop, float afVolume, float afFadeTime, int alPrio, bool abResume);

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 - lowest, 1 - higher, etc.
abResume - if true, playback will be continued from where the track stopped after the call to StopMusic(); if false, the track will be restarted.


And this it the wrong section. If you want to ask questions regarding CS development go to the Development Support please.


RE: [SCRIPT] Musik won't play - DnALANGE - 02-23-2014

What JustanotherPlayer means is this in a easyer way!
Quote:PlayMusic("YOURMUSICFILE.ogg", true, 0.7, 2, 1, true);
-
"playdatshiat" ........? This will be another trollstory i guess??


RE: [SCRIPT] Musik won't play - davide32 - 02-23-2014

PlaySoundAtEntity is correct or I guess
PlayGuiSound(string& asSoundFile, float afVolume);


RE: [SCRIPT] Musik won't play - DnALANGE - 02-23-2014

(02-23-2014, 10:21 PM)davide32 Wrote: PlaySoundAtEntity is correct or I guess
PlayGuiSound(string& asSoundFile, float afVolume);

What are you talking about??....
This guy wants to play MUSIC isn't it?
IF he wants it to be a sound fx or small music file then it's okay!
BUT, if he wants to play the music and make it loop he should use the function PlayMusic.


RE: [SCRIPT] Musik won't play - davide32 - 02-24-2014

sorry I misunderstood the post DnLANGE you're right you're right I was wrong.

but I have a similar thread with chemical acid when i place jar and play sound Amnesia Get crashed with blackbox error what have i do to repair it? The script are correct


RE: [SCRIPT] Musik won't play - ethics - 02-26-2014

(02-23-2014, 12:00 PM)JustAnotherPlayer Wrote: You're using PlayMusic, but that is the signature of the PlaySoundAtEntity.
Spoiler below!

PlayMusic(string& asMusicFile, bool abLoop, float afVolume, float afFadeTime, int alPrio, bool abResume);

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 - lowest, 1 - higher, etc.
abResume - if true, playback will be continued from where the track stopped after the call to StopMusic(); if false, the track will be restarted.


And this it the wrong section. If you want to ask questions regarding CS development go to the Development Support please.

Yeah, i know. But I couldn't find the dev support, because I'm pretty new to the forum.
Sorry!

(02-23-2014, 04:40 PM)DnALANGE Wrote: What JustanotherPlayer means is this in a easyer way!
Quote:PlayMusic("YOURMUSICFILE.ogg", true, 0.7, 2, 1, true);
-
"playdatshiat" ........? This will be another trollstory i guess??

No, a fanstory for a certain Youtuber. I couldnt find a better name/couldn't think of one at this time.
And also, if the script isn't serious, why should it have an influence on the seriousness of the custom story? the normal amnesia player doesn't cae about the script Big Grin

(02-23-2014, 11:08 PM)DnALANGE Wrote:
(02-23-2014, 10:21 PM)davide32 Wrote: PlaySoundAtEntity is correct or I guess
PlayGuiSound(string& asSoundFile, float afVolume);

What are you talking about??....
This guy wants to play MUSIC isn't it?
IF he wants it to be a sound fx or small music file then it's okay!
BUT, if he wants to play the music and make it loop he should use the function PlayMusic.

You can also use ''PlaySoundAtEntity()'', if you place all your sound and music files in the ''sounds''-folder.


RE: [SCRIPT] Musik won't play - Mudbill - 02-26-2014

The sounds don't even need to be in the sounds folder. They could just be in your custom story folder.

And yeah the script is of course independent of the seriousness of the game. Even Frictional got their funny moments in the script if you look around. I like the HammerTime variable name in the prison levels.


RE: [SCRIPT] Musik won't play - RedKnight - 02-27-2014

You can also convert music from games and others! But if you put credit in your custom storythread, while you don't have a thread at all


RE: [SCRIPT] Musik won't play - Romulator - 02-27-2014

(02-27-2014, 07:00 AM)AprilMC Wrote: You can also convert music from games and others! But if you put credit in your custom storythread, while you don't have a thread at all

As long as it's not taken from games which have a copyright on them...