PapaLegaBooboo Posted June 12, 2021 Share Posted June 12, 2021 Please tell me that a stopsound command is available for Oblivion. I have a script running that plays a sound when an object is activated, but I would like to stop the sound when another object is activated. However, I see no command of the sort that exists for Oblivion, which is completely ignorant because such a command exists for Morrowind. Are there any other ways? Link to comment Share on other sites More sharing options...
Striker879 Posted June 12, 2021 Share Posted June 12, 2021 Couldn't find any confirmation, but I think that problem is addressed by Wrye Bash (perhaps part of the Tweak Assorted option when building a bashed patch). Another option is Duke Patricks Basic Script Effect Silencer (don't use that myself, so I can't say much about it). Link to comment Share on other sites More sharing options...
Stealth21 Posted June 13, 2021 Share Posted June 13, 2021 I was investigating that question too, and I remember and used that function for the Morrowind modding. Alas, I did not find the related function for the Oblivion, only the function to get the sound played, not to stop some of them. And me too was searching that for the magic effect silence together with "silencing" the lights and the effects of the cast.The solution I found is to create either quest-script or ability spell script. In this script it will remove(replace to nulled) the sounds and the effects for the magic effect of the spell you are cerating it for. It will be doing that in the "GetPlayerSpell" check in case if this check is equal to the spell selected by the player you are creating this script for.In case if you will choose the way of quest-script, you will also need to obtain how to change it's execute time to the lowest value. Link to comment Share on other sites More sharing options...
glowplug Posted June 13, 2021 Share Posted June 13, 2021 The simplest way I've found is to drop sound object(s) at the location(s) then enable/disable them as required using GameMode, Trigger or Activator. There is an example of this in my mod Harodich, at the north east littoral cave on kvSubActivator02 which activates the submarine saying goodbye. scn kvSubActivator02Script int iActivated int iGoodbye float fTimer ref refGoodbye begin onActivate if isActionRef playerRef && iActivated == 0 let iActivated := 1 let fTimer := 1.5 let iGoodbye += 1 if iGoodbye == 1 let refGoodbye := kvSubGoodbye01Ref elseif iGoodbye == 2 let refGoodbye := kvSubGoodbye02Ref elseif iGoodbye == 3 let refGoodbye := kvSubGoodbye03Ref else let refGoodbye := kvSubGoodbye04Ref let iGoodbye := 0 endif refGoodbye.enable endif end begin gameMode if iActivated let fTimer -= getSecondsPassed if fTimer <= 0 let iActivated := 0 refGoodbye.disable endif endif end This hard code increments which sound file to enable as 'rand' can repeat over on 3 or larger numbers divided.Even by Ref variable, this will disable which is what you asked for.If, by using OBSE, you want to pass the sound file to a function as a Ref variable then it won't work. PS I packed all the sound files with silence to 1.5 seconds. Link to comment Share on other sites More sharing options...
DavaScript Posted June 13, 2021 Share Posted June 13, 2021 (edited) The simplest way I've found is to drop sound object(s) at the location(s) then enable/disable them as required using GameMode, Trigger or Activator. There is an example of this in my mod Harodich, at the north east littoral cave on kvSubActivator02 which activates the submarine saying goodbye. scn kvSubActivator02Script int iActivated int iGoodbye float fTimer ref refGoodbye begin onActivate if isActionRef playerRef && iActivated == 0 let iActivated := 1 let fTimer := 1.5 let iGoodbye += 1 if iGoodbye == 1 let refGoodbye := kvSubGoodbye01Ref elseif iGoodbye == 2 let refGoodbye := kvSubGoodbye02Ref elseif iGoodbye == 3 let refGoodbye := kvSubGoodbye03Ref else let refGoodbye := kvSubGoodbye04Ref let iGoodbye := 0 endif refGoodbye.enable endif end begin gameMode if iActivated let fTimer -= getSecondsPassed if fTimer <= 0 let iActivated := 0 refGoodbye.disable endif endif end This hard code increments which sound file to enable as 'rand' can repeat over on 3 or larger numbers divided.Even by Ref variable, this will disable which is what you asked for.If, by using OBSE, you want to pass the sound file to a function as a Ref variable then it won't work. PS I packed all the sound files with silence to 1.5 seconds. So the sound files that you are using are 'kvSubGoodbye01Ref', etc. And you are enabling and disabling them with 'refGoodbye.enable/disable'? Edited June 13, 2021 by DavaScript Link to comment Share on other sites More sharing options...
glowplug Posted June 13, 2021 Share Posted June 13, 2021 Yes. If there were only 1 sound object then there would be no need to set a 'ref' variable, just hard code it. Link to comment Share on other sites More sharing options...
PapaLegaBooboo Posted June 13, 2021 Author Share Posted June 13, 2021 (edited) The simplest way I've found is to drop sound object(s) at the location(s) then enable/disable them as required using GameMode, Trigger or Activator. There is an example of this in my mod Harodich, at the north east littoral cave on kvSubActivator02 which activates the submarine saying goodbye. scn kvSubActivator02Script int iActivated int iGoodbye float fTimer ref refGoodbye begin onActivate if isActionRef playerRef && iActivated == 0 let iActivated := 1 let fTimer := 1.5 let iGoodbye += 1 if iGoodbye == 1 let refGoodbye := kvSubGoodbye01Ref elseif iGoodbye == 2 let refGoodbye := kvSubGoodbye02Ref elseif iGoodbye == 3 let refGoodbye := kvSubGoodbye03Ref else let refGoodbye := kvSubGoodbye04Ref let iGoodbye := 0 endif refGoodbye.enable endif end begin gameMode if iActivated let fTimer -= getSecondsPassed if fTimer <= 0 let iActivated := 0 refGoodbye.disable endif endif end This hard code increments which sound file to enable as 'rand' can repeat over on 3 or larger numbers divided.Even by Ref variable, this will disable which is what you asked for.If, by using OBSE, you want to pass the sound file to a function as a Ref variable then it won't work. PS I packed all the sound files with silence to 1.5 seconds. How do you make a sound object? This is what I have but no sound is playing: ref pSound Begin onactivate if (player.IsInAir) let pSound := testsound ;This sound is defined in Misc/sounds tab in the object window. pSound.enable else pSound.disable endif end Edited June 13, 2021 by PapaLegaBooboo Link to comment Share on other sites More sharing options...
glowplug Posted June 14, 2021 Share Posted June 14, 2021 Hmm, I feel the Object Window should have been called something like Assets or File Management. I'll refer to these as File to keep things simple.PlaySound runs the Sound File but as we've found, there is no StopSound to unload the Sound File - we need an instantiated Sound Object then enable/disable to achieve the same result.In short drag'n'drop the Sound File from Misc/Sounds to the Render Window, wherever you need it, to create an actual Sound Object . double-click the Sound Object in the Render Window to open the Reference editor. Type in a Reference Editor ID (example mySound01Ref). Persistent Reference ticked (so the engine can find mySound01Ref). Initially Disabled ticked (unless it starts out playing).As you are using different Activator Objects to Play (enable) and Stop (disable) they each need their own script (the 'else' is just for example). scn mySound01EnableScript begin onActivate if mySound01Ref.getDisabled == 1 mySound01Ref.enable else message "The sound is already playing." endif end scn mySound01DisableScript begin onActivate if mySound01Ref.getDisabled == 0 mySound01Ref.disable else message "The sound wasn't playing - what do you want?" endif end Here is a working example - the entry door is at the main gate in Anvil. Link to comment Share on other sites More sharing options...
PapaLegaBooboo Posted June 14, 2021 Author Share Posted June 14, 2021 Hmm, I feel the Object Window should have been called something like Assets or File Management. I'll refer to these as File to keep things simple. PlaySound runs the Sound File but as we've found, there is no StopSound to unload the Sound File - we need an instantiated Sound Object then enable/disable to achieve the same result. In short drag'n'drop the Sound File from Misc/Sounds to the Render Window, wherever you need it, to create an actual Sound Object . double-click the Sound Object in the Render Window to open the Reference editor. Type in a Reference Editor ID (example mySound01Ref). Persistent Reference ticked (so the engine can find mySound01Ref). Initially Disabled ticked (unless it starts out playing).As you are using different Activator Objects to Play (enable) and Stop (disable) they each need their own script (the 'else' is just for example). scn mySound01EnableScript begin onActivate if mySound01Ref.getDisabled == 1 mySound01Ref.enable else message "The sound is already playing." endif end scn mySound01DisableScript begin onActivate if mySound01Ref.getDisabled == 0 mySound01Ref.disable else message "The sound wasn't playing - what do you want?" endif end Here is a working example - the entry door is at the main gate in Anvil. Thank you, I got it to work! Is it possible to dynamically place a sound object at the player, let's say, when I'm standing still? Link to comment Share on other sites More sharing options...
glowplug Posted June 15, 2021 Share Posted June 15, 2021 MoveTo, PositionCell, PositionWorld don't work on an instantiated Sound Object.We can put an Activator with required Loop Sound out of earshot such as a utilities interior - move it to/from player as required.A problem is that it requires an Activator per Sound which takes up Save Game space.A solution would be to use OBSE SetLoopSound but it does not seem to work - I'll post on that. Link to comment Share on other sites More sharing options...
Recommended Posts