Jul 21, 2006 at 5:30 PM
Join Date: Jun 18, 2006
Location: Montreal, Canada
Posts: 581
Age: 40
I'm leaving for a few weeks today, so I figured I'd dump my latest finding here for anyone who wants to pick away at it.
The animated effects (the "spark" when a shot hits a wall, the sparkles when you hit your head..) are all stored exactly like NPCs and weapons: via assembly and indexed by pointer tables. The pointer table is located at 0x008F8C0 in the EXE (as with any x86 pointers, they're 4 bytes in length.)
Unlike weapons and NPCs, the code behind animated effects is generally much simpler to work with and is a good place to start. Each function is passed (via the stack) a pointer to a structure containing information on the animation. Here's the structure (0x44 bytes in length; missing info is currently unknown.) Each member of the structure is 4 bytes in length.
0x00 InUse (set to 0x00000080 if in use, otherwise can be picked next time the game is looking for a free structure to use.)
0x04 ID (ie, which animation type; used as an index into the pointer table only)
0x08 Direction (as with any other direction... 0 left, 1 up, etc)
0x0C X Position
0x10 Y Position
0x14 X Velocity
0x18 Y Velocity
0x1C ?
0x20 ?
0x24 Frame ID (which frame to display)
0x28 FrameTimer (controls the delay before a frame changes)
0x2C X position offset
0x30 Y position offset
0x34 Bounding rect of the frame to display (Left)
0x38 Bounding rect of the frame to display (Top)
0x3C Bounding rect of the frame to display (Right)
0x40 Bounding rect of the frame to display (Bottom)
It will take a bit of assembly experience to modify these. But if this isn't something you can do, you could always change entries in the pointer table and have different animations substituting the original ones (ie, a puff of smoke when bumping your head on the ceilling.)
The animated effects (the "spark" when a shot hits a wall, the sparkles when you hit your head..) are all stored exactly like NPCs and weapons: via assembly and indexed by pointer tables. The pointer table is located at 0x008F8C0 in the EXE (as with any x86 pointers, they're 4 bytes in length.)
Unlike weapons and NPCs, the code behind animated effects is generally much simpler to work with and is a good place to start. Each function is passed (via the stack) a pointer to a structure containing information on the animation. Here's the structure (0x44 bytes in length; missing info is currently unknown.) Each member of the structure is 4 bytes in length.
0x00 InUse (set to 0x00000080 if in use, otherwise can be picked next time the game is looking for a free structure to use.)
0x04 ID (ie, which animation type; used as an index into the pointer table only)
0x08 Direction (as with any other direction... 0 left, 1 up, etc)
0x0C X Position
0x10 Y Position
0x14 X Velocity
0x18 Y Velocity
0x1C ?
0x20 ?
0x24 Frame ID (which frame to display)
0x28 FrameTimer (controls the delay before a frame changes)
0x2C X position offset
0x30 Y position offset
0x34 Bounding rect of the frame to display (Left)
0x38 Bounding rect of the frame to display (Top)
0x3C Bounding rect of the frame to display (Right)
0x40 Bounding rect of the frame to display (Bottom)
It will take a bit of assembly experience to modify these. But if this isn't something you can do, you could always change entries in the pointer table and have different animations substituting the original ones (ie, a puff of smoke when bumping your head on the ceilling.)