Game Development Community

Just bought the kit

by Stephen Adkins · in TGB Platformer Kit · 02/14/2009 (2:16 pm) · 31 replies

And pretty new to TorqueBuilder in the first place. But, I have a question. I'm trying to run the complete project that is included and while it loads up, when I click on single player, the player's model (dragon) just hangs there. When I open the debug console, I see addComponents - Invalid Component Object "0" and then SpawnPointBehavior.cs (40) Unable to instantiate non-conobject class pskSpawnPoint. I then see these later, but they are probably due to the above. TrampolineBehavior must be added to a platform! in PlatformBehavior.cs (33) and GameMethods.cs (125)

I'm not sure if this is related, but while I was working through the tutorial, I got to the part where you have to add PlatformObject behaviors to two scene objects. But, my drop down list of behaviors is empty, even though they are in the Behavior sub folder.

TB is version 1.7.4, btw.

Any help would be appreciated

About the author

Recent Threads

Page «Previous 1 2
#1
02/14/2009 (2:46 pm)
The binary files are included with the kit, but they do not replace your existing executables. They are located in "<Install Dir>/PlatformerStarterKit/Binaries/".

You will need to copy the files to your project directory then open them up.
#2
02/14/2009 (5:05 pm)
So I can't go into C:\Program Files (x86)\GarageGames\TorqueGameBuilder-1.7.4\games\PlatformerDemo and load up that project and run it?
#3
02/14/2009 (7:26 pm)
You will need to use the exe files provided with the kit to load the project properly.

Just copy the DLL files and the EXE files to your project directory.
#4
02/14/2009 (7:57 pm)
Ok, I got it to work. I'm not sure why I had to do what I did though. I had to create my project and use the Platform Kit as a template, then drop those files into my Projects/game directory and then it would run. If I was one level up, console.log said I had an endless loop on main.cs and game/main.cs.

Any, on to running through the tutorial and making something.

Thanks. :)
#5
02/15/2009 (12:36 pm)
Well, I figured out why the behaviors wouldn't show up. When I create a new project and select Platform as the template, I get <Project Dir>/game/game/behaviors. I had to grab that second game dir and move it up one level.
#6
02/15/2009 (1:26 pm)
Now I have another problem. (Most likely due to the above file location issue). I put the DragonIdleAnimation into my scene. I added the SpawnPoint behavior, but DragonTemplate isn't a choice. Actually, none is the only choice, but I can see DragonTemplate down in the Scripting Config Datablock.
#7
02/15/2009 (2:05 pm)
This is a problem with the editor itself, it doesn't like to use external datablocks. The workaround is a little hacky, but you will need to modify the "<ProjectDir>/game/gamescripts/datablocks.cs" file to something like this:

// Add this to the top of the file
if (isObject(DragonTemplate)) DragonTemplate.delete();

// Add this after the datablock is created
$managedDatablockSet.add(DragonTemplate);

Be sure to check out the 1.0-1.1 upgrade guide. I haven't yet updated the original tutorial.
#8
02/15/2009 (2:12 pm)
I found that in another thread. If I do that, it is now a choice in the SpawnPoint behavior, but it doesn't seem like it really is putting those values in. I've looked at the datablock and I don't see any of that set for the object. If I go down to Scripting, I can add the datablock there and 2 of the behaviors show and the collision box and size get set, but then I just fall through the world.
#9
02/15/2009 (2:37 pm)
I'm looking through that. So, the TargetType should now be pskActor?
#10
02/15/2009 (2:39 pm)
Your SpawnPointBehavior should use these settings:

TargetType:   pskActor
TargetObject: DragonActorTemplate
#11
02/15/2009 (2:49 pm)
Ok, I fixed up datablocks.cs to now show me the DragonActorTemplate too. When I launch the demo level, my dragon just hangs in the air doing the idle animation. If I drop down the console it tells the that

game/behaviors/PlatformBehavior.cs (33): Unable to instantiate non-conobject class pskPlatform.

and

game/gameScripts/GameMethods.cs (153): Unable to find object: '0' attempting to call function 'setFieldValue'

BTW, thanks for the responses so far. I'm learning a lot as I go.
#12
02/15/2009 (2:54 pm)
Are you running the game from the exe, or the level editor? The level editor *should* pickup the fact that there is a different exe there, but it might not.

Try launching the exe from your project directory and see if that is the case. I'll see what exe the level editor looks for now.

Edit: Try renaming your exe in there to "TGBGame.exe". This means that the level editor *should* use it when running the game from there.
#13
02/15/2009 (3:12 pm)
does this exe rename work ?

How does TGB decide which TGBGame.exe to load ? Does it search for the first TGBGame.exe found in any subdirectory of the games folder ?
#14
02/15/2009 (3:24 pm)
I haven't built the project yet. I've just been trying to run it from inside the editor.

This is the line in PlatformBehavior.cs that gives my first error.

%component = new pskPlatform();

Actually, I think I'm looking at 2 different thing. One is the actor not inheriting the behaviors from the data block, but the other is related to my sceneobjects and the Platform Object Behavior. I get 7 errors. The same as the number of scene objects. Which explains why if I add the 3 behaviors for my actor, I'm not getting any collisions. The sceneobject is messed up.

Compiling C:/Users/Steve/Documents/TorqueBuilder/Project Abe/game/data/levels/Project Abe Level 1.t2d...
Loading compiled script C:/Users/Steve/Documents/TorqueBuilder/Project Abe/game/data/levels/Project Abe Level 1.t2d.
game/behaviors/PlatformBehavior.cs (33): Unable to instantiate non-conobject class pskPlatform.
game/gameScripts/GameMethods.cs (153): Unable to find object: '0' attempting to call function 'setFieldValue'
game/gameScripts/GameMethods.cs (153): Unable to find object: '0' attempting to call function 'setFieldValue'
game/gameScripts/GameMethods.cs (153): Unable to find object: '0' attempting to call function 'setFieldValue'
SimComponent::addComponents - Invalid Component Object "0"
game/behaviors/PlatformBehavior.cs (33): Unable to instantiate non-conobject class pskPlatform.
game/gameScripts/GameMethods.cs (153): Unable to find object: '0' attempting to call function 'setFieldValue'
game/gameScripts/GameMethods.cs (153): Unable to find object: '0' attempting to call function 'setFieldValue'
game/gameScripts/GameMethods.cs (153): Unable to find object: '0' attempting to call function 'setFieldValue'
SimComponent::addComponents - Invalid Component Object "0"
game/behaviors/PlatformBehavior.cs (33): Unable to instantiate non-conobject class pskPlatform.
game/gameScripts/GameMethods.cs (153): Unable to find object: '0' attempting to call function 'setFieldValue'
game/gameScripts/GameMethods.cs (153): Unable to find object: '0' attempting to call function 'setFieldValue'
game/gameScripts/GameMethods.cs (153): Unable to find object: '0' attempting to call function 'setFieldValue'
SimComponent::addComponents - Invalid Component Object "0"
game/behaviors/PlatformBehavior.cs (33): Unable to instantiate non-conobject class pskPlatform.
game/gameScripts/GameMethods.cs (153): Unable to find object: '0' attempting to call function 'setFieldValue'
game/gameScripts/GameMethods.cs (153): Unable to find object: '0' attempting to call function 'setFieldValue'
game/gameScripts/GameMethods.cs (153): Unable to find object: '0' attempting to call function 'setFieldValue'
SimComponent::addComponents - Invalid Component Object "0"
game/behaviors/PlatformBehavior.cs (33): Unable to instantiate non-conobject class pskPlatform.
game/gameScripts/GameMethods.cs (153): Unable to find object: '0' attempting to call function 'setFieldValue'
game/gameScripts/GameMethods.cs (153): Unable to find object: '0' attempting to call function 'setFieldValue'
game/gameScripts/GameMethods.cs (153): Unable to find object: '0' attempting to call function 'setFieldValue'
SimComponent::addComponents - Invalid Component Object "0"
game/behaviors/PlatformBehavior.cs (33): Unable to instantiate non-conobject class pskPlatform.
game/gameScripts/GameMethods.cs (153): Unable to find object: '0' attempting to call function 'setFieldValue'
game/gameScripts/GameMethods.cs (153): Unable to find object: '0' attempting to call function 'setFieldValue'
game/gameScripts/GameMethods.cs (153): Unable to find object: '0' attempting to call function 'setFieldValue'
SimComponent::addComponents - Invalid Component Object "0"
game/behaviors/PlatformBehavior.cs (33): Unable to instantiate non-conobject class pskPlatform.
game/gameScripts/GameMethods.cs (153): Unable to find object: '0' attempting to call function 'setFieldValue'
game/gameScripts/GameMethods.cs (153): Unable to find object: '0' attempting to call function 'setFieldValue'
game/gameScripts/GameMethods.cs (153): Unable to find object: '0' attempting to call function 'setFieldValue'
SimComponent::addComponents - Invalid Component Object "0"
game/gameScripts/PlayerMethods.cs (14): Unknown command onAddtoScene.
game/gameScripts/GameMethods.cs (124): Unable to instantiate non-conobject class pskSpawnPointManager.
DirectInput deactivated.
Shutting down the OpenGL display device...
Making the GL rendering context not current...
Deleting the GL rendering context...
Releasing the device context...

#15
02/15/2009 (3:27 pm)
Stephen, you don't need to build the project, just run the exe in your project directory like you would a normal program. The "unable to instantiate non-conobject" error relates to you not using the correct executable file.

Eb, the editor looks for an exe in the project directory to use before falling back on the original exe (found in <TGB Dir>/tgb\gameData\T2DProject\).
#16
02/15/2009 (3:40 pm)
Ok, I guess I've been confused about some things. I need to copy your exe from the C:\Program Files (x86)\GarageGames\TorqueGameBuilder-1.7.4\PlatformerStarterKit\Binaries directory into my projects root folder.

If I do that, it will run, the animations work, etc. (I'll need to look at making the camera follow the actor now) If I push the Play Scene button in the editor, it doesn't work. This is progress though. :P

Is the reason I need to use the binary provided because I have the non-source code version?
#17
02/15/2009 (3:43 pm)
BTW, I launched it from within the gui and checked where the TBGame.exe was running from, it was the default in the TBG folder, not the one in my project.
#18
02/15/2009 (3:46 pm)
Okay, cool, so once you have copied the exe to your project directory, rename it to "TGBGame.exe".
#19
02/15/2009 (4:00 pm)
I tried that and it still wants to use the one in the engine's dir instead. It's fine, I know how to test it now without clicking on it. That's more of a convenience than a necessity.
#20
02/15/2009 (4:02 pm)
Thats odd! It should be loading the one from your directory!
Page «Previous 1 2