Jump to content

Adding a Looping Idle sound to Armor


muilezel666

Recommended Posts

Alright, I thought it'd be pretty easy to add a looping idle sound to a piece of armor using the GECK but I didn't see any way to easily add one without using a script, and as I haven't done any scripting before I'm trying to just copy existing code over and hope for the best. This is what I've tried doing, feel free to laugh:

 

I basically just want the sound to be enabled when I equip the armor and keep it looping, just like when you equip the Flamer and you hear the looping noise continually but unfortunately unlike Weapons I don't know how to add a sound the easy way. If I add a sound by using a Animation Enum Sound Template I can only hear the idle sound when walking, running or stealthing and it will overlap the sound all the time depending on how often you set the chance for the sound to play. Unfortunately I couldn't find any existing armor in the game with just idle sounds added to them either.

 

Thanks in advance.

Edited by muilezel666
Link to comment
Share on other sites

So after digging some more into it I got the script working that adds a looping sound to the armor when equipped. However I tried using the command soundstop (which is not a command apparently) to stop the looping sound when the armor is unequipped.

 

scn NEWArmorIdleScript

 

int iEquipped

 

begin OnEquip player

playsound FOLNEWArmorIdle

player.AddSpell NEWArmorIdleActual

set iEquipped to 1

end

 

;begin onUnequip player

; soundstop FOLNEWArmorIdle

; player.RemoveSpell NEWArmorIdleActual

;end

 

begin GameMode

if iEquipped == 1 && Player.GetEquippedrId NEWArmorIdle == 0

player.RemoveSpell NEWArmorIdleActual

set iEquipped to 0

endif

end

 

Apart from not knowing how to stop an actual sound from playing when you unequip the armor, I also do not know the command for it. Maybe I should use a non-looping soundfile and use a script command to make the sound loop instead, then use onUnequip command to stop the loop?

Edited by muilezel666
Link to comment
Share on other sites

  • 5 years later...

I managed to make sound "follow" the player when they equip armor ( a helmet), so to speak, through a timer quest in Boom to the Moon. The problem with sounds is that you can start them with PlaySound but there is no StopSound-kinda command, so you need to get creative with this.

 

So, to give you an idea, when the player equips the helmet it starts a quest...

 

(pls don't judge my scripts, I am not an expert)

 

 

 

scn aaaMoonBreathEffectScript ;manages the breathing sound effect from the space helmet
;added waterbreathing in v2, copied from vanilla rebreather script

int iEquipped

begin OnEquip Player
StartQuest aaaMoonBreathEffectQuest ;the timer quest that actually plays the sound starts
iMod aaaMoonHelmetISFX ;blurry vision is on
player.AddSpell VMS15WaterBreathingActual ;v2 only - add waterbreathing effect from rebreather
set iEquipped to 1 ;int to check that player now has waterbreathing
end

begin OnUnequip Player
StopQuest aaaMoonBreathEffectQuest ;noisy quest is stopped
riMod aaaMoonHelmetISFX ;blurry vision is off
end

begin GameMode
if iEquipped == 1 && Player.GetEquipped aaaMoonSpaceSuitHelmet == 0 ;if the player does not have the helmet...
player.RemoveSpell VMS15WaterBreathingActual ;disable waterbreathing
set iEquipped to 0
endif
end

 

 

 

And the quest has this script attached to it.

 

 

 

scn aaaMoonBreathQuestScript ; Quest that handles the sound effect from the fishbowl helmet. A repeating timer because there is no way to stop a looping sound
; (such as when the player removes the helmet - using PlaySound would play it forever even when the helmet is off). So the sound
; does not loop - the timer plays it every two seconds instead.

Float Timer

Begin Gamemode
;;;;;;;;;; when timer is counting...
if Player.GetInWorldspace aaaMoon && (Timer <2) ; for some reason I set it to run on the new worldspace only. Can't remember why right now, but
set timer to timer + GetSecondsPassed ; it will happen on Earth too. Feature, not a bug! I made this script like, half a year ago... if it ain't broke...
Else ;;;;;;; once timer counts to 2...
playsound aaaMoonBreathSoundFX ; play breath sound
Set timer to 0 ; restart timer
Endif

End

 

 

 

So, to get back to your question, you'd probably have to make a quest with a GameMode script to check if your weather is on, and if so, add rads to the player and play the ticking sound from the geiger counter. I think that one loops by default so you'd have to make a copy of it in the GECK and untick the looping checkbox :smile:

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...