Current cockpit POV in XWA's heap?

Want to edit the game, build your own craft and missions? Here you'll find help, tools, guides and people to discuss with.
Post Reply

Current cockpit POV in XWA's heap?

User avatar
blue_max
XWAU Member
Posts: 2296
Joined: Wed Mar 20, 2019 5:12 am

Post by blue_max » Tue Mar 03, 2020 11:00 pm

Just wondering if anyone knows where XWA stores the current cockpit camera POV in memory? I know these numbers can be written to the EXE file itself (at least I think that's what MXvTED does); but I guess they should also be loaded in the heap at some point.

I know there's the "PlayerDataTable[playerIndex].cockpitX/Y/Z/Reference" variables; but are they the same thing that MXvTED writes?

Justagai
Cadet 1st Class
Posts: 218
Joined: Mon Dec 08, 2014 10:59 pm

Post by Justagai » Wed Mar 04, 2020 1:10 am

The cockpit camera position is in the CraftDefinition struct/table. Table starts at 0x5BB480 and offsets (2 bytes) 0x238, 0x23A and 0x23C for the cockpit Y, Z and X positions. This is per craft by the way and that's how MXVTED read/writes them.

EDIT: Actually I suspect the player's current cockpit position might be stored on the PlayerDataTable in offsets (4 bytes) 0x201, 0x205 and 0x209. But I'm not entirely sure.

User avatar
JeremyaFr
XWAU Member
Posts: 3998
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Wed Mar 04, 2020 5:13 pm

Justagai wrote:
Wed Mar 04, 2020 1:10 am
EDIT: Actually I suspect the player's current cockpit position might be stored on the PlayerDataTable in offsets (4 bytes) 0x201, 0x205 and 0x209. But I'm not entirely sure.
The cockpit position is stored in offsets 0x20D, 0x211, 0x215.
After it has been transformed with the transform matrix in the MobileObject struct (offset 0xC7), the transform position is stored in offsets 0x201, 0x205, 0x209.

User avatar
blue_max
XWAU Member
Posts: 2296
Joined: Wed Mar 20, 2019 5:12 am

Post by blue_max » Wed Mar 04, 2020 6:57 pm

Thanks guys!
JeremyaFr wrote:
Wed Mar 04, 2020 5:13 pm
The cockpit position is stored in offsets 0x20D, 0x211, 0x215.
After it has been transformed with the transform matrix in the MobileObject struct (offset 0xC7), the transform position is stored in offsets 0x201, 0x205, 0x209.
I guess these are still PlayerDataTable offsets, right?

User avatar
JeremyaFr
XWAU Member
Posts: 3998
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Wed Mar 04, 2020 7:16 pm

Offsets 0x20D, 0x211, 0x215, and 0x201, 0x205, 0x209 are in the player data table.

Bman
Lieutenant Commander
Posts: 1170
Joined: Mon Apr 05, 2004 11:01 pm

Post by Bman » Thu Mar 05, 2020 9:02 am

I have a cheat sheet spreadsheet I made so if you need the specific offsets for a given craft slot, it can save some time. I have DSUCPv2.6 installed so there is more stuff. Here is example for Escort Shuttle, if it's relevant to what you're needing:
EscortShuttleTable.png
.
.
You do not have the required permissions to view the files attached to this post.
W-I-P: TFTC, MC Viscount Cr., ISD-II Avenger, NL-1 Platform, Ton-Falk Esc. Cr., & Misc.

Post Reply