This is a read only copy without any forum functionality of the old Modcraft forum.
If there is anything that you would like to have removed, message me on Discord via Kaev#5208.
Big thanks to Alastor for making this copy!

Menu

Author Topic: [QUESTION] obj0 structure 4.X  (Read 1325 times)

Buddiman

  • Registred Member
  • BLP Convertor
  • *****
  • Posts: 13
    • View Profile
[QUESTION] obj0 structure 4.X
« on: February 17, 2011, 09:32:08 pm »
Hey,

I'm atm working on an obj0 Editor for 4.X Files and I have some Problems with the MDDF-Chunk.

As struct use ich atm:
uint32 Signature;
uint32 Size;

Then for every M2-Entry.
Code: [Select]
uint32 mmidEntry;
uint32 uniqueId;
float position[3];
float rotation[3];
uint16 scale;
uint16 flags;

With this information an M2-Block has 36 Bytes, but if you look in a file you can see that this is not enough. If my calculation is right, an M2-Block has to be 340 Bytes long which would mean much more Data. Maybe here someone has the right structure and give it to me or can me give a tip how to find it trough disassembling.

Greetz
Buddi
« Last Edit: January 01, 1970, 01:00:00 am by Admin »
Greetings
Buddiman


schlumpf

  • Administrator
  • Creator of Worlds
  • *****
  • Posts: 2967
    • View Profile
Re: [QUESTION] obj0 structure 4.X
« Reply #1 on: February 18, 2011, 08:17:00 pm »
The given structure is correct. Its an array of entries. Divide the chunk size by sizeof(MDDFEntry) to get the count. If that number is not an integer, tell me again, that its wrong. Unless this is not the case, this structure is correct. 340 bytes per entry would be stupid and will not be the case.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

Buddiman

  • Registred Member
  • BLP Convertor
  • *****
  • Posts: 13
    • View Profile
Re: [QUESTION] obj0 structure 4.X
« Reply #2 on: February 24, 2011, 09:29:59 pm »
Ok it was my fault. Very stupid fault I have made, sry. I calculated sizeof(MDDF)*numberof(filenames). But actually there can be more than one MDDF Block for one Filename.

With this fixed, I can use my tool. But when I try to change an existing WMO, this happens ingame:


The filepath is not wrong, I have checked it with a Hexeditor. Is there something like a boundingbox that I need to change? Maybe the MCNK-Chunk in the obj0-Files, even now I don't know exactly what they do, only that if there is no entry no Model gets spawned.

Maybe someone had the same error or has seen it somewhere
« Last Edit: January 01, 1970, 01:00:00 am by Admin »
Greetings
Buddiman