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
[SCRIPT] Musik won't play [Solved]
ethics Offline
Member

Posts: 51
Threads: 18
Joined: Jan 2014
Reputation: 0
#1
[SCRIPT] Musik won't play [Solved]

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!

(This post was last modified: 05-10-2014, 10:30 AM by ethics.)
02-23-2014, 11:26 AM
Find
PutraenusAlivius Offline
Posting Freak

Posts: 4,713
Threads: 75
Joined: Dec 2012
Reputation: 119
#2
RE: [SCRIPT] Musik won't play

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.

"Veni, vidi, vici."
"I came, I saw, I conquered."
(This post was last modified: 02-23-2014, 12:02 PM by PutraenusAlivius.)
02-23-2014, 12:00 PM
Find
DnALANGE Offline
Banned

Posts: 1,549
Threads: 73
Joined: Jan 2012
#3
RE: [SCRIPT] Musik won't play

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??
(This post was last modified: 02-23-2014, 04:42 PM by DnALANGE.)
02-23-2014, 04:40 PM
Find
davide32 Offline
Junior Member

Posts: 27
Threads: 6
Joined: Nov 2013
Reputation: 0
#4
RE: [SCRIPT] Musik won't play

PlaySoundAtEntity is correct or I guess
PlayGuiSound(string& asSoundFile, float afVolume);
(This post was last modified: 02-23-2014, 10:21 PM by davide32.)
02-23-2014, 10:21 PM
Find
DnALANGE Offline
Banned

Posts: 1,549
Threads: 73
Joined: Jan 2012
#5
RE: [SCRIPT] Musik won't play

(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.
02-23-2014, 11:08 PM
Find
davide32 Offline
Junior Member

Posts: 27
Threads: 6
Joined: Nov 2013
Reputation: 0
#6
RE: [SCRIPT] Musik won't play

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
(This post was last modified: 02-24-2014, 01:59 PM by davide32.)
02-24-2014, 01:57 PM
Find
ethics Offline
Member

Posts: 51
Threads: 18
Joined: Jan 2014
Reputation: 0
#7
RE: [SCRIPT] Musik won't play

(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.

(This post was last modified: 02-26-2014, 06:03 PM by ethics.)
02-26-2014, 05:58 PM
Find
Mudbill Offline
Muderator

Posts: 3,881
Threads: 59
Joined: Apr 2013
Reputation: 179
#8
RE: [SCRIPT] Musik won't play

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.

02-26-2014, 06:33 PM
Find
RedKnight Offline
Posting Freak

Posts: 774
Threads: 16
Joined: Sep 2013
Reputation: 6
#9
RE: [SCRIPT] Musik won't play

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

6666666666666666666566666666666666
02-27-2014, 07:00 AM
Find
Romulator Offline
Not Tech Support ;-)

Posts: 3,628
Threads: 63
Joined: Jan 2013
Reputation: 195
#10
RE: [SCRIPT] Musik won't play

(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...

Discord: Romulator#0001
[Image: 3f6f01a904.png]
02-27-2014, 07:25 AM
Find




Users browsing this thread: 3 Guest(s)