List of game items from C++ code.
by Steve Lamperti · in Torque Game Engine · 11/03/2003 (5:02 pm) · 4 replies
I'm trying to write some C++ code to list the game items that are available in the engine.
I started to try to work with the gNameDictionary, and I wrote some code that sort of works, but it looks like the things in the gNameDictionary are not a complete list of al the possible objects in the game, and they also do not have the mTypeMask set correctly to filter them.
When I tried to filter the objects that came back from the list of things in gNameDictionary, using GameBaseObjectType & mTypeMask, I found that the objects that are definately GameBase objects, had a zero for their mTypeMask fields.
Perhaps I am using the wrong dictionary, or the wrong technique.
If anyone has any suggestions, I would appreciate hearing them.
I know that this is not a terribly good description of what I am doing, or why it is not working. The gist of what I want to be able to do, is to get a list of the names of objects that can be placed in the game via another routine I have that places objects from C++ code. I'd like to be able to specify that I want items, or static shapes, or things like that, which is why I was trying to use mTypeMask.
Thanks for any suggestions,
I started to try to work with the gNameDictionary, and I wrote some code that sort of works, but it looks like the things in the gNameDictionary are not a complete list of al the possible objects in the game, and they also do not have the mTypeMask set correctly to filter them.
When I tried to filter the objects that came back from the list of things in gNameDictionary, using GameBaseObjectType & mTypeMask, I found that the objects that are definately GameBase objects, had a zero for their mTypeMask fields.
Perhaps I am using the wrong dictionary, or the wrong technique.
If anyone has any suggestions, I would appreciate hearing them.
I know that this is not a terribly good description of what I am doing, or why it is not working. The gist of what I want to be able to do, is to get a list of the names of objects that can be placed in the game via another routine I have that places objects from C++ code. I'd like to be able to specify that I want items, or static shapes, or things like that, which is why I was trying to use mTypeMask.
Thanks for any suggestions,
#2
11/03/2003 (6:44 pm)
Are you trying to replicate the sort of functionality the creator tool in the editor has?
#3
@Xavier:
ObjectTypes.h is where the type mask constants are defined. The problem I have is that the simBase objects in the gNameDictionary don't have those type values set 'correctly' as I was expecting to see them.
@Ben
Pretty much, as I think I have described elsewhere, I am trying to set up the Torque engine as a seperate window in our application, and I want to be able to create items and manipulate them from the code of our app.
I guess the between the lines of your question, is look at how the editor does it, and try to borrow some code.
That's a good idea. If you have a suggestion of how to start other then just trying to read the code of editor.cc, I'd appreciate hearing it, otherwise I'll start there.
Thank for the input,
11/04/2003 (8:41 am)
Thanks for the replies;@Xavier:
ObjectTypes.h is where the type mask constants are defined. The problem I have is that the simBase objects in the gNameDictionary don't have those type values set 'correctly' as I was expecting to see them.
@Ben
Pretty much, as I think I have described elsewhere, I am trying to set up the Torque engine as a seperate window in our application, and I want to be able to create items and manipulate them from the code of our app.
I guess the between the lines of your question, is look at how the editor does it, and try to borrow some code.
That's a good idea. If you have a suggestion of how to start other then just trying to read the code of editor.cc, I'd appreciate hearing it, otherwise I'll start there.
Thank for the input,
#4
11/04/2003 (2:08 pm)
You probably want creator.cc, actually... :)
Torque 3D Owner Xavier "eXoDuS" Amado
Default Studio Name