Results 1 to 4 of 4

Thread: jka Bone Aim (ghoult2 yo)

  1. #1
    Join Date
    Jul 2009
    Location
    London, England
    Posts
    50
    Thanks
    11
    Thanked 22 Times in 13 Posts
    Rep Power
    47

    jka Bone Aim (ghoult2 yo)

    Hey all,

    Just thought I'd share some cool stuff I found while updating my JKA MovieBattles mod client hook.

    JKA uses the ghoul2 system that sof2 uses for bone animations (ragdoll and stuff).

    As such, you can use bone positions for aimbot, instead of just using the entities->lerpOrigin.

    To grab the bone data you just need to make a call to the ghoul2 api, passing in the ghoul2* that is a member of centities[player].

    Code:
    if(trap_G2_HaveWeGhoul2Models(ref->ghoul2))
    {
    	mdxaBone_t matrix;
    	vec3_t bOrg;
    	int boneNum = 2;
    	trap_G2API_GetBoltMatrix(mycents[lastent]->ghoul2, 0, boneNum, &matrix, 
    							mycents[lastent]->lerpAngles, mycents[lastent]->lerpOrigin,
    							mycg->time, mycgs->gameModels, mycents[lastent]->modelScale);
    							
    	BG_GiveMeVectorFromMatrix(&matrix, ORIGIN, bOrg);
    }
    Now bOrg contains the position of the chest bone (rotated and translated to world coords).

    boneNum is 2, which is the chest on all models i tested it on.

    There are other bones, and to find out which bones are which, you can easily check CG_G2_ADDBOLT in syscall. The code I used for this is:

    Code:
     case CG_G2_ADDBOLT:
     {
    	void* ghoul2 = (void*)arg[0]; 
    	int modelIndex = (int)arg[1];
    	const char* boneName = (const char*)arg[2];
    	int retVal = syscall(CG_G2_ADDBOLT, ghoul2, modelIndex, boneName);
    	OutputDebugString(va("CG_G2_ADDBOLT(%i,%i,%s) = %i",ghoul2,modelIndex,boneName,retVal));
    	return retVal;			
    }
    The above shows you which bones are which numbers, pretty self evident.

    Hope this helps anyone still interested in jka (or sof2).
    Last edited by owen; 07-20-2010 at 08:43 AM. Reason: Fixed code, spelling, retardedness.

  2. The Following 3 Users Say Thank You to owen For This Useful Post:

    eXoloon (03-12-2011), nahnah (08-13-2010), v3n0m4 (03-10-2011)

  3. #2
    Join Date
    Nov 2008
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    Re: jka Bone Aim (ghoult2 yo)

    Code:
    //return the bone coordinates given the bone name!
    qboolean Ex_GetPlayerBoneCoords(int playerId, char* boneName, vec3_t boneCoords)
    {
    	centity_t *cent = &cg_entities[playerId];
    	int boltIndex = trap_G2API_AddBolt(cent->ghoul2, 0, boneName);
    	
        if (boltIndex != -1)
    	{
    		mdxaBone_t matrix;
    		trap_G2API_GetBoltMatrix(cent->ghoul2, 0, boltIndex, &matrix, cent->turAngles,
    								 cent->lerpOrigin, cg.time, cgs.gameModels, cent->modelScale);
    		BG_GiveMeVectorFromMatrix(&matrix, ORIGIN, boneCoords);
    		return qtrue;
    	}
    	return qfalse;
    }
    Code:
    vec3_t bonePos;
    if Ex_GetPlayerBoneCoords(i, "cranium", bonePos) ...
    Click image for larger version. 

Name:	jkaBONES.JPG 
Views:	101 
Size:	93.5 KB 
ID:	3731

  4. #3
    Join Date
    Jul 2009
    Location
    London, England
    Posts
    50
    Thanks
    11
    Thanked 22 Times in 13 Posts
    Rep Power
    47

    Re: jka Bone Aim (ghoult2 yo)

    Why bother with headshot bot in JKA (MB2) most weapons dont do headshot damage, and you sacrifice accuracy (lol blasters) for little gain.

  5. The Following User Says Thank You to owen For This Useful Post:

    v3n0m4 (03-10-2011)

  6. #4
    Join Date
    Nov 2010
    Posts
    7
    Thanks
    2
    Thanked 2 Times in 1 Post
    Rep Power
    0

    Re: jka Bone Aim (ghoult2 yo)

    Quote Originally Posted by owen View Post
    Why bother with headshot bot in JKA (MB2) most weapons dont do headshot damage, and you sacrifice accuracy (lol blasters) for little gain.
    That's why you need to account for bullet spread and fire speed by using aimbot prediction. I'm not sure how jka's recoil works but try looking in CG_fireweapon

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Bone aim and prediction
    By zoomgod in forum Frostbite Engine
    Replies: 21
    Last Post: 04-30-2008, 05:25 PM
  2. Bone aimbot
    By Wiezzi in forum Intermediate
    Replies: 7
    Last Post: 08-01-2007, 05:56 PM
  3. anyone got bone aim src?
    By Gotham in forum Intermediate
    Replies: 7
    Last Post: 03-31-2004, 02:15 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •