Game Development Community

Whack-A-Mole Error when Running Outside of Editor

by Doug Linley · in Torque Game Builder · 06/26/2006 (7:04 pm) · 10 replies

I just finished the Whack-A-Mole tutorial and I wanted to set it up to run from outside of the editor. But whenever I fire it up from within Torsion, I get the following error scrolling in the console:

WhackAMole/gameScripts/moleLevel.cs (0): Unable to find object: 'molehammer' attempting to call function 'setPosition'

molehammer is set up as the "Name" in the "Scripting" portion for the hammer animation in the editor.

the game works fine from within the editor, but I was hoping to try to go through what it would be like to create a release to see what that would be like.

Thanks!

#1
06/27/2006 (12:17 am)
Do you get any other errors before this one? Missing image files for example?
#2
06/27/2006 (3:48 am)
No other errors. I loaded up the ExampleWhackAMole that comes with TGB Pro, and ran it and it does the same thing. Here is what the error log looks like.

Torque Game Builder (v1.1.0) initialized...
Loading compiled script ExampleWhackAMole/main.cs.
Loading compiled script ExampleWhackAMole/managed/resources.cs.
Loading compiled script resources/moleArt/resourceDatabase.cs.
Loading compiled script ExampleWhackAMole/managed/datablocks.cs.
Loading compiled script ExampleWhackAMole/managed/persistent.cs.
Loading compiled script ExampleWhackAMole/gui/mainScreen.gui.
Loading compiled script ExampleWhackAMole/gameScripts/game.cs.
Loading compiled script ExampleWhackAMole/gameScripts/respawnPoint.cs.
Loading compiled script ExampleWhackAMole/gameScripts/mole.cs.
Loading compiled script ExampleWhackAMole/gameScripts/moleLevel.cs.
Loading compiled script ExampleWhackAMole/gui/endScreen.gui.
ExampleWhackAMole/gameScripts/moleLevel.cs (0): Unable to find object: 'molehammer' attempting to call function 'setPosition'
ExampleWhackAMole/gameScripts/moleLevel.cs (0): Unable to find object: 'molehammer' attempting to call function 'setPosition'
ExampleWhackAMole/gameScripts/moleLevel.cs (0): Unable to find object: 'molehammer' attempting to call function 'setPosition'
ExampleWhackAMole/gameScripts/moleLevel.cs (0): Unable to find object: 'molehammer' attempting to call function 'setPosition'
ExampleWhackAMole/gameScripts/moleLevel.cs (0): Unable to find object: 'molehammer' attempting to call function 'setPosition'
ExampleWhackAMole/gameScripts/moleLevel.cs (0): Unable to find object: 'molehammer' attempting to call function 'setPosition'
ExampleWhackAMole/gameScripts/moleLevel.cs (0): Unable to find object: 'molehammer' attempting to call function 'setPosition'
ExampleWhackAMole/gameScripts/moleLevel.cs (0): Unable to find object: 'molehammer' attempting to call function 'setPosition'
ExampleWhackAMole/gameScripts/moleLevel.cs (0): Unable to find object: 'molehammer' attempting to call function 'setPosition'
ExampleWhackAMole/gameScripts/moleLevel.cs (0): Unable to find object: 'molehammer' attempting to call function 'setPosition'
ExampleWhackAMole/gameScripts/moleLevel.cs (0): Unable to find object: 'molehammer' attempting to call function 'setPosition'
ExampleWhackAMole/gameScripts/moleLevel.cs (0): Unable to find object: 'molehammer' attempting to call function 'setPosition'
#3
06/27/2006 (4:25 am)
Maybe the level does not get loaded. If you copy over the level file by hand do you still get the error?
And in your mod directories main.cs in initializeProject() be sure that the right level is load at the end of the function.
#4
06/27/2006 (6:51 am)
Thanks Michael. I'll give this another look tonight.
#5
06/27/2006 (7:42 am)
Okay. I tried loading that level specifically. that didn't work. As you can see in the screenshot, there was no error saying the file didn't load. But I'm still getting the molehammer error. This is with the example that comes with TGB Pro.

www.cabalgames.com/images/error.png
Thanks for all of your help.
#6
06/27/2006 (8:00 am)
Try to copy the level1.t2d and delete level1.t2d.dso. If that doesn't work either could you please post your level1.t2d?
#7
06/27/2006 (8:27 am)
Michael,

I'm a little confused as to where you want me to copy level1.t2d? It's currently in the ExampleWhackAMole/data/levels/ folder. I just looked and there is no .dso, so is it possible that it wouldn't load the level yet wouldn't throw an error in the console?

By the way, if you have TGB 1.1.0, then you already have a copy of level1.t2d. All I'm trying to do is get the ExampleWhackAMole game that comes with TGB to run outside of the level editor. Thanks again.
#8
06/27/2006 (9:05 am)
Okay I changed the path to point to ~/data/levels/Level1.t2d and now I get this error:

Error loading level ~/data/levels/Level1.t2d. Invalid file.

Perhaps there is something about loading levels that I'm just not understanding. I've gone through the reference documentation and looked at all of the tutorials and I don't see anything about this seemingly basic functionality.
#9
06/27/2006 (9:26 am)
For some reason the startGame function is very picky. It needs to be in the form of startGame("ExampleWhackAMole/data/levels/level1.t2d");
#10
06/27/2006 (9:41 am)
I was just coming here to post that. :)

Thanks again Mike and Michael. You're help is greatly appreciated.