Sound Effect Failure on Cell Load

Post » Tue Jul 02, 2013 10:20 pm

Here is a curious issue involving sound effects on activators. I wonder if somebody might have any insights on it.

The scenario is this:

ObjectA pre-exists in the exterior game world, in the same cell as a door connecting with an interior cell.

Whenever the cell is attached, ObjectA is supposed to be accompanied by ActivatorB with a looping sound effect, and for this purpose ObjectA has the following script:
EVENT OnCellAttach()	if RefPointer		RefPointer.DisableNoWait()		RefPointer.Delete()	endif	RefPointer = PlaceAtMe(ActivatorB)endEVENTEVENT OnCellDetach()	if RefPointer		RefPointer.DisableNoWait()		RefPointer.Delete()		RefPointer = None	endifendEVENT
The problem is, that if one enters the exterior cell from an interior cell through the load door, the sound effect on ActivatorB fails although the activator itself appears as expected. The issue seems to be particular to the kind of cell loading that happens when moving through a load door; if one moves about in the exterior world so that the cell becomes re-attached, the sound effect will appear.

One way to work around the issue seems to be not to attach the sound effect directly to ActivatorB in the CK, but to script it on the activator with a delay like this:
EVENT OnLoad()	Utility.Wait(0.5)	;This amount of delay seems to work for me	SoundEffect.Play(Self)endEVENT
An alternative workaround could be to place ActivatorB intially in a disabled state and enable it with a delay, but that would introduce a delayed appearance in addition to delayed sound, plus it does not seem to work as reliably.

As an additional observation, a long time ago I had noticed an issue that could well be related: If you pick up the nirnroot under the bridge to the NE from Honningbrew Meadery and enter the meadery to stay there until the surrounding exterior cell resets, then when you go check the nirnroot immediately after it has respawned, it is silent. Apparently, the sound effect on a freshly re-enabled pre-existing activator (the nirnroot) also fails to play in similar circumstances.

I would initially guess, that the issue may be caused by the system being too busy during cell loading to fetch the right sound file. However, I am not entirely sure about it, as I seem to be able to hear a very soft version of the sound effect in the background when using very short delays, although I could just as well be imagining that.

P.S. I am not too happy with the explicit delay in the workaround, as the required amount may be system or situation specific. If only there were an event like OnHavingSettledDownAndGottenReadyForSomeWildAndCrazyNewStuff(). :smile:
User avatar
Kate Norris
 
Posts: 3373
Joined: Mon Nov 27, 2006 6:12 pm

Post » Tue Jul 02, 2013 6:33 pm

Try this in your attached script:

EVENT OnLoad()	While !Is3DLoaded()		Utility.Wait(0.01)	EndWhile	SoundEffect.Play(Self)endEVENT
User avatar
Lou
 
Posts: 3518
Joined: Wed Aug 23, 2006 6:56 pm


Return to V - Skyrim