1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

[WIP] .2DM editor

Discussion in 'TDU2 - Mod Tools & Support' started by kmix-rider, Nov 18, 2018.

  1. kmix-rider

    kmix-rider Member

    Messages:
    41
    Location:
    France
    Read 2DM
    Build 2DM

    Finally decided to make a gui editor rather than a file viewer. To keep modder understand what they do and to automatically rebuild files. Stay tunned. This part may be long. But we are really near the release.
     
    #1 kmix-rider, Nov 18, 2018
    Last edited by kmix-rider: Nov 27, 2018
    Reason: Release
    StarGT, binbow and MagicV8 like this.
  2. kmix-rider

    kmix-rider Member

    Messages:
    41
    Location:
    France
    ok guys just found that materials can have, also propreties list, but params. Also found that I moved from 2 bits the propreties name witch caused wrong names.

    repack successfully work but I want to be sure to read all the file data before releasing
     
    MagicV8 and StarGT like this.
  3. MagicV8

    MagicV8 Well-Known Member

    Messages:
    898
    Location:
    Drivers Paradise
    Great, that you are working on this, thank you for your effort :tup:
     
    kmix-rider likes this.
  4. kmix-rider

    kmix-rider Member

    Messages:
    41
    Location:
    France
    File structure found for the moment

    <var name='version' type='ushort' must_equals='4' />
    <unu size='6'/>
    <var name='fileSize' type='ulong' />
    <var name='fileType' type='uchar' size='8' must_equals='.2DMMATA' />
    <unu size='4' />
    <var name='footerOffset' type='ulong' />
    <var name='unknow1' type='ulong' must_equals='16' />
    <var name='HASH' type='uchar' size='4' must_equals='HASH' />
    <unu size='4' />
    <var name='matnum' type='ulong' operation='($matnum-16)/16'/>
    <var name='matnum2' type='ulong' operation='($matnum-16)/16' must_equals='$matnum' />

    <repeat '$matnum' marq='#'>
    <var name='Material#.name' type='uchar' size='8'/>
    <var name='Material#.offset' type='ulong'/>
    <unu size='4'/>
    </repeat>

    <repeat '$matnum' in_order='$Material#.offset' marq='#'>
    <var name='Material#.header' type='uchar' size='4' must_equals='MAT.'/>
    <unu size='4'/>
    <var name='Material#.unknow1' type='ulong'/>
    <var name='Material#.unknow2' type='ulong' must_equals='$Material#.unknow1'/>
    <var name='Material#.offname' type='uchar' size='16'/>
    <var name='Material#.fullname' type='uchar' size='32'/>
    <var name='Material#.headerUnknow' type='uchar' size='128'/>

    <repeat '4' marq='&'>
    <var name='Material#.color&.r' type='float'/>
    <var name='Material#.color&.g' type='float'/>
    <var name='Material#.color&.b' type='float'/>
    <var name='Material#.color&.a' type='float'/>
    </repeat>

    <unu size='12'/>
    <var name='Material#.numpropreties' type='ushort'/>

    <repeat '$Material#.numpropreties' marq='&'>
    <var name='Material#.proprety&.paramtype' type='uchar' size='8'/>
    <var name='Material#.proprety&.paramname' type='uchar' size='8'/>
    <var name='Material#.proprety&.unknow' type='uchar' size='16'/>
    </repeat>

    <var name='Material#.unknowfooter' type='uchar' size='until next or $footerOffset'/>
    </repeat>

    <var name='footer' type='uchar' size='until filend' print />

    <!-- var name='gap' type='uchar' size='until %16' -->


    if anyone want to work on it also here what I've found so far.
    I continue working on my way.
     

Share This Page

  • About Us

    Started back in 2007, our community has been around for a good while and throughout all this time our core focus has been to provide a fun and laid back place for the discussion of driving and racing games and gaming in general, along with freqent automotive and motorsport related chat too. So, no matter what style of player you are, from arcade thrills to hardcore sim-racer or free roam explorer to circuit hot lapper, if it's about driving or racing in some form then we're up for talking about it. And if you are a keen photo moder, virtual photographer, video creator or streamer, then feel free to share those too. Cheers!
  • Support our community!

    Running and maintaining a community like this is hard work, especially when it's done by a bunch of idiots! And so, if you enjoy visiting here and would like to help us out. We would really appreciate it! Thanks.

    Feed the duck!