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 / Crazy weird bugs

Author
Message
heyufool1
15
Years of Service
User Offline
Joined: 14th Feb 2009
Location: My quiet place
Posted: 28th Sep 2009 22:23 Edited at: 28th Sep 2009 23:52
Hi!
Bug 1: I'm trying to remove a head of an enemy if I shoot at it. To do this I'm using the dbRemoveLimb ( int Object, int Limb ) command.
Here is an example that works:

And here is an example the doesn't work (I am pressing the space key when I run it):

So what's going on there?

Bug 2: My model I'm loading that's being used in the previous bug doesn't have a texture. So most times when I load it, it is black, but sometimes it's red. I'm pretty positive that it changes randomly and if it doesn't then it's changing for stupid reasons like adding an if statement some where that has nothing to do with the model.

Bug 3: Sometimes when the head of the model does get removed the vertices are all over the place. It's almost like the vertices in the head are being moved in all random directions when ever I do dbRemoveLimb.

Bug 4: Occasionally when I remove a limb I get an unhandled exception error.

So does anyone have ideas on why this is happening?

EDIT: dbOffsetLimb works but not dbHideLimb or dbRemoveLimb
EDIT2: I found the source of the bugs 1, maybe 2, and maybe 4. The problem is, is that dbRemoveLimb does not do anything after dbSync ( ) or dbFastSync ( ) has been called.
EDIT3: When dbRemoveLimb is called after a dbSync ( ) or dbFastSync ( ) the limb is being removed but not being update on the screen. I tested this with:
(It did not exit meaning the limb WAS removed, but it was still there on the screen)

Games are like life, they should never stand still.
SFCBias
15
Years of Service
User Offline
Joined: 8th Aug 2009
Location: Hephzibah, GA, USA
Posted: 29th Sep 2009 00:52
Bug one:you may want to try


Bug 2:be sure that the models textures are in the same directory as the model(eg. .dds,.jpg,or .png file ect.)

if im not mistaken dbRemoveLimb simply detaches the specified limb rather than deletes it from view as i believe you want. i recommend trying dbHideLimb().
heyufool1
15
Years of Service
User Offline
Joined: 14th Feb 2009
Location: My quiet place
Posted: 29th Sep 2009 00:57
Answer to Bug 1: ( dbSpaceKey() == 1 ) and ( dbSpaceKey() ) are the same thing.

Answer to Bug 2: The model is loaded

As for the function of dbRemoveLimb, if I call it before a dbSync() or dbFastSync() it's completely deleted but I'll look into the detaching idea. And I've always wanted to use dbHideLimb() but it never works, not sure why but it doesn't.

Games are like life, they should never stand still.
dark coder
21
Years of Service
User Offline
Joined: 6th Oct 2002
Location: Japan
Posted: 29th Sep 2009 06:52
Show us a proper example of this including the media? It's quite hard to test issues like the random colour issue without any media, as I've not noticed anything like this before. Also what version are you using?

Isocadia
15
Years of Service
User Offline
Joined: 24th Jul 2009
Location:
Posted: 29th Sep 2009 18:19
Heyufool: ( dbSpaceKey() == 1 ) is not the same as ( dbSpaceKey() ). For when putting the command dbSpaceKey() it returns a value of 1 if it is pressed and 0 if not, so in the if function you need the == 1.

Isocadia
Hassan
15
Years of Service
User Offline
Joined: 4th May 2009
Location: <script> alert(1); </script>
Posted: 29th Sep 2009 18:43 Edited at: 29th Sep 2009 18:44
if ( dbSpaceKey() ) {...} ---> if (the condition) is true {...}

and since every value in C++ is true except the zero, when dbSpaceKey() returns 1 the condition will be true, else if it returns a zero (false value) the condition will be false.

which means that (dbSpaceKey()) and (dbSpaceKey()==1) are the same.

Isocadia
15
Years of Service
User Offline
Joined: 24th Jul 2009
Location:
Posted: 29th Sep 2009 19:10
Oke, didn't know that every value was true exept 0.

Isocadia
dark coder
21
Years of Service
User Offline
Joined: 6th Oct 2002
Location: Japan
Posted: 29th Sep 2009 19:32 Edited at: 29th Sep 2009 19:33
Quote: "which means that (dbSpaceKey()) and (dbSpaceKey()==1) are the same."


Nope, one checks if the value isn't 0x0, the other checks if it is 0x1. In this instance dbSpaceKey() returns either a 0 or 1 so there is no semantic difference. The former is very useful in many cases, particularly when dealing with pointers and you wish to check if it isn't NULL.

heyufool1
15
Years of Service
User Offline
Joined: 14th Feb 2009
Location: My quiet place
Posted: 29th Sep 2009 21:55 Edited at: 29th Sep 2009 22:03
I'm using version 7.4 and I'm making a small example now, will edit when done.

Edit: Ok I attached the example to this post and it uses the exact same model that I used when this problem occurred.

READ THIS:
1. Do not hold space when the program starts, otherwise the head will be removed successfully.
2. Press space when the program is running to see that the head is not removed.
3. Comment out the "if ( dbSpaceKey ( ) )" line to see that the head is successfully removed.

Games are like life, they should never stand still.

Attachments

Login to view attachments
dark coder
21
Years of Service
User Offline
Joined: 6th Oct 2002
Location: Japan
Posted: 30th Sep 2009 04:12
Interesting, it appears GDK fails at memory management. If I change the limb to be removed to 2 then it turns red for no reason. It'd be best to post what you just posted on the bug thread so anyone confirming it can easily test it themselves.

heyufool1
15
Years of Service
User Offline
Joined: 14th Feb 2009
Location: My quiet place
Posted: 30th Sep 2009 04:20
Thanks for checking it out! And I did post a bug report with the example

Games are like life, they should never stand still.
SFCBias
15
Years of Service
User Offline
Joined: 8th Aug 2009
Location: Hephzibah, GA, USA
Posted: 1st Oct 2009 07:21
I tested and it worked fine for me minus the red (which im almost certain can be fixed by adding a texture)
heyufool1
15
Years of Service
User Offline
Joined: 14th Feb 2009
Location: My quiet place
Posted: 2nd Oct 2009 23:27
Quote: "I tested and it worked fine for me minus the red (which im almost certain can be fixed by adding a texture) "

Huh really? Which dark GDK version are you using?

Games are like life, they should never stand still.
SFCBias
15
Years of Service
User Offline
Joined: 8th Aug 2009
Location: Hephzibah, GA, USA
Posted: 3rd Oct 2009 00:28
I have no idea. I believe it is the un-updated on from the home page. (I used the MSDN link to the site)

Login to post a reply

Server time is: 2024-10-01 14:25:52
Your offset time is: 2024-10-01 14:25:52