Game Development Community

AudioProfiles and Behaviors

by WesTT · in Torque Game Builder · 01/06/2008 (7:58 pm) · 4 replies

Hi all,

Joe Rossi has a pretty neat behavior on the TDN that allows one to setup an AudioProfile/Description from within the editor using t2dSceneObject and a behavior, you can then specify this object in a behaviour.

So, is it not possible to use AudioProfiles directly within behaviors? I have done a search and could not find anything, this functionality would make using AudioProfiles more convenient.

Cheers

#1
01/06/2008 (10:13 pm)
Hi ToadTrip. Yes you can use them within behaviors, but there are "gotchas" I found to setting it up right. Since objects and their behaviors are loaded in the order of the scene Object Tree, you have to make sure the t2DSceneObject containing your AudioProfiles is at the top of your Object Tree, or at least above any object making use of those profiles.

Likewise, any AudioProfile referencing AudioDescriptions made with these behaviors must either have the AudioDescription behavior above them in that sceneObject behavior list, because behaviors are also loaded in their list order from top to bottom. As a better option, you can have an object containing the AudioDescriptions placed above the AudioProfile object in the Object Tree. Remember they can each have a ton of behaviors attached to them, so for most scenes you should only need one of each object (one AudioDescription and one AudioProfile container ) to handle all of your audio.

Due to the way things are loaded in TGB, I don't think there is any way around this.

So to recap, the project object tree should look like this:
- Object containing your AudioDescription Behaviors
- Object containing your AudioProfile Behaviors
- Other objects that can now use those profiles/descriptions...

I'm not sure if there's a way to reorder objects in the tree list, if there is I'd like to know because it would make these behaviors easier to use.

Hope this helps!

* For future reference I have updated the behavior pages on TDN to include this information.
#2
01/07/2008 (4:11 pm)
To allow reordering of the Object Tree, you'll need a pro version.
Open your tgb\tools\levelEditor\scripts\forms\sideBar\sideBarTreeView.ed.cs
Find the function LevelBuilderSceneTreeView::onWake
Add this line somewhere in that function:
%this.mouseDragging=1;

I think this should be in stock TGB, because the order of objects in this list is important when it comes to multiple behaviors working together properly.
#3
01/07/2008 (9:58 pm)
Thanks Joe, great enhancement.
#4
01/08/2008 (2:10 am)
Hi Joe, Michael,

@Joe: Thanks for the info, however I solved my problem by simply allowing the name of the profile to be used for that behavior to be entered in a text box. I've decided to simply edit my profiles as needed in code, it would be great if this stuff was part of stock TGB though.

Still, I agree, you've made a great work around and I'll probably use it at a future date.