Help with a sound activator for my mod please

Post » Tue Jun 29, 2010 7:11 pm

Hi

I'm really hoping someone here can help me, i've been fighting this mod for two weeks now and getting nowhere. What I am making is a companion mod and what I'd like to happen is for some music to play when the player nears the new NPC's location. I've added the music file into GECK and all seems well.

My problem is I can either get the music to work in game but from too far away from the NPC location, that is by adding the sound file to entry door to the NPC's room in the vault (using the render window)

If I add a marker and try and add the sound file to that no sound plays at all.

Ideally what I would like is for the music to play as the player approaches the door in the vault and to only play the first time the player does this. Any help would be appreciated if I've explained the problem well enough!

Thanks
User avatar
Stacyia
 
Posts: 3361
Joined: Mon Jul 24, 2006 12:48 am

Post » Tue Jun 29, 2010 8:17 pm

Hi

I'm really hoping someone here can help me, i've been fighting this mod for two weeks now and getting nowhere. What I am making is a companion mod and what I'd like to happen is for some music to play when the player nears the new NPC's location. I've added the music file into GECK and all seems well.

My problem is I can either get the music to work in game but from too far away from the NPC location, that is by adding the sound file to entry door to the NPC's room in the vault (using the render window)

If I add a marker and try and add the sound file to that no sound plays at all.

Ideally what I would like is for the music to play as the player approaches the door in the vault and to only play the first time the player does this. Any help would be appreciated if I've explained the problem well enough!

Thanks


Sounds like what you need is a trigger zone near the door. Place an xmarker and check 'initially disabled', then place the sound object (of the sound you want to play) and in the 'enable parent' tab choose the xmarker and check 'pop-in.' After you draw your trigger zone, in the 'linked reference tab', select the xmarker you placed. If everything works as intended, the sound file should play the moment the player enters the trigger zone.
User avatar
Mashystar
 
Posts: 3460
Joined: Mon Jul 16, 2007 6:35 am

Post » Tue Jun 29, 2010 4:01 pm

Sounds like what you need is a trigger zone near the door. Place an xmarker and check 'initially disabled', then place the sound object (of the sound you want to play) and in the 'enable parent' tab choose the xmarker and check 'pop-in.' After you draw your trigger zone, in the 'linked reference tab', select the xmarker you placed. If everything works as intended, the sound file should play the moment the player enters the trigger zone.


Thanks ripple, really appreciate the quick reply, I'll give it a go
User avatar
Charlotte X
 
Posts: 3318
Joined: Thu Dec 07, 2006 2:53 am

Post » Tue Jun 29, 2010 12:06 pm

Thanks ripple, really appreciate the quick reply, I'll give it a go



Almost got it working perfectly now thanks to Ripple! The only problem now is that it keeps playing constantly instead of playing once and stopping. In the wav file I created I made sure loop was checked as "none" but even after the companion has been recruited and we move well away from the zone the music keeps playing. Is it possible to play once through the wav file and then stop? I tried the playerdisable script in the xmarker but that makes the sound not play at all.

Nearly there now!
User avatar
Tammie Flint
 
Posts: 3336
Joined: Mon Aug 14, 2006 12:12 am

Post » Tue Jun 29, 2010 5:56 am

Almost got it working perfectly now thanks to Ripple! The only problem now is that it keeps playing constantly instead of playing once and stopping. In the wav file I created I made sure loop was checked as "none" but even after the companion has been recruited and we move well away from the zone the music keeps playing. Is it possible to play once through the wav file and then stop? I tried the playerdisable script in the xmarker but that makes the sound not play at all.

Nearly there now!


Hmm...if you want to play it just once, instead of placing a sound object, attach a script to the trigger zone. Sometihing like:

scn playsoundscriptshort DoOnceBegin OnTriggerEnter player	if DoOnce == 0		playsound (soundfilename)	set DoOnce == 1End


Should be as simple as that.
User avatar
+++CAZZY
 
Posts: 3403
Joined: Wed Sep 13, 2006 1:04 pm

Post » Tue Jun 29, 2010 7:56 pm

Hmm...if you want to play it just once, instead of placing a sound object, attach a script to the trigger zone. Sometihing like:

scn playsoundscriptshort DoOnceBegin OnTriggerEnter player	if DoOnce == 0		playsound (soundfilename)	set DoOnce == 1End


Should be as simple as that.


Thanks ripple, I was getting a mismatched if/end error but I added endif to the script and that error disappeared but now I get a "mismatched no parameter sound" at line 7 error. I have re-named (soundfilename) to nomichaelstheme.wav which is the name of the sound file I added to GECK.

I do appreciate the help, I'd be lost without you, scripting is something I haven't mastered yet!
User avatar
Unstoppable Judge
 
Posts: 3337
Joined: Sat Jul 29, 2006 11:22 pm

Post » Tue Jun 29, 2010 6:08 pm

Thanks ripple, I was getting a mismatched if/end error but I added endif to the script and that error disappeared but now I get a "mismatched no parameter sound" at line 7 error. I have re-named (soundfilename) to nomichaelstheme.wav which is the name of the sound file I added to GECK.

I do appreciate the help, I'd be lost without you, scripting is something I haven't mastered yet!


No Problem. I forgot the 'endif' and to tell you that you should re-name (soundfilename) to the name of the wav file you want to play. So does it work now?
User avatar
Ash
 
Posts: 3392
Joined: Tue Jun 13, 2006 8:59 am

Post » Tue Jun 29, 2010 6:16 am

No Problem. I forgot the 'endif' and to tell you that you should re-name (soundfilename) to the name of the wav file you want to play. So does it work now?


No as I say , I changed the soundfilename to the name of the file straight away, I got what you meant there. Adding the endif solved the mismatched if at line 6 but now I get the error saying "missing parameter sound" error at line 7. Don't get it because I have named the file exactly as it is in GECK. This is the script I have now that gives the error

"scn playsoundscript

short DoOnce

Begin OnTriggerEnter player
if DoOnce == 0
playsound (nomichaelstheme.wav)
set DoOnce == 1
endif
End"

I've tried it without the wav extension aswell. I bet I'm doing something stupid, I can just sense it ;-)
User avatar
Christine
 
Posts: 3442
Joined: Thu Dec 14, 2006 12:52 am

Post » Tue Jun 29, 2010 3:05 pm

I've tried it without the wav extension aswell. I bet I'm doing something stupid, I can just sense it ;-)


Remove the brackets around the filename as well as the .wav extension :)
User avatar
Baylea Isaacs
 
Posts: 3436
Joined: Mon Dec 25, 2006 11:58 am

Post » Tue Jun 29, 2010 4:58 pm

Remove the brackets around the filename as well as the .wav extension :)


Wondered when you'd spot that ;-)

Just kidding (a reference to an old British comedy Dad's Army which you probably haven't heard of!)

I told you I was doing something stupid !

EDIT : Its not my day, I'm now getting

Line 8 Syntax Error : Missing "to" in set command

Bet you are swearing at me now aren't you ;-)
User avatar
Patrick Gordon
 
Posts: 3366
Joined: Thu May 31, 2007 5:38 am

Post » Tue Jun 29, 2010 9:18 am

damn, double post by accident.
User avatar
Kill Bill
 
Posts: 3355
Joined: Wed Aug 30, 2006 2:22 am

Post » Tue Jun 29, 2010 2:30 pm

Nah, I am swearing at myself. I mod late at night/early morning and I am always so tired I make all sorts of mistakes,. I forgot to add a number of things in the original suggested script. Try this one:

scn playsoundscriptshort DoOnceBegin OnTriggerEnter player	   if DoOnce == 0		   playsound nomichaelstheme	   set DoOnce to 1	   endifEnd


Keep in mind that with this attached to the trigger zone, if the player leaves the same way s/he came and passes through the trigger zone again, it will trigger the script a second time. I am not sure if that is a big issue for your mod.

[edit] I must have edited this post 5 times to get it right :/
User avatar
J.P loves
 
Posts: 3487
Joined: Thu Jun 21, 2007 9:03 am

Post » Tue Jun 29, 2010 1:17 pm

Nah, I am swearing at myself. I mod late at night/early morning and I am always so tired I make all sorts of mistakes,. I forgot to add a number of things in the original suggested script. Try this one:

scn playsoundscriptshort DoOnceBegin OnTriggerEnter player	   if DoOnce == 0		   playsound nomichaelstheme	   set DoOnce to 1	   endifEnd


Keep in mind that with this attached to the trigger zone, if the player leaves the same way s/he came and passes through the trigger zone again, it will trigger the script a second time. I am not sure if that is a big issue for your mod.


Hi , no I don't see that as an issue, basically he is a companion and once hired there will be no reason to visit this location again so it should be fine. Thanks for your help, the script has saved fine. I am guessing now that I need to remove the sound file and the xmarker from the render window and just leave the trigger?
User avatar
Ross
 
Posts: 3384
Joined: Thu Aug 10, 2006 7:22 pm

Post » Tue Jun 29, 2010 11:24 am

Hi , no I don't see that as an issue, basically he is a companion and once hired there will be no reason to visit this location again so it should be fine. Thanks for your help, the script has saved fine. I am guessing now that I need to remove the sound file and the xmarker from the render window and just leave the trigger?



Actually just tested it and the first time I went through the trigger zone it worked, played through once as needed. When I left it didn't trigger :-) I then turned round and went back and nothing

Perfect.

Really appreciate your help, I'd have never got that working myself
User avatar
Yvonne
 
Posts: 3577
Joined: Sat Sep 23, 2006 3:05 am

Post » Tue Jun 29, 2010 6:12 am

Actually just tested it and the first time I went through the trigger zone it worked, played through once as needed. When I left it didn't trigger :-) I then turned round and went back and nothing

Perfect.

Really appreciate your help, I'd have never got that working myself


Oh cool, guess I was wrong :) (somehow forgot about the 'doonce'....) You're welcome. And yes, you no longer need the sound object or the trigger, just the trigger zone.
User avatar
Gemma Woods Illustration
 
Posts: 3356
Joined: Sun Jun 18, 2006 8:48 pm


Return to Fallout 3