Game Development Community

CH3 3D Audio problem

by Marek Krzeminski · in Torque Game Engine · 05/09/2007 (6:27 am) · 5 replies

I'm making my way through the book and I am using TGE v1.5.1 Up until now I've been able to figure out how to make things work, but when I got to the part with the 3D audio in Chapter 3 I can't get it to work.

When I call exec("./myGame/animaudio.cs"); I get the following error:

Object 'AudioDefaultLooping3d' is not a member of the 'AudioDescription' data block class.

Also when I run %ms = InsertTestEmitter();

I get this in the console window:
Inserting Audio Emitter 1453
AudioEmitter::update: failed to create source!
AudioEmitter::onAdd: client failed initial update!

Anyone know how to fix this? I'm guessing something changed in the AudioEmitter() class between the version of TGE that I am using and the version that is used in the book

#1
05/09/2007 (6:28 am)
Oh, btw, what is the difference between:

exec("./myGame/file.cs");
and
exec("~/myGame/file.cs");

I understand that the ./ notation means look in the current path, but what does the ~/ mean?
#2
05/09/2007 (6:39 am)
Hi,

The "~" represents the mod folder. E.g. instead of writing "starter.fps/server/scripts/someScript.cs" you can use the "~" symbol to represent the mod folder - "~/server/scripts/someScript.cs"

As for your audio problems, it seems to me you're missing the audio description. The default audio descriptions are typically stored in server/scripts/audioProfiles.cs.
datablock AudioDescription(AudioDefaultLooping3d)
{
   volume   = 1.0;
   isLooping= true;

   is3D     = true;
   ReferenceDistance= 20.0;
   MaxDistance= 100.0;
   type     = $SimAudioType;
};

I'd have to see the script/function in question to answer the rest of your problem.
#3
05/09/2007 (7:53 am)
www.marek-knows.com/Misc/Files.jpgThese are all the files that I have included in my project. Where would I find audioProfiles.cs to copy to my project? Where should I put it once I do copy it into my project?
#4
05/09/2007 (8:02 am)
In the stock Torque SDK download the audioProfiles.cs file that you want (there's a few) is located in "starter.fps/server/scripts".

That's a little different to the structure I'm used to. To hazard a guess, I would say place it in "GameOne/server" and execute it from "GameOne/server/game.cs".
#5
05/09/2007 (8:28 am)
Hmm, I tried that but it didn't help.

How do I know what files I need to make the game work? I've been trying to figure out the "structure" of torque for the past month but I haven't found anything yet that gives me a good explanation of what is what.

for example, when I installed torque v1.5.1 I have a bunch of directories (and files) on my hard drive.:

bin //I know what this is for
doc //don't know how to use this
engine //I guess this is the c++ source code?
example //this folder really confuses me
lib //libraries needed when using c++ code?
mk //make files I think
tools //I think I know what this is for
vc6 //I think I know what this is for
vc7 //I think I know what this is for
vs2005 //I think I know what this is for
xcode //is this for linux?

Now going into the example folder, I have:
common
creator
demo
show
starter.fps
starter.racing
tutorial.base
(bunch of files here including some dll's and torqueDemo.exe)

Can someone tell me what each of these folders are for, and what ones are required when making my own game from scratch. ie I want to take something that works, and start building on top of it, using the 3D game programming all in one book.

I tried copying the files shown in my previous post but it appears I am missing a bunch of files.