Game Development Community

TX2D 3.1.5 Beta - Sound Distance Error - Resolved

by Will O-Reagan · in Torque X 2D · 06/07/2010 (9:55 pm) · 2 replies

Build: 3.1.5 Beta.

Platform: Windows or Xbox 360

Target: In Game, Windows or Xbox 360

Issues: Game throws error when setting sound Distance variable. Its probably a bug, because distance variables are clamped by XNA I think, and this worked before the update.

Steps to Repeat:
1. Start new "PlatformerDemo" Project
2. Right Click on starter demo solution, add project, Add 3.15 Pro, no GUI
3. Change references to from TXCore and TX2D, to the 3.15 core and TX2D
4. Run program, and find a "Drill actor", soon an error will occur where the distance variable thrown. (possibly on killing the drill actor, or it falling into water or something.)


Suggested Fix: Modify drill actor

About the author

I have a degree in dramatic art, and literature, from UC Santa Barbara. I've worked for a few studios, also at Animax Ent in 2008, and some smaller studios. Currently studying Computer Science at CSU Channel Islands.


#1
06/08/2010 (9:08 am)
We have already fixed this bug and it will ship with new installers at the end of the month. Until then here is the fix:

In DrillActorComponent change the following

Line 31
From:
if(motorSound != null)
To:
if(motorSound != null && motorSound.IsPlaying)

Make the same change on line 40

Then on line 85
From:
if (motorSound != null)
_motorSound.Stop(AudioStopOptions.AsAuthored);
To:
if (motorSound != null)
{
if (_motorSound.IsPlaying)
_motorSound.Stop(AudioStopOptions.AsAuthored);

_motorSound = null;
}
#2
06/08/2010 (9:38 am)
Ok that works, I needed to make those changes anyways for some of my other functions to work with the drill.