.LUA, .XET, .TET - nbreeze/closers-rev GitHub Wiki

.TET

[TODO]

.XET

.XET defines a Lua dictionary that specifies some special properties and behavior for an asset.

Majority of .XET data is stored in a dictionary in XET_TABLE_*.LUA files, however there are a few standalone .XET files laying around. The standalone .XET files follow the same scheme with the m_DeviceID field omitted.

Fields:

  • m_DeviceID - a special identifier given to the .XET data. Omitted in standalone files.
  • m_mapTexChange - for textures, an array of tables that specify properties for a single texture.
    • m_OrgTexName - the name of the texture to target.
    • m_ChangeTexName - the name of the texture to replace the targeted texture with.
    • m_MaskTexName - the name of the texture's mask file. Used with DirectDraw Surface (.DDS) files.
  • m_mapTexAnimSeq - for textures, an array of tables that specifies animation properties for a single texture.
    • m_TexName - the name of the texture to target.
    • m_TexAnimSeqName - the name of the animation sequence to bind the texture to. Animation sequences are defined in TEX_ANIM_*.LUA files.
  • m_mapAnimSound - for animations, defines an array of sounds that should be played in an animation.
    • m_AnimName - the name of the animation to bind to.
      • m_fEventTime - time that the sound event should play.
      • m_vecSoundName - array of sounds that can be played at this event.

Texture Swapping

One of the use cases of this file is to map a model's texture with another specified texture for a specific asset, via the m_mapTexChange property. The most obvious example of this in use are variants of Clothing/Accessory sets in the game.

Let's take a peek on one of these entries. This is an entry taken from XET_TABLE_CHARACTER.LUA. It defines .XET data under the name 301228904_GUST_USER_AEGIS_CLOTH_80_B_EP_AVATAR_DEFENCE_UPBODY.XET.

  {
    m_DeviceID = "301228904_GUST_USER_AEGIS_CLOTH_80_B_EP_AVATAR_DEFENCE_UPBODY.XET",
    m_mapTexChange = {
      {
        m_OrgTexName = "301228804_GUST_USER_AEGIS_CLOTH_80_A_EP_AVATAR_DEFENCE_UPBODY01.PNG",
        m_ChangeTexName = "301228904_GUST_USER_AEGIS_CLOTH_80_B_EP_AVATAR_DEFENCE_UPBODY01.PNG"
      },
      {
        m_OrgTexName = "301228804_GUST_USER_AEGIS_CLOTH_80_A_EP_AVATAR_DEFENCE_UPBODY02.PNG",
        m_ChangeTexName = "301228904_GUST_USER_AEGIS_CLOTH_80_B_EP_AVATAR_DEFENCE_UPBODY02.PNG"
      }
    },
    m_mapToonTexChange = {
      ...
    }
  }

The referenced textures:

A B

Recognize this costume piece? It's Luna's Royal Winter Chest [B].

A B
A B

It should be obvious, but m_OrgTexName specifies the texture to be replaced on the model, and m_ChangeTexName is the new texture to use. In this case, Royal Winter Chest [B] is just Royal Winter Chest [A] with textures swapped.

In an DirectX .X file, a mesh vertex can only be assigned one texture and only one. When it comes to variants, usually the mesh vertices are assigned to variant A's material. If you want to swap a material while using the same model, you can either make a copy of the .X file with materials swapped (redundant), or swap the materials dynamically in-game (efficient). The latter is what this file is used for.

TODO: m_mapUVOffset

Animation Sound Events

.XET data is also used to define sounds to be played during an animation via the m_mapAnimSound property.

[TODO]