Jump to content

DOWNLOAD MODS

Are you looking for something shiny for your load order? We have many exclusive mods and resources you won't find anywhere else. Start your search now...

LEARN MODDING

Ready to try your hand at making your own mod creations? Visit the Enclave, the original ES/FO modding school, and learn the tricks of the trade from veteran modders...

JOIN THE ALLIANCE

Membership is free and registering unlocks image galleries, project hosting, live chat, unlimited downloads, & more...

Adding sounds to a WIPz


donnato
 Share

Recommended Posts

Ok, I went looking for info on linking .wav files to doors,triggers,etc. and wasn`t able to find much so without further ado, here`s my first questions:

1.when I double click a door in the cell view window and the object box comes up there`s the Edit Base button. This opens another box in which are a few options for sounds. Open and Close are self explainatory but there`s also Loop(usually blank) and to the left is the script box.The question,If I want to add an fx to sound once on activation,do I have to script it in, or can I use/should I use Open/Close or Loop?

2.How does one attach a sound file to a zone type trigger?

3.Is there a limit(within reason)to the length or duration of the sound and can an opening/closing be prolonged/protracted?

I will be experimenting on my own but I think these might be some common questions others might be interested in.Thank you all for all your help.

Link to comment
Share on other sites

1) Script it, problably the best option there :shrug:

2) You do not attach sounds to the trigger zone, rather you script the trigger zone to player the sound file when triggered

3) Sound length is dealt with when creating the sound file.

Thank you IS, now I have to go to the wiki to get script commands straight.This is gonna be funner than fun. :detective:

Link to comment
Share on other sites

Here I can give and example or two to help you out :detective:

Trigger Zone

Scn TriggerScript

Short DoOnce

Begin OnTrigger Player
If DoOnce == 0
PlaySound YourSoundID
Endif
Set DoOnce to 1
End

Begin OnReset
Set DoOnce to 0
End[/code] [b]Door Script[/b]
[code]Scn DoorScript

Short DoOnce

Begin OnActivate
If DoOnce == 0
PlaySound YourSoundID
Set DoOnce to 1
Activate
Else
Activate
Endif
End

Link to comment
Share on other sites

The base object of your door can be set to an 'open' and a 'close' sound. The loop would be for a constantly playing sound when you are near the door. For example, a force field that hums.

Any time you change a door object, you should make a new version of the door. Otherwise, your change will be to every occurance of that door in the game.

Link to comment
Share on other sites

Ok here`s my first attempt:

scn aaDoorScript

Shory DoOnce

Begin onactivate

If DoOnce == 0

PlaySound trp_clawtrap_forward_.wav

Set DoOnce to 1

Activate

Else

Activate

Endif

End

I skipped a line under the scn line and again under Short DoOnce. There was a syntax error on line 7.If I count the skipped lines that would be the line containing the .wav file.If I don`t count skipped lines it would be the line containing the first Activate. Am I using an incorrect sound file name?

Link to comment
Share on other sites

First a Syntax error, fix Shory DoOnce this Short DoOnce, Also the sound file ID is the CS ID not the sound file name. Now you know what you want to use, take a look in the CS and you should find it.

Forget the misspell here, it`s not in the script. Here`s what I tried from the CS:

fx\traps\trp_clawtrap_forward.wav

just the way it is here. Then I tried without the \ . Still no soap.Use _ instead of \?

Link to comment
Share on other sites

Forget the misspell here, it`s not in the script. Here`s what I tried from the CS:

fx\traps\trp_clawtrap_forward.wav

just the way it is here. Then I tried without the \ . Still no soap.Use _ instead of \?

Why not make it easier on yourself and use TRPClawTrapForward, which is the CS ID of the sound.

To use custom sound files you will need to use the StreamMusic function, example:

StreamMusic "fx\traps\trp_clawtrap_forward.wav"

Link to comment
Share on other sites

Why not make it easier on yourself and use TRPClawTrapForward, which is the CS ID of the sound.

To use custom sound files you will need to use the StreamMusic function, example:

StreamMusic "fx\traps\trp_clawtrap_forward.wav"

Uh, ok I scrolled to the side in the CS and used that ID. :D our way is the best methinks. Thank you.

Link to comment
Share on other sites

Either way will work now you have the right function :), But using the CS ID is easier when using stock commands.

Woohoo, it saved. Thank you IS. I don`t know why I always make things harder than they need to be. Now I know Which ID to use when I move on to triggers. :D

Link to comment
Share on other sites

This is how I would script it:

scn aabDoorScriptEntry
Short DoOnce

Begin OnActivate
if DoOnce == 0
Set DoOnce to 1
PlaySound TRPClawTrapForward
endif
Activate
End[/code]

This will play the sound only once when its activated. But, the sound may or may not play if you are moving to a new cell and it has to load. A timer can be used to wait on the 'Activate' until the sound is done if necessary.

Link to comment
Share on other sites

Okay I have tested this in a mod of my own. Using this script on the door:

Scn DoorScript

Short DoOnce

Begin onactivate player
If DoOnce == 0
PlaySound TRPClawTrapForward
Set DoOnce to 1
Endif
Activate
End[/code]

It plays fine, but like I said, when you add an activator script to a door, I don't think it will function as a door any more. It will function as an activator which will require you to add a teleport command to the door script to make it useable. I also tested this using this same sound in the door's default open close sound slots and that works brilliantly plus the door remains functional, I think that's what you should do and forget the scripting altogether. This is another case where things are being made harder than necessary. Just add TRPClawTrapForward to the open slot and TRPClawTrapBackward to the closing slot and you have the effect you want with no excess scripts.

Link to comment
Share on other sites

This is how I would script it:

scn aabDoorScriptEntry

Short DoOnce


Begin OnActivate

	if DoOnce == 0

		Set DoOnce to 1

		PlaySound TRPClawTrapForward

	endif

	Activate

End

This will play the sound only once when its activated. But, the sound may or may not play if you are moving to a new cell and it has to load. A timer can be used to wait on the 'Activate' until the sound is done if necessary.

Cool Will, why the changes? I`m all in the same cell so there`s no prob with that loading.

Link to comment
Share on other sites

Cool Will, why the changes? I`m all in the same cell so there`s no prob with that loading.

Its not a big thing, but the 'else' is not needed since you are always doing the 'Activate'. So, it can just be called one time at the end of the script.

Its just 'cleaner' code.

And the doOnce only needs to be set once, not every time the door is activated.

Link to comment
Share on other sites

Okay I have tested this in a mod of my own. Using this script on the door:

Scn DoorScript


Short DoOnce


Begin onactivate player

	If DoOnce == 0

		PlaySound TRPClawTrapForward

		Set DoOnce to 1

	Endif

Activate

End

It plays fine, but like I said, when you add an activator script to a door, I don't think it will function as a door any more. It will function as an activator which will require you to add a teleport command to the door script to make it useable. I also tested this using this same sound in the door's default open close sound slots and that works brilliantly plus the door remains functional, I think that's what you should do and forget the scripting altogether. This is another case where things are being made harder than necessary. Just add TRPClawTrapForward to the open slot and TRPClawTrapBackward to the closing slot and you have the effect you want with no excess scripts.

Thank you Rider, I kinda figured it would be easier to just use the open/close slots and I can. I want this to work because there will be places where I will want voices/sounds slightly after door activation. I figured the script was good but I wonder why it works for you and not here?Maybe some tweaking. Again thank you so much for your help.

By the way,Audacity is telling me I need to load LAME MP3 decoder to get the lame_enc.dll. Te only bit rate setting I found is in the MP3 box and greyed out. No big, Rider. I`ll go back to the tut,I`m just busy with this atm. :thumbup:

Link to comment
Share on other sites

Its not a big thing, but the 'else' is not needed since you are always doing the 'Activate'. So, it can just be called one time at the end of the script.

Its just 'cleaner' code.

And the doOnce only needs to be set once, not every time the door is activated.

Thank you so much for the explaination Will. I can`t take credit for the script,IS gave it to me in a pm. He`s been a great help also. So Now scn becomes aac. :thumbup:

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...