Skip to content

1.33 object data#76

Open
Promises wants to merge 2 commits intoChiefOfGxBxL:release-4.0.5from
Promises:fix/1.33-obj-data
Open

1.33 object data#76
Promises wants to merge 2 commits intoChiefOfGxBxL:release-4.0.5from
Promises:fix/1.33-obj-data

Conversation

@Promises
Copy link

I cant figure out what branch to target @ChiefOfGxBxL (fixes from @cipherxof mdx-m3-viewer)

@ChiefOfGxBxL
Copy link
Owner

@Promises I created a new release-4.0.5 branch that you can target.

@Promises Promises changed the base branch from master to release-4.0.5 December 31, 2023 00:18
modification.column = outBufferToJSON.readInt();
for (let set = 0; set < sets; set++) {
if(fileVersion >=3) {
setsFlag[set] = outBufferToJSON.readInt();
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is setsFlag information we want to store in the JSON object to write it back to a w3-file later?

It doesn't look like you're using this variable anywhere.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could probably remove as we don't patch existing object Giles, only generate new ones

modification.type = this.varTypes[outBufferToJSON.readInt()]; // 'int' | 'real' | 'unreal' | 'string',
const originalId = outBufferToJSON.readChars(4);
const customId = outBufferToJSON.readChars(4);
let sets = 1;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also can you clarify since I haven't looked at a 1.33 object data diff: the entire modification table is now wrapped in an additional loop? What do the sets represent?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not really sure, I'll have to do some research, this was copied from mdx-model-viewer

Copy link
Owner

@ChiefOfGxBxL ChiefOfGxBxL Dec 31, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yea if you could also dig around to figure out what it is, that would be useful.

Here's an experiment I did:

  1. Create a new map in World Editor
  2. Modify the (human) Peasant original object - edit just one field, in my case base damage
  3. Annotate the bytes in the .w3u file to check for new data

I am seeing some new bytes that aren't accounted for in the version 2 of the parser:

03 00 00 00  :: version 3

01 00 00 00  :: num table modifications (original)

:: modification table 1 - Peasant
68 70 65 61  :: "hpea" (human peasant)
00 00 00 00  :: custom id - 0 = original object
01 00 00 00  :: modifications to this object: 1

00 00 00 00  :: <<<< NEW 4 BYTES ??
01 00 00 00  :: <<<< NEW 4 BYTES ??

  :: modification 1 - Peasant - Base Damage
  75 61 31 62  :: mod ID: "ua1b" (unit attack 1 - base damage)
  00 00 00 00  :: mod type: 0 = int
  0C 00 00 00  :: value = 12 (base damage updated to 12)
  68 70 65 61  :: "hpea" (repeated object ID)

00 00 00 00  :: num table modifications (custom)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants