Game Development Community

Custom Resources

by David Higgins · in Torque Game Builder · 09/21/2006 (8:46 pm) · 2 replies

I am working on a "Custom Resources" tutorial on TDN, and was wondering if anyone has already accomplished creating a custom resource and would not mind sharing some the code with me so I can save myself the trouble of "researching" and "trial and error tests".

I am building a custom resource, and while I'm at it, figured I would share my knowledge by contributing to TDN with a tutorial about how I did it -- though, most of this stuff is undocumented and the "Layer Floater" that GG provided is more or less "useless" if you want to create true "custom" add-ins to TGB. "Layer Floater" more or less just ties into internal Level Builder functionality, and does not really show off how to do much of anything -- so I'll be digging around in the source files of the Level Editor and GUI controls to figure most of this out.

Any help would be appreciated, thanks.

#1
09/21/2006 (9:18 pm)
The most important thing in creating a resource is the resourceDatabase.cs file. Take a look at some of the MiniTutorials on TDN. The files linked to are just zipped up resources in some cases. The Basic Boat Physics MiniTutorial is an example of that.
#2
09/21/2006 (10:48 pm)
@Thomas, though it may be the most critical part, as it's required for the tool to load, I don't really consider that to be the most "important" part.

tdn.garagegames.com/wiki/TGB/Level_Builder/CustomResources

I've managed to put this together, so far, which creates the resourceDatabase.cs, and a floater.gui and then load's the floater.gui using the same general concept that the "Layer Floater" tool uses.

What I'd like to accomplish now, is to re-create something like the "Static Sprites" roll-down in the Create Tab within a floating layer --without-- using the same concept that LayerFloater used (by just copying the object into a floating window) ...

I've been digging through the torquescript sources for the leveleditor for the past few hours, and have managed to figure out how to create objects on the level builders scenegraph,

%scenegraph = ToolManager.getLastWindow().getSceneGraph();

   %obj = new t2dSceneObject() { Class = "Foo"; SuperClass = "Bar"; size = "300 300"; };
   %scenegraph.addToScene(%obj);

Now, I'm just left with figuring out how to retrieve all the currently loaded resources, such as ImageMaps -- so that I can create a custom 'Static Sprites' window, from scratch (the hard way).

I do have an actual goal in mind, but I also think that doing things the hard way shows people how to do things ...

again, any help is appreciated.

EDIT: fixed URL