Script to play sound when sneak mode is active?

Post » Wed Jul 21, 2010 5:40 am

I was wandering how would a script look or go or something like that to have it play a sound when I enter Sneak mode? Say the sound is Cloak Engaged or along those lines. I got the Play Online script from another mod and it works fine but when it comes to making a new script I have no clue at all how to make it work properly.



Edit would it be similar to the Online Script below

scn DeathBringerOnline

short DoOnce

begin OnEquip Player
if DoOnce == 0
playsound Online
set DoOnce to 1
endif
end
?
User avatar
Penny Courture
 
Posts: 3438
Joined: Sat Dec 23, 2006 11:59 pm

Post » Wed Jul 21, 2010 3:32 pm

You mean like http://www.youtube.com/watch?v=KNjTIZURjNw?
User avatar
GRAEME
 
Posts: 3363
Joined: Sat May 19, 2007 2:48 am

Post » Wed Jul 21, 2010 9:36 am

Yep I got that exact sound for putting the Armour on I mean the Online one. Yes the cloak one when I sneak I could never figure out how to get it work. What Armour is that?
User avatar
Jade Payton
 
Posts: 3417
Joined: Mon Sep 11, 2006 1:01 pm

Post » Wed Jul 21, 2010 10:16 am

What Armour is that?


Dang, doesnt anyone read video descriptions anymore? :rolleyes: Do you want a script that will trigger the sound when your character enters sneak mode or do you want a script for an armour that will trigger the sound when your character goes into sneak mode while wearing that armour?
User avatar
Farrah Barry
 
Posts: 3523
Joined: Mon Dec 04, 2006 4:00 pm

Post » Wed Jul 21, 2010 2:57 pm

I totally forgot about the descriptions on Youtube lol. That's how long it's been since I've been on there and just the Armour for when I enter sneak mode with it on.
User avatar
Louise Lowe
 
Posts: 3262
Joined: Fri Jul 28, 2006 9:08 am

Post » Wed Jul 21, 2010 12:41 pm

I totally forgot about the descriptions on Youtube lol. That's how long it's been since I've been on there and just the Armour for when I enter sneak mode with it on.


scn StealthSoundScriptshort myStateBegin GameMode	if myState == 5		if player.isSneaking == 1			set myState to 6			playsound SoundYouWantToPlay		endif  	elseif myState == 6		if player.isSneaking == 0			set myState to 5		endif	endifEnd


Most of the credit for this script goes to WillieSea. Obviously, you need to attach the script to an armour as well as add the sound you want to play through the GECK, and rename "SoundYouWantToPlay" to the file name of the sound.
User avatar
Natalie J Webster
 
Posts: 3488
Joined: Tue Jul 25, 2006 1:35 pm

Post » Wed Jul 21, 2010 5:33 pm

Cool thanks to the both of you for the Script. I can finally have cloak engaged on my Armour yay!. I can put that in with the Online Play script right?
User avatar
Mackenzie
 
Posts: 3404
Joined: Tue Jan 23, 2007 9:18 pm

Post » Wed Jul 21, 2010 6:38 pm

This is the script I used for the armour you saw in the video

scn StealthArmorScriptshort myStatebegin OnEquip Player    playsound Online    set myState to 5endbegin OnUnEquip Player    set myState to 0endBegin GameMode    if myState == 5        if player.isSneaking == 1            set myState to 6            playsound stealth        endif      elseif myState == 6        if player.isSneaking == 0            set myState to 5        endif    endifEnd


You just have to change the sound to the name of sound file you want to use, after doing the other steps I mentioned.
User avatar
Prohibited
 
Posts: 3293
Joined: Tue Jun 12, 2007 6:13 am

Post » Wed Jul 21, 2010 1:16 pm

Ok, Cool and thanks again Ripple for the script that you used.
User avatar
He got the
 
Posts: 3399
Joined: Sat Nov 17, 2007 12:19 pm

Post » Wed Jul 21, 2010 7:15 am

Some reason when I enter Sneakmode it doesn't play any sound but the Online sound plays. And I copied and pasted your script and moved everything to where it should be. So no clue why it isn't working.
User avatar
Mashystar
 
Posts: 3460
Joined: Mon Jul 16, 2007 6:35 am

Post » Wed Jul 21, 2010 2:36 pm

In my opinion, it would make more sense to use a scripted object effect than it would to use an object script. The effect item could be conditionalised so that it only applies when run on the player (http://geck.gamesas.com/index.php/GetIsReference") and the target is sneaking (http://geck.gamesas.com/index.php/IsSneaking). The script itself could then be very simple:
Begin ScriptEffectStart	PlaySound OnlineEnd

Cipscis
User avatar
Esther Fernandez
 
Posts: 3415
Joined: Wed Sep 27, 2006 11:52 am

Post » Wed Jul 21, 2010 7:44 am

Some reason when I enter Sneakmode it doesn't play any sound but the Online sound plays. And I copied and pasted your script and moved everything to where it should be. So no clue why it isn't working.


Perhaps it is playing but its so quiet that you can't hear it? Just a thought...
User avatar
Kat Lehmann
 
Posts: 3409
Joined: Tue Jun 27, 2006 6:24 am

Post » Wed Jul 21, 2010 5:25 pm

Did you follow all the steps I mentioned? Inclluding adding the sound to the game through GECK?
User avatar
Madeleine Rose Walsh
 
Posts: 3425
Joined: Wed Oct 04, 2006 2:07 am

Post » Wed Jul 21, 2010 3:59 pm

To Ripple: Yep the sounds in GECk as Cloak it even plays when I hit play. even put Cloak in the space were stealth is. And nothing some reason.

To mw_junkie: Well Online and Cloak sound both share the exact same Min. Att, Max Att and, Static Att. So I don't think it's playing so low I can't hear it.

To Cipscis: Thanks for the tip about putting it as an Object Effect.

Also to Ripple: Here's the Script as I have it in GECK
scn DeathBringerOnline
short myState

begin OnEquip Player
playsound Online
set myState to 5
end

begin OnUnEquip Player
set myState to 0
end

Begin GameMode
if myState == 5
if player.isSneaking == 1
set myState to 6
playsound stealth
endif

elseif myState == 6
if player.isSneaking == 0
set myState to 5
endif
endif
End
User avatar
BRIANNA
 
Posts: 3438
Joined: Thu Jan 11, 2007 7:51 pm

Post » Wed Jul 21, 2010 5:30 pm

To Ripple: Yep the sounds in GECk as Cloak it even plays when I hit play. even put Cloak in the space were stealth is. And nothing some reason.


You have to change the sound to the name of sound file you want to use. In this case

playsound stealth


Would be

playersound cloak

User avatar
Hilm Music
 
Posts: 3357
Joined: Wed Jun 06, 2007 9:36 pm

Post » Wed Jul 21, 2010 11:03 am

Did that even renamed it to stealth and it still doesn't seem to work right some reason. My guess is that it just Hates me. Also quick question can I change the pipboy light to red as if it's infrared or something along those lines?


Edit: Another question is it possible to remove the blur when being shot or hit by anything?
User avatar
Gwen
 
Posts: 3367
Joined: Sun Apr 01, 2007 3:34 am

Post » Wed Jul 21, 2010 10:39 am

Did that even renamed it to stealth and it still doesn't seem to work right some reason.


Bleh, I've been staring at my monitor for too long today and missed that. Even got the correction code wrong (it should be "playsound stealth", not "playersound stealth", sorry).

Alright, why don't you detail the steps you took (eg. adding the sound, adding the script, attaching the script to the armour, etc.), and I'll see if anything was missed.

My guess is that it just Hates me. Also quick question can I change the pipboy light to red as if it's infrared or something along those lines?


Edit: Another question is it possible to remove the blur when being shot or hit by anything?


There are actually already mods that do the two things you requested (eg. changing the colour of the pipboy light and removing the blur when hit). I've come across them on FO3Nexus before.
User avatar
Sarah Kim
 
Posts: 3407
Joined: Tue Aug 29, 2006 2:24 pm

Post » Wed Jul 21, 2010 5:26 am

Ok what I do is go to sound in geck then type the editor name such as Cloak. Then set the Min Att at 135, Max Att at 1700 then Statis Att at -3.08. Then I check 360 LFE and Looping None. After that I of course make sure the sound plays then click ok. After that I go to scripts right click then click new copy & paste the script I want to use. Then I save the script then I go to the Armour I want to put it on after that Make sure everything is in order click ok then save and then exit GECK. After all that I launch the game with FOSE it loads I go into my Pipboy unequipped the Armour then reequipped it. The Sound Online play fine. But I'm gonna check the playersound and change it to Play sound. Also heres a little something for kicks A pic. I was bored so I came up with this one day lol.

Nuka-Cola Quantum Secret Problem: http://i76.photobucket.com/albums/j10/ultimaomegacloud/Nukacolacom.jpg


Edit: Forgot I think I found the pipboy light color change it has a bulb icon next to Pipboylight editor id name. I think that's it.
User avatar
Kill Bill
 
Posts: 3355
Joined: Wed Aug 30, 2006 2:22 am

Post » Wed Jul 21, 2010 9:23 am

Any update on why the sound won't play like it should be? And thanks again for all your help so far.
User avatar
James Baldwin
 
Posts: 3366
Joined: Tue Jun 05, 2007 11:11 am

Post » Wed Jul 21, 2010 11:40 am

I am actually not clear what you were attempting to do here

Ok what I do is go to sound in geck then type the editor name such as Cloak. Then set the Min Att at 135, Max Att at 1700 then Statis Att at -3.08. Then I check 360 LFE and Looping


I'll just type out the steps you should do to get this working.

1) add the custom cloaking sound to the game. This needs to be a wav file. It should be added to the game by creating a new sound in the GECK. Don't edit anything other than pointing the game to the location of the wav file (it needs to be somewhere in "\data\sound\fx\").

2) attach the script to an armour. You should probably create a new armour instead of overwriting a default game armour. You can just select the armour in the GECK and right click to "duplicate." The GECK will give it an unique editor ID and form ID, then you can give it an unique name.

3) Place the armour into the game by selecting a cell you have visited and the render window. This way you can test it.

4) Save your edits as a new plugin and load the plugin before going into the game.

That should be all that is required.
User avatar
Erin S
 
Posts: 3416
Joined: Sat Jul 29, 2006 2:06 pm

Post » Wed Jul 21, 2010 9:37 am

That's what I did except for the new Armour I use Arm of Orion Commando Armour which I already have equipped. I even unequipped it and reequipped it and the only sound that would still play was Online.Wav.


Cloak Sound File In GECK: http://i76.photobucket.com/albums/j10/ultimaomegacloud/CloakSoundfile.jpg

What I did was copy and pasted the script exactly how you put on your post. Then I changed playsound stealth to playsound cloak. Saved the script loaded up the game unequipped the Armour then reequipped it. The Online.Wav file played fine. But when I activated sneak mode nothing played so last nite I thought I'd try something. I went off using part of the script I used before for Online.Wav and if player.isSneaking == 1.

short DoOnce

begin OnEquip Player
if player.isSneaking == 1
playsound Online
set DoOnce to 1
endif
end.


But when I did that and activated sneak mode the Cloak.Wav file played but constantly and the sound played like it was looping nonstop but not finishing only saying cloaaaaaaakkkkkkkk eeeeennnnggggaaaagggggggeeedddd over and over. Until I left sneak mode. Then I tried it with if DoOnce == 0 in the script. Then after I saved and loaded the game when I would save my game would crash my vid card some reason and the screen would stay back.

I'm hoping a defrag fixes that problem and I removed the Script. But after my game would crash the vid card I would have to turn off my pc using the power button on the tower. But when I went to load the game save that had crashed the game would lock up. Not sure exactly why as I never had this problem until I tried that script I tried to make hehe.



Edit: In another topic I posted about a set scale script & no knockdown script Cipscis and Bonedog posted scripts about Playsound Cloak as well. I tried both those scripts as well & the one Cipscis posted works like a dream with no problems.So now I just need to find a script that won't allow stuff to knock me down hehe. Then I'll be set with my walking tank Armour lol.


Here's the Script int bSneaking

Begin GameMode

if player.IsSneaking != bSneaking
set bSneaking to player.IsSneaking
if bSneaking
PlaySound Cloak
endif
endif

End

Thanks again to Ripple, Cipscis, Bonedog and to anyone else I may have forgotten that helped as well.
User avatar
Nick Jase Mason
 
Posts: 3432
Joined: Sun Jul 29, 2007 1:23 am


Return to Fallout 3