Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / importing 300 doors, with different id's. best method.

Author
Message
unitech
17
Years of Service
User Offline
Joined: 27th Jun 2007
Location:
Posted: 10th Jul 2007 15:11
In a previous game engine I had an option find by name. I would export my X file with names on each object. Then when importing I would do a find by name.
a1
a2
a3
..ect

I have on the oder of 300 doors, each needs it's own name and specific position. The only way I see doing this is exporting each door as a separate x file then importing each. Oh that will be h4ll... Any thoughts towards making this less cumbersome of a job?
tparkin
17
Years of Service
User Offline
Joined: 28th Mar 2007
Location:
Posted: 10th Jul 2007 18:51
Hi unitech

Check out the "limb" functions in the help file. From my understanding they are the same as hierarchy functions where you can get a piece of a model (and even attach/detach it using glue/unglue functions). Also you can get a limb's name, which is what you want to do.

Start with dbPerformChecklistForObjectLimbs

Perhaps search the forums for more on these functions.
unitech
17
Years of Service
User Offline
Joined: 27th Jun 2007
Location:
Posted: 10th Jul 2007 18:58 Edited at: 10th Jul 2007 19:34
Ah yes, I shall give that a whirl. thx!
---------------------------------------
*updated*
---------

The information was useful however it is returning null. Anyone attempt this with luck..



I could not do OutputDebugString (dbChecklistString(255)); I get OutputDebugString faulted during output. but adding the sprintf gives me an outputof.

(null)

I also tried. dbChecklistString(0)). not sure what from is.. from 0 to eof. or 0 to from..
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 10th Jul 2007 20:07
PerformChecklist returns a null at the end of the list, I have reported this as a bug a while back, but currently have code in place to handle it until its fixed (if its fixed)

My DBP plugins page is now hosted [href]here[/href]
unitech
17
Years of Service
User Offline
Joined: 27th Jun 2007
Location:
Posted: 10th Jul 2007 20:12 Edited at: 10th Jul 2007 20:51
Quote: "but currently have code in place to handle it until its fixed"
What code are you using to get around this? Thx.
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 10th Jul 2007 21:51 Edited at: 10th Jul 2007 21:52
I made a LimbManager Class in one test project, since I know the last limb is always a null (bug), when iterating on the oDB3D.LimbCount, the For loop is defined as:

For iLoop = 1 To oDB3D.LimbCount(Me.ParentObjectID) - 1 '<--DB Engine last limb always null (BUG)
sLimbName = oDB3D.LimbName(Me.ParentObjectID, iLoop).ToLower
...
Next iLoop


that way the last item is always ignored.

My DBP plugins page is now hosted [href]here[/href]
unitech
17
Years of Service
User Offline
Joined: 27th Jun 2007
Location:
Posted: 10th Jul 2007 22:18 Edited at: 10th Jul 2007 22:50
Ahh, ok I was mis understood. Didn't realize this was an array return, I figured it was a string generated from an array. I have now looped and your correct the -1 has to be there, thx again CattleRustler.

Is there any way to get the limb by name? or do I need to create an enum from the dbChecklistString array.
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 10th Jul 2007 23:11 Edited at: 10th Jul 2007 23:13
I dont think you can get the limbs by name directly from the db_ engine like you can with getting the name by id, thats part of why I was putting them in my own Generics Dictioanry collection (strongly typed on another class I made, LimbItem iirc) I used the count integer as the unique id, and had property fields for the name, id, and other stuff. Once its done that way there is always an association between the limb name and its id in the class, then I wrote methods to return a limb by name, or by id, etc.

My DBP plugins page is now hosted [href]here[/href]
unitech
17
Years of Service
User Offline
Joined: 27th Jun 2007
Location:
Posted: 11th Jul 2007 14:33
precisely what I meant by doing a enum. Ill just build it in to my object class..
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 11th Jul 2007 16:38
yep

My DBP plugins page is now hosted [href]here[/href]
unitech
17
Years of Service
User Offline
Joined: 27th Jun 2007
Location:
Posted: 11th Jul 2007 22:22 Edited at: 12th Jul 2007 14:28
Well my output is like this..




and thats with out the bug fix..

Still usable but I have that $NoName$ junk in there..

We also created a findEntityByName..

so I can use m_level.findEntityByName("lvl_12")

So works for now.
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 11th Jul 2007 23:18
yeah, not sure why first ones are null, and the others are probably not named in the 3d editor. When I was doing this project I was using AC3D as the 3d editor, so the results for output may be different from 3d app to 3d app. Either way you know what youre using and can custom-code around any oddity.

My DBP plugins page is now hosted [href]here[/href]

Login to post a reply

Server time is: 2024-09-29 01:20:16
Your offset time is: 2024-09-29 01:20:16