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 / How do I program a 3D model to pick up an item like a gun

Author
Message
yahya
15
Years of Service
User Offline
Joined: 16th Oct 2008
Location:
Posted: 26th Apr 2009 20:35
How can I make my 3D modle pick up a gun and show up on his hand like a FPS game, and move with the 3D modle.


I looked and no one in the Drak GDK board asked it before.
Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 26th Apr 2009 20:38
Check out the dbGlueObjectToLimb() function. It should help. As for actually detecting the object (i.e., the gun), you can just use the distance formula for simplicity - don't really need much more than that.
yahya
15
Years of Service
User Offline
Joined: 16th Oct 2008
Location:
Posted: 26th Apr 2009 23:02
thanks but can you give me an example on the dbglueObjecttoLinmb();.

I mean it tells me to input the iSoruce, and itaget, and iLimb, I just wanna know what they are suppose to santd for.
liek is Isource==> my 3D gun modle, iTaget===> my 3D character, iLimb===>....?
Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 27th Apr 2009 00:26
iLimb is which limb of the object you want it to stick to. Limbs are like separate objects on the main object. By that I mean, you don't want to be sticking onto the head limb, but you do want to stick it onto the hand. Gettit?
yahya
15
Years of Service
User Offline
Joined: 16th Oct 2008
Location:
Posted: 27th Apr 2009 00:37
Sorry no, let say am using the default Colonel-X.X model, how can I let iLimb pace the gun on the Colonel's hands?
yahya
15
Years of Service
User Offline
Joined: 16th Oct 2008
Location:
Posted: 28th Apr 2009 22:22
Can't anyone explain plz?
HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 30th Apr 2009 11:19
check out this command it will return the number of limbs the model has.

void dbPerformCheckListForObjectLimbs ( int iObject )

now add 1 to the total and thats the number you need to add another object to the model.

void dbGlueObjectToLimb ( int iObject, int iSecondObject, int iLimb )

Dark Physics makes any hot drink go cold.
yahya
15
Years of Service
User Offline
Joined: 16th Oct 2008
Location:
Posted: 4th May 2009 01:13
Sorry for the late reply, but I don't know how to do the whole:

void dbPerformCheckListForObjectLimbs ( int iObject )

How can I use it?
HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 4th May 2009 10:36
you need to make a varable to hold the number of limbs, then get the above command to put that into it.

can't show in how VS as still trying to undrestand how to do eveything.
so this how I would do it in basic.

number_of_limbs = Perform Check List For Object Limbs object_to_check
number_of_limbs = number_of_limbs+1
Glue Object To Limb object_to_be_added , main_object , number_of_limbs

so do it like above but use GDK commands.

if anyone else would like to show how the above looks in GDK please to do show how.

Dark Physics makes any hot drink go cold.
yahya
15
Years of Service
User Offline
Joined: 16th Oct 2008
Location:
Posted: 5th May 2009 01:22
I would like to thank you HowDo for your great help, but I can't seem to make that method work the DarkGDK way.

Is there an alternative method I can use so when my characters collides with the gun it apreas on his hand?
yahya
15
Years of Service
User Offline
Joined: 16th Oct 2008
Location:
Posted: 5th May 2009 10:40
I finaly mnaged to get the number of Limbs from the modle, but it says there are 7008 :S.

How do I know which one is for the hand , and I already tried this:

dbGlueObjectToLimb ( Colonel, gun, 5000 ) and it doesn't work
HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 5th May 2009 21:45 Edited at: 5th May 2009 21:47
try this instead




make LimbNumber one from 1 to 43,(I think that how many limbs in colonel).

Dark Physics makes any hot drink go cold.

Login to post a reply

Server time is: 2024-10-01 01:23:39
Your offset time is: 2024-10-01 01:23:39