Frictional Games Forum (read-only)
[SCRIPT] Sound not playing - 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] Sound not playing (/thread-12545.html)

Pages: 1 2 3 4


RE: Sound not playing - eagledude4 - 01-13-2012

(01-13-2012, 05:14 AM)flamez3 Wrote: You torrented it?

I did originally, but I purchased it. I downloaded it from the frictional games store.





RE: Sound not playing - flamez3 - 01-13-2012

Oh ok, could you please explain what you want done exactly? And why it is not working (Sorry, but I feel very lost in this thread xD)


RE: Sound not playing - eagledude4 - 01-13-2012

(01-13-2012, 05:17 AM)flamez3 Wrote: Oh ok, could you please explain what you want done exactly? And why it is not working (Sorry, but I feel very lost in this thread xD)
I want the sound to play as soon as the level starts at the clock's location.




RE: Sound not playing - flamez3 - 01-13-2012

Just place the sound in the level editor next to the clock?


RE: Sound not playing - eagledude4 - 01-13-2012

(01-13-2012, 05:48 AM)flamez3 Wrote: Just place the sound in the level editor next to the clock?
I've actually just thought this through a little more, and decided to play the chime at the beginning by doing what you suggested: I replaced my loop sound that's in the editor with the chime, and added a timer to play the loop after the chime finishes.

OnStart:
Code:
AddTimer("", 29.11f, "StartClock");

function:
Code:
void StartClock(string &in asTimer) {
    PlaySoundAtEntity("", "big_clock_loop.snt", "clock_grandfather_1", 0.0f, false);
}

So now its reversed. The sound that was working is no longer working, and the sound that wasn't working, is now working. Is where something wrong with my script function?

Maybe instead of using PlaySoundAtEntity, I can make a sound in the editor active through the script, and have it inactive in the editor?





RE: Sound not playing - flamez3 - 01-13-2012

(01-13-2012, 04:15 PM)eagledude4 Wrote:
(01-13-2012, 05:48 AM)flamez3 Wrote: Just place the sound in the level editor next to the clock?
I've actually just thought this through a little more, and decided to play the chime at the beginning by doing what you suggested: I replaced my loop sound that's in the editor with the chime, and added a timer to play the loop after the chime finishes.

OnStart:
Code:
AddTimer("", 29.11f, "StartClock");

function:
Code:
void StartClock(string &in asTimer) {
    PlaySoundAtEntity("", "big_clock_loop.snt", "clock_grandfather_1", 0.0f, false);
}

So now its reversed. The sound that was working is no longer working, and the sound that wasn't working, is now working. Is where something wrong with my script function?

Maybe instead of using PlaySoundAtEntity, I can make a sound in the editor active through the script, and have it inactive in the editor?
You can't make the sound deactive in the level editor. There is no other way other than PlaySoundAtEntity. Maybe you can save it as music and use PlayMusic?


RE: Sound not playing - eagledude4 - 01-13-2012

I don't want to say you're wrong, but there's an "active" checkbox in the sound properties. Wouldn't leaving this box unchecked deactivate the sound? I don't want to go looking for other solutions without first finding the problem.



RE: Sound not playing - flamez3 - 01-13-2012

No, it doesn't work; I have tried this before in my earlier CS and it didn't work for me.
Maybe re-making the sound again?


RE: Sound not playing - eagledude4 - 01-13-2012

(01-13-2012, 04:49 PM)flamez3 Wrote: No, it doesn't work; I have tried this before in my earlier CS and it didn't work for me.
Maybe re-making the sound again?
I know the sound works. It plays in the level editor. I just can't get it to play through my .hps.





RE: Sound not playing - flamez3 - 01-13-2012

Where is the sound file located (sorry if I asked this before :3)