Jump to content

Body Parts Blown Off In VC like In GTA3


Recommended Posts

I am stumped, how does this work, and how can it be set up to work when a ped gets shot on a certain body part like in GTA 3? And finally if that works, will it also work in SA?



Link to comment
Share on other sites

It might not be that easy to map a shot to a ped component, but the general idea of "removing" ped components is pretty simple.


In ped's prerender callback, after the game has done its calculations on ped component matrices, you just have to scale the matrices of the components you want to hide with a zero vector.


The code itself would look something like this (to remove head manually):


DWORD dwIndex;RwMatrix* pRwHeadMatrix;RwV3d vecScale = {0.0f, 0.0f, 0.0f};RpHAnimHierarchy* pAnimHierarchy = RpClumpGetSkinHAnimHierarchy(ENT(pPed)->pRpClump);RwMatrix* pRwMatrixArray = RpHAnimHierarchyGetMatrixArray(pAnimHierarchy);dwIndex = RpHAnimIDGetIndex(pAnimHierarchy, pPed->pFrames[AFRAMEID_HEAD]->dwFrameNodeId);pRwHeadMatrix = &pRwMatrixArray[dwIndex];RwMatrixScale(pRwHeadMatrix, &vecScale, rwCOMBINEPRECONCAT);


Edited by maxorator
Link to comment
Share on other sites


Edited by lolleroz
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • 1 User Currently Viewing
    0 members, 0 Anonymous, 1 Guest

  • Create New...

Important Information

By using GTAForums.com, you agree to our Terms of Use and Privacy Policy.