Jump to content

Random Sound Script


octodecoy

Recommended Posts

I don't know much about scripting but am trying to get into it. I want to make a script that plays various sounds at random. In order to trigger them, does it have to be attached to a object/marker as a trigger, or is there any way to just use the player as the origin and have the sounds play at random (and also possibly limit it to exteriors)? If I go the non-scripted route, and attach to region, the conditions I want to use (stuff like "GetSecondsPassed" or maybe GetRandomPercent") won't work, and am stuck using the region chance. Any help is appreciated, thanks!

Link to comment
Share on other sites

I think the sound descriptor supports random sounds out of the box. Eg. a sound descriptor can point to many sounds/wav files in one descriptor and the engine will chose randomly from the list each time the sound descriptor is played. Try 'footsteps' or something similar in the sound descriptor category to see how it is set up. See the sound descriptor documentation.

 

You could use a trigger box with a script for example and I think there is a default (search for 'default' / 'sound' in the script selector) script in the vanilla game for this.

 

For a non-trigger solution / something that plays at random, I think you have to set up a background quest or use a magic effect with a custom timer script etc.

 

There is a condition function and a Papyrus function named something like IsInInterior() that can be used for testing whether the subject is in an interior/exterior.

Link to comment
Share on other sites

To play a random sound you will need to use a script.

 

Attaching scripts to new objects is no problem, but existing world objects is a total pain unless your happy modifying base game assets with all the compatibility and conflict baggage.

 

To run a player centric script, attach a script to the player through a start game enabled quest alias which can respond to dynamic player events like OnLocationChange.

 

To run a pure random timer script attach a script to a start game enabled quest.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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