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].
Now bOrg contains the position of the chest bone (rotated and translated to world coords).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); }
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:
The above shows you which bones are which numbers, pretty self evident.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; }
Hope this helps anyone still interested in jka (or sof2).


Reply With Quote

