Game Development Community

Compiler Error After Adding Audio [RESOLVED]

by Randy Lutcavich · in Torque X 2D · 09/07/2009 (7:19 am) · 23 replies

I'm attempting to add audio to my game. To start I just followed John's tutorial in chapter 15.

Everything seemed to go well but I am getting a compiler error that stops the game from running successfully.

Error 1 The command "if "x86"=="x86" "C:UsersRandyDocumentsVisual Studio 2008ProjectsDots 1.0Dots 1.0Gamebinx86DebugStarterGame2D.exe" -exportschema "C:UsersRandyDocumentsVisual Studio 2008ProjectsDots 1.0Dots 1.0Gamemyschema.txschema"
" exited with code -532459699. Game


Has anyone else gotten this before?
Page «Previous 1 2
#1
09/07/2009 (7:22 am)
This also seems to have caused Torque X Builder to crash every time I try to save it now.

The crash is titled: ContentNodeGenerator.exe has stopped working.
#2
09/07/2009 (7:24 am)
My entire project can be downloaded from:

RandysPortfolio.com/Game.zip
#3
09/07/2009 (11:42 am)
yeah, that's a REALLY annoying glitch.

Basically once you get the ContentNodeGenerator glitch, everytime you add something to your scene and hit save you'll get that. Then you have to go into Visual C# and manually add whatever new graphics you added to the solution.

Has this been fixed btw? I'm still on version 3.0.
#4
09/07/2009 (1:46 pm)
I believe the ContentNodeGenerator bug is fixed in the next Torque X release.

John K.
#5
09/07/2009 (4:47 pm)
The contentnode thing came up after adding audio? I had a similar problem, the answer is here:

www.garagegames.com/community/forums/viewthread/96747


Well it worked for me.

#6
09/07/2009 (5:16 pm)
Ah yes, I've just tried this. Did not seem to work on my current project. It could be possible that I missed some files. I'm not so sure I did the tutorial right. There was a questionable spot on page 319 of John's book.

"From within XNA Game Studio, select the project node and right-click the mouse. Select Add > Existing Item. Browse to the new data/sounds directory and select the XactProject.xap file. Set its Build Action property to Content and its Copy to Output Directory to Copy if Newer. ONLY THE .xap FILE NEEDS TO BE ADDED TO THE GAME PROJECT, NOT THE INDIVIDUAL .wav AUDIO FILES.

After you add the GameSounds.xap file to your project, the content pipeline will use this as a reference to your audio files and will automatically build your wave and sound banks in your project when the game project is built.

ENSURE THAT ALL .wav FILES THAT ARE INCLUDED IN YOUR XACT PROJECT HAVE BEEN COPIED TO YOUR GAME'S DATA/SOUND DIRECTORY. If you do not do this, the content pipeline will not be able to find the .wav files to build. Now you are ready to go ahead and rebuild the game project. The next step will be to update the Torque X game code to play back the audio."

If you read the capitalized sentences in the first and third paragraph you will see what looks like a contradiction. First John says to not individually add the .wav files and then he says to do exactly that. Am I just reading this wrong?

I also have trouble with the second paragraph where he says "After you add the GameSounds.xap file to your project"... At this point I had not added GameSounds.xap, I added XactProject.xap as directed in the first paragraph. So because of that sentence I also added the GameSounds.xap but I am unsure why I need both.

I'm gonna roll back to before I started adding audio and then redo John's tutorial with the solution Henry posted above in mind.
#7
09/07/2009 (5:20 pm)
Note, John's tutorial also never said to explicity Build the xact project but I ended up building both .xap files anyways. That may have screwed things up as well.

Should I have not done this? I didn't see the .xsb, .xwb, or the .xgs files until I built the xact projects.

Also, there is a Win and an Xbox folder... all of my files have been going in the Win, I assume this is just because I haven't copied my project to use on the 360 yet.
#8
09/07/2009 (7:57 pm)
I can see that. What I meant was that you physically copy the files under the \data\sounds\ folder on your hard drive. But, only include the .xap file in your Visual Studio Solution.

There should only be one .xap file, the fact that I wrote two names is an error in the book, everything should be GameSounds.xap. Also, building the audio project in XACT is a necessary step.

I'm slowly downloading the project files you posted above, so I may have more comments soon.

John K.
#9
09/07/2009 (8:00 pm)
Thanks for clarifying, John. I actually just redid the tutorial and I realized that was what you meant.

I have a new project now that has only one .xap and I physically included the greeting.wav file.

It is a lot more clean than the one you are downloading now but I still cannot seem to get it to work.

I believe I uploaded the Torque2D and TorqueCore projects with my Game project. If I re-upload just my game project would you be able to run that? It would be a whole lot faster.
#10
09/07/2009 (8:05 pm)
John I am so sorry, that is not the right file at all!

I was a little tired last night when I uploaded that.

I edited the link and here it is again:
RandysPortfolio.com/Game.zip
#11
09/07/2009 (8:11 pm)
My current problem after adding audio:

Error 9 The command "if "x86"=="x86" "C:\Users\Randy\Documents\Visual Studio 2008\Projects\Dots 1.0\Dots 1.0\Game\bin\x86\Debug\StarterGame2D.exe" -exportschema "C:\Users\Randy\Documents\Visual Studio 2008\Projects\Dots 1.0\Dots 1.0\Game\myschema.txschema"
" exited with code -532459699. Game


My TX Builder does not crash any more when saving so the fix must have worked. But the compiler error that I ahve always had is still occurring.

I'm also getting warnings now for all my files that I changed their build action from Compile to Content. I'm not sure this is a problem though.

Warning 2 Project item 'sounds\GameSounds.xap' was not built with the XNA Framework Content Pipeline. Set its Build Action property to Compile to build it. Game
#12
09/07/2009 (8:18 pm)
One last post here...

It works!

I'm such a newb. GameSounds.xap does actually get compiled with the code! All the other sound files needed their Build Action set to content.

Thank you guys for the help!! Its nice to see things are starting to come together.
#13
09/07/2009 (8:33 pm)
For the first error, try removing the custom build step. Right-click the Game project, then select Properties, then go to the Build Events tab. Copy the Post-Build event step from the text window and save it for later to a file. Then clear the box completely (select all, press delete key, then backspace, delete key again) Visual Studio is really picky about this fields being empty, otherwise an 'empty build task' error is generated.

Next, make sure that all folders and files under the Content\sounds folder in the Solution Explorer are 'excluded from the project'. Right-click everything except for GameSounds.xap and exclude them.

Next, select the GameSounds.xap and then go to the Properties tab. Change the Build Action from Content to Compile. That should get you back on track.

John K.
www.envygames.com
#14
09/07/2009 (8:34 pm)
Looks like you beat me to it ;)

John K.
www.envygames.com
#15
09/07/2009 (8:36 pm)
More problems :(

Let me read over your post before I get into them though.
#16
09/07/2009 (8:45 pm)
Alright so my ContentNodeGenerator.exe has stopped working again.

How do you usually handle this bug John? My sound files are now excluded like you mentioned above but for some reason my TxB still crashes when I attempt to save.
#17
09/07/2009 (8:45 pm)
One more thing (after running your sample project). You need to change these lines in the Game.cs file
_waveBank = new WaveBank(Engine.SFXDevice, @"datasoundsWave Bank.xwb");
_soundBank = new SoundBank(Engine.SFXDevice, @"datasoundsSound Bank.xsb");

Remove "Win" from the path, that's already spelled out within XACT3, see the bottom, left side for the platform-specific path designation.

John K.
www.envygames.com
#18
09/07/2009 (8:54 pm)
Ah yes, I corrected that one a bit ago. Good catch!

So, I guess I don't really have any more serious problems at the moment because TxB is actually saving even though it is getting the ContentNodeGenerator.exe error.
#19
09/07/2009 (11:21 pm)
That's an annoying, but known issue that should be gone in the next Torque X release.

John K.
#20
09/07/2009 (11:29 pm)
Cool thanks. Glad to not be alone.

Do you know why I can't setup audio in any class other than Game?

// perform your custom screen-activation tasks
            //load the sounds
            _waveBank = new WaveBank(Engine.SFXDevice, @"data\sounds\Wave Bank.xwb");
            _soundBank = new SoundBank(Engine.SFXDevice, @"data\sounds\Sound Bank.xsb");
            _backgroundCue = _soundBank.GetCue("TWYGTSIB");

            if (!Game._backgroundCue.IsPlaying)
                _backgroundCue.Play();

I have the above code in my GuiMainMenu.cs file and it doesn't recognize 'Engine'.

Error 8 The name 'Engine' does not exist in the current context C:\Users\Randy\Documents\Visual Studio 2008\Projects\Dots 1.0\Dots 1.0\Game\GuiMainMenu.cs 58 41 Game

Is it because this class does not inherit from TorqueGame?
Page «Previous 1 2