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 / dbLimbName() crashes my game.

Author
Message
Charles
20
Years of Service
User Offline
Joined: 11th Jul 2004
Location: Phoenix, AZ USA
Posted: 2nd Apr 2006 08:17
While I was enumerating through the limbs of an object, I tried to get the limb's name with dbLimbName((DWORD)szLookUp, nObj, nLimb) but the function crashed onme. I made sure that the limb exists and that there was enough string buffer space in "szLookUp". Is this a bug or am I using it wrong?
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 13th Apr 2006 21:18
Some quick debug type questions (ignore if already tried):
1. Did you make sure the object indicated in nObj actually exists? Did it load correctly?
2. Make sure you are using the correct limb index base - the indices are 0 based.

That said, it might be how you are using it that is the problem (due to not very good documentation at this stage).

The actual results are returned as a char* value by the function. It doesn't put anything usefull in the first calling parameter. Continue to put a string variable there (as you are), but define and use a char* to get the actual data, like this:



Do NOT delete szLookUp when done. That causes a crash.

Some of the DGSdk functions return dynamically created strings and the results need to be deleted when done, or there are memory leaks. I don't know how dbLimbName constructs what it returns (it might be a pointer directly into the named strings in the model memory), but deleting it's returned value causes program crashing.

Cheers,
Ancient Lady
Charles
20
Years of Service
User Offline
Joined: 11th Jul 2004
Location: Phoenix, AZ USA
Posted: 14th Apr 2006 11:39
Nope. Nothing seems to work. The object exists and there are limbs inside it. I also made sure that the limb exists by using "dbLimbExist(nObj, nLimb)". I'm stumped.
Zeal
22
Years of Service
User Offline
Joined: 10th Oct 2002
Location: Colorado Springs, CO
Posted: 14th Apr 2006 16:14
Im pretty sure limb name was bugged in pro, and has since been fixed for u6

All you need is zeal
Charles
20
Years of Service
User Offline
Joined: 11th Jul 2004
Location: Phoenix, AZ USA
Posted: 16th Apr 2006 11:00
What is u6?
Miguel Melo
19
Years of Service
User Offline
Joined: 8th Aug 2005
Location:
Posted: 16th Apr 2006 14:09
U6 is the current release of Dark Basic Pro, still in beta. It is hoped that in a few weeks the changes made there will trickle down to the Dark GDK.

I have vague plans for World Domination
Charles
20
Years of Service
User Offline
Joined: 11th Jul 2004
Location: Phoenix, AZ USA
Posted: 20th Apr 2006 08:01
Ahh. I see. I also hope that they come up with a GDK that works with Visual Studio 2005. I just changed over and found that the old GDK is not compatible with it.

Login to post a reply

Server time is: 2024-11-19 06:36:43
Your offset time is: 2024-11-19 06:36:43