Some outdated findings:
ENTITYCEntity + 0x36 - [byte] Entity type
0x02 = Player as driver
0x12 = Quiet driver
0x1A = Suspicious driver (when slightly or heavily collided, unlike cops who are never quiet)
0x22 = No driver
0x2A = Destroyed
0x4A = Player as driver is exiting or being wasted, busted or hijacked
PED0x5E3B60 - BYTE __thiscall CPed__getWeaponSkillIndexByType(short sType)
0x5E6580 - BYTE __thiscall CPed__getWeaponSkillIndex()
VEHICLECVehicle + 0x37C - [bool] Nitro on/off (read-only)
CVehicle + 0x38C - [dword] Some flag
0x80000 = nitro installed
CVehicle + 0x48A - [byte] Nitro Slots
2/5/10 = nitros normal slots (n - 1)
101 = special nitro (cheat)
CVehicle + 0x8A4 - [float] Nitro timer
When nitro is activated, it is set to 0.0 and decreased by -1e-06. Once it overcomes -1.0, the game automatically sets it to 0.0 and it gets increased by 1e-06 (it rises faster if player doesn't accelerate and twice if he decelerates, possible bug).
CVehicle + 0x978 - [dword] Nitro particle 1 (mono exhaust)
CVehicle + 0x97C - [dword] Nitro particle 2 (dual exhaust)
0x6A3EA0 - void __thiscall CAutomobile__processNitro(BYTE bSlots)
PATHFIND0x96F050 - CPathFind
0x420A10 - void *__thiscall CPathFind__getNodePosition(void *pCoords) (from MTA's source)
0x420AC0 - void *__thiscall CPathFind__getNodePointer(DWORD dwNodeAddr) (from MTA's source)
0x44E4F0 - void __thiscall CPathFind__popRouteNodesFartherFrom(float fOriginX, float fOriginY, float fOriginZ, DWORD *pNodeList[], short *pSteps)
fOriginZ - It's unused in the whole function.
0x4515D0 - void __thiscall CPathFind__findShortestRouteNodes(BYTE bType, float fOriginX, float fOriginY, float fOriginZ, DWORD dwFirstNode, float fDestX, float fDestY, float fDestZ, DWORD *pNodeList[], short *pSteps, short sMaxSteps, float *pDistance, float fMinRadius, DWORD dwLastNode, float fMaxRadius, bool bFollowPath, WORD wFlag, bool bUnk, bool bUnk)
bType - Route type
0 = vehicle
1 = pedestrian
pNodeList - An array containing all route nodes found between the start and destination points.
pSteps - The number of route nodes found.
sMaxSteps - The length of pNodeList array.
fMinRadius - The minimum radius the first node and the next nearest one must have to start searching from the origin. It needs confirmation, though.
fMaxRadius - The maximum radius to start searching from the destination.
bFollowPath - If set, route nodes respect lanes, otherwise the best shortest route is found.
wFlag - It's still unknown. Maybe it defines the type the search nodes do have. Default value is 0xFFFF.
CONTROLS0x53FF90 - bool __thiscall CPad__firePressed()
0x53FDD0 - bool __thiscall CPad__lookLeftPressed()
0x53FE10 - bool __thiscall CPad__lookRightPressed()
0x53FE70 - bool __thiscall CPad__lookBehindPressed()
MATRIX0x59BD10 - void __thiscall CMatrix__copyFromRwMatrix(RwMatrix *pMatrix, BYTE bUnk)
0x59BD90 - void __thiscall CMatrix__copyToRwMatrix(RwMatrix *pMatrix, BYTE bUnk)
PARTICLECParticle (size = 0x84?)
+ 0x0 - [dword] Pointer to next CParticle
+ 0x4 - [dword] Pointer to previous CParticle
+ 0x8 - [dword] Unknown pointer to CParticleData
+ 0xC - [dword] Attaching matrix
+ 0x10-0x50 - [RwMatrix] Matrix
+ 0x50 - [byte] Status:
0 = visible
1 = inactive
>=2 = unknown
+ 0x51 - [byte] Unknown status
+ 0x52-0x53 - [byte] Unknown
+ 0x54 - [dword] Unknown
+ 0x58 - [float] Distance from camera
+ 0x5C - [short] Time (0.0 to 1.0) * 256
+ 0x5E - [short] Frequency/Intensity (0.0 to 1.0) * 1000
+ 0x60 - [short] Speed (0.0 to 1.0) * 1000
+ 0x62 - [byte] Flag
+ 0x63 - [byte] Unknown
+ 0x64 - [float] Unknown ((rand() % 10000) * 0.0001 * (pParticle.matrix.right.y - pParticle.matrix.right.x) + pParticle.matrix.right.x)
+ 0x68-0x70 - [dword] Unknown
+ 0x74-0x84 - [dword] Unknown pointer
BULLET0x735FD0 - void __cdecl CBullet__releaseAll()
0x736010 - bool __cdecl CBullet__create(CPed *pEntity, short sWeaponType, float fOriginX, float fOriginY, float fOriginZ, float fVelocityX, float fVelocityY, float fVelocityZ)
WEAPONINFO0x743C60 - void *__cdecl CWeaponInfo__getInfo(short sType, BYTE bSkillIndex)
0x743CD0 - short __cdecl CWeaponInfo__getSkillStat(short sType)
PLACEABLE0x50A360 - void __stdcall CPlaceable__getPitchYaw(RwV3d *vOffset, float *fPitch, float *fYaw) (unreferenced)
0x59C790 - void __cdecl CPlaceable__transformRelToAbsOffset(RwV3d *vPoint, RwMatrix *pMatrix, RwV3d *vOffset)
0x59C810 - void __cdecl CPlaceable__transformAbsToRelOffset(RwV3d *vPoint, RwV3d *vOffset, RwMatrix *pMatrix)
STRING0x718600 - char *__cdecl CStr__gtaStrCpy(const char *szSource char *szDest)
0x718630 - char *__cdecl CStr__gtaStrCat(char *szDest const char *szSource)
0x718660 - char *__cdecl CStr__gtaStrCpy(char *szDest const char *szSource)
0x718690 - DWORD __cdecl CStr__gtaStrLen(const char *szString)
0x7186B0 - char *__cdecl CStr__gtaStrReplace(char *szDest const char *szSource, DWORD dwPos)
0x7186E0 - char *__cdecl CStr__gtaUCasePtr(char *szDest const char *szSource)
0x718710 - void __cdecl CStr__gtaUCase(const char *szString)
0x718740 - void __cdecl CStr__gtaLCase(const char *szString)
2DTEXT0x719380 - void __cdecl C2DText__setSize(float fWidth, float fHeight)
0x719430 - void __cdecl C2DText__setRGBA(DWORD dwColor)
0x719490 - void __cdecl C2DText__setFont(BYTE bType)
0x7194E0 - void __cdecl C2DText__setBackgroundWidth(float fWidth)
0x719510 - void __cdecl C2DText__setShadowRGBA(DWORD dwColor)
0x719590 - void __cdecl C2DText__setShadowSize(BYTE bSize)
0x7195B0 - void __cdecl C2DText__setMinimized(bool bToggle)
0x7195C0 - void __cdecl C2DText__setBackground(bool bWidth, bool bMultiline)
0x719610 - void __cdecl C2DText__setAlignment(BYTE bType)
0 = center
1 = right
2 = left
2DRENDER0x728640 - void __cdecl C2DRender__drawBarChart(float fPosX, float fPosY, WORD wWidth, BYTE bHeight, float fPercentage, BYTE bRightBorderWidth, bool bPercentage, bool bBorder, DWORD dwForeColor, DWORD dwRightBorderColor) (from MTA's source)
SCREEN0x859520 - [float] Width scale (1/640)
0x859524 - [float] Height scale (1/448)
0x865394 - [float] Half width scale (1/320)
0x865398 - [float] Half height scale (1/224)
0x70CE30 - bool __cdecl CScreen__transform3DTo2DPoint(RwV3d *vPoint, RwV2d *vScreen, float *pMultX, float *pMultY, bool bNearClip, bool bFarClip)
0x71DA00 - bool __cdecl CScreen__transform3DTo2DPoint(RwV3d *vPoint, RwV2d *vScreen, float *pMultX, float *pMultY)
0x71DAB0 - bool __cdecl CScreen__transform3DTo2DPoint(RwV3d *vPoint, RwV2d *vScreen)
Here is the updated version according to
this script:
| CODE |
{ FUNCTIONS INCLUDED:
- getScreenXYFrom3DCoords Type: GET Description: Get screen 2D coords from world 3D coords.
- get3DCoordsFromScreenXY Type: GET Description: Get world 3D coords from screen 2D coords by a fixed distance.
- getFullScreenXY Type: GET Description: Get screen XY from current resolution.
- getLocalVarOffset Type: GET Description: Get local var offset from thread pointer. }
{$CLEO}
0000: NOP
03F0: enable_text_draw 1
while true wait 0 04C4: store_coords_to 1@ 2@ 3@ from_actor $PLAYER_ACTOR with_offset 0.0 0.0 1.0 0AB1: call_scm_func @getScreenXYFrom3DCoords 3 coords_XYZ 1@ 2@ 3@ store_to 4@ 5@ 0AB1: call_scm_func @get3DCoordsFromScreenXY 3 coords_XY 4@ 5@ distance 1.0 store_camera_to 1@ 2@ 3@ point_to 1@ 2@ 3@ 0AB1: call_scm_func @getScreenXYFrom3DCoords 3 coords_XYZ 1@ 2@ 3@ store_to 4@ 5@ 054C: use_GXT_table 'SWEET6' 0341: unknown_text_draw_flag 0 0342: enable_text_draw_centered 1 033E: set_draw_text_position 4@ 5@ GXT 'SWE6B34' end
:getScreenXYFrom3DCoords { Parameters: Passed: 0@ - position X 1@ - position Y 2@ - position Z Result: 3@ - screen X 4@ - screen Y
Example: 0AB1: call_scm_func @getScreenXYFrom3DCoords 3 coords_XYZ 2488.562 -1666.865 12.8757 store_to 1@ 2@ } 0AB1: call_scm_func @getLocalVarOffset 1 var 0 store_to 7@ 0AB1: call_scm_func @getLocalVarOffset 1 var 3 store_to 8@ 0AB1: call_scm_func @getLocalVarOffset 1 var 5 store_to 9@ 0AB1: call_scm_func @getLocalVarOffset 1 var 6 store_to 10@ 0AA5: call 0x70CE30 num_params 6 pop 6 bFarClip 0 bNearClip 0 pMultY 10@ pMultX 9@ pScreen 8@ pCoords 7@ 0AB1: call_scm_func @getScreenXY 2 coords_XY 3@ 4@ store_to 3@ 4@ 0AB2: ret 2 3@ 4@
:get3DCoordsFromScreenXY { Parameters: Passed: 0@ - screen X 1@ - screen Y 2@ - distance Result: 9@ - camera X 10@ - camera Y 11@ - camera Z 18@ - position X 19@ - position Y 20@ - position Z
Example: 0AB1: call_scm_func @get3DCoordsFromScreenXY 3 coords_XY 320.0 224.0 distance 1.0 store_camera_to 1@ 2@ 3@ point_to 4@ 5@ 6@ } 0A8D: 3@ = read_memory 0x8D5038 size 4 virtual_protect 0 // field of view 3@ *= 0.5 02F6: 4@ = sine 3@ 02F7: 5@ = cosine 3@ 0073: 4@ /= 5@ // tangent line 0A8D: 6@ = read_memory 0x865394 size 4 virtual_protect 0 // half screen X scale 006B: 6@ *= 0@ 6@ -= 1.0 0097: make 6@ absolute_float 006B: 6@ *= 4@ 0A8D: 7@ = read_memory 0x865398 size 4 virtual_protect 0 // half screen Y scale 006B: 7@ *= 1@ 7@ -= 1.0 0097: make 7@ absolute_float 006B: 7@ *= 4@ 0A8D: 8@ = read_memory 0xC3EFA4 size 4 virtual_protect 0 // screen aspect ratio 0073: 7@ /= 8@ 0087: 9@ = 6@ 0087: 10@ = 2@ 0087: 11@ = 7@ 0AB1: call_scm_func @getLocalVarOffset 1 var 9 store_to 12@ 0A8D: 13@ = read_memory 0xB6F03C size 4 virtual_protect 0 // camera matrix 0AA5: call 0x59C890 num_params 3 pop 3 pOffsets 12@ pMatrix 13@ pPoint 12@ // CPlaceable__transformPoint 006B: 6@ *= 2@ 006B: 7@ *= 2@ 0087: 14@ = 6@ 0087: 15@ = 2@ 0087: 16@ = 7@ 0AB1: call_scm_func @getLocalVarOffset 1 var 14 store_to 17@ 0AA5: call 0x59C890 num_params 3 pop 3 pOffsets 17@ pMatrix 13@ pPoint 17@ // CPlaceable__transformPoint 0AB2: ret 6 9@ 10@ 11@ 14@ 15@ 16@
:getScreenXY { Parameters: Passed: 0@ - full screen X 1@ - full screen Y Result: 0@ - screen X 1@ - screen Y
Example: 0AB1: call_scm_func @getScreenXY 2 coords_XY 512.0 384.0 store_to 1@ 2@ } 0A8D: 2@ = read_memory 0xC17044 size 4 virtual_protect 0 // full screen X 0A8D: 3@ = read_memory 0x859520 size 4 virtual_protect 0 // screen X scale 0093: 2@ = integer 2@ to_float 006B: 2@ *= 3@ 0073: 0@ /= 2@ 0A8D: 5@ = read_memory 0xC17048 size 4 virtual_protect 0 // full screen Y 0A8D: 6@ = read_memory 0x859524 size 4 virtual_protect 0 // screen Y scale 0093: 5@ = integer 5@ to_float 006B: 5@ *= 6@ 0073: 1@ /= 5@ 0AB2: ret 2 0@ 1@
:getLocalVarOffset { Parameters: Passed: 0@ - var number Result: 0@ - var pointer
Example: 0AB1: call_scm_func @getLocalVarOffset 1 var 0 store_to 1@ } 0@ *= 0x4 0A9F: 1@ = current_thread_pointer 0A8E: 2@ = 1@ + 0xDC 0A8D: 2@ = read_memory 2@ size 1 virtual_protect 0 // bMissionFlag if 2@ == 1 then 0@ += 0xA48960 // pMissionLocals else 005A: 0@ += 1@ 0@ += 0x3C // pThreadLocals end 0AB2: ret 1 0@
|
This post has been edited by Wesser on Saturday, Apr 6 2013, 14:55