User Tools

Site Tools


building:xdata_mapping

XDATA Mapping - A Comprehensive Guide

Editor's Notes: Formatting has also been altered from the original forum page to account for the wiki's formatting rules.

Original Author: A Wicked Presence

Original Thread:https://forum.sinfar.net/viewtopic.php?f=33&t=16129

While the results of messing around with the mapping can be both impressive and downright scary, it's quite very much worth a try considering the theoretically infinite results you can achieve when it comes to even more customization. That said, 'trying' is what it eventually comes down to, given that it's a trial and error thing most of the time. Some textures won't work on some placeables or visual effects, some won't even show up, others look entirely different than what they were meant to. I haven't seen any in-depth guide so I thought I'd fill the gap to perhaps make it seem a little bit easier.

You'll be needing three things:

TheXDATA webpage.

NWNExplorer, which you can download from here.

The 2da with the placeables list. In your NWN install under hak files.

Editors Note: The 2da with the placables list that's readable is in the “top” hak file for Sinfar. Do not go looking in the placables hak files, as they are too large to edit by hand at this point. You should find this hak file in your hak directory, usually something like: C:\Program Files\GOG Games\NWN Diamond\hak and the current name of the top most hak file is sf_top_v27.hak.

v27 refers to the version of Sinfar currently running as of time of this writing.

I. The first step is to figure out the ID of the item you will be editing and the ID of the target texture, to get the resref:

hed8zkh.jpg posykt2.jpg foeitjp.jpg

  1. As an example, we'll go with “Carpet: Rug 16” for the placeable, the default curved horns “horns_curved” for the accessory, and a lava texture from the “Floor: Lava 1 1×1” placeable.
  2. For a placeable, note down its toolset name and open the 2da file above with your notepad application of choice. Press Control + F or go to “Edit” and “Find …” to search for the name of the placeable you want, in this case “Carpet: Rug 16” and “Floor: Lava 1 1×1”.
  3. The first column to the right should show the placeable's resref which you'll need for the next step; note that down! The resref for “Carpet: Rug 16” is “pmi_r01”. For “Floor: Lava 1 1×1” it'll be “zlc_flr_lava_x1”.
  4. Accessories skip to the next step.

II. Now that you have the resref of the placeables, you'll need their texture's bitmap:

  1. Download the NWNExplorer file and place it in your NWN installation folder. Launch it as Administrator just in case and press Control + S (sometimes it works with Control + F) to have the search box pop up. Type the placeable's resref you noted down before and press enter, then wait for a result to show up then double click on it.
  2. Once the model loads, you'll see several tabs under it: click on ASCII Model. You'll see a boatload of text, so scroll down until you can find the word “bitmap”. The ID to the right is the texture's name, note that down! For “pmi_r01” you'll get “tni01_burlap” as its texture's bitmap. For “zlc_flr_lava_x1” it will be “tde01_lava01”.
  3. It can get a little trickier with accessories and visual effects. Sometimes the name displayed In Game is the same as in the haks, and sometimes it isn't. For example, the horns I chose show up as “horns_curved” IG, “hfx_horn_01_af” in the haks which presumably stands for “head vfx, horn 1” etc.
  4. To find an accessory's ID, open NWNExplorer and search for the IG reference, and see if it works. If it does, a result will come up, if it doesn't you'll have to try manually.
  5. The vast majority of accessories are stored in the “sf_effects_v27.hak” file. Click on the “Open” button and find that file. Once it's opened, click on “Models” and search through those options. While the name won't be the same, it should still hold some coherence. Once more, double click on it and wait for it to load, click on ASCII Model and find the bitmap ID. For these horns, it's “horn_01”.

III. Replacing the texture on the original item with the end texture, using XDATA:

  1. Open the Sinfar XDATA webpage.
  2. If you have any size, position or orientation adjustments you can leave them as they are because they won't get affected. Color changes -WILL- alter the retextured item.
  3. Go down to Textures Mapping (Resref): Under “from”, add the bitmap of the item you want to change, whether it's the placeable or the accessory (the rug: tni01_burlap, the horns: horn_01). Under “to” add the target texture that you want to apply (the lava, in this case: tde01_lava01) and click on the “Add” button.
  4. Once it has been added, click on the “Generate” button so you get that nice and long line of XDATA numbers, copy all of that!
  5. For a placeable, make sure it's set as “Static” otherwise any XDATA adjustments won't apply. Add a STRING variable named XDATA, and paste those numbers.
  6. For an accessory, go to the adjustment menu In Game and click on the “Set the adjustments string” option, paste those numbers in and apply.
  7. You should have successfully re-textured your item of choice:

wrv269o.jpg 3ixccsw.jpg

A few things worth mentioning:

  • Accessories that can have their Metal/Leather/Cloth colored and overwritten (everything that doesn't use the RGB/Transparency/Saturation system) can't be remapped.
  • Again, placeables must be set as STATIC, otherwise it won't work.
  • NWNExplorer can be rather buggy, especially with Windows 10. The contextual menus can make the app crash instantly, and it will most likely require a proper installation of NWN, or at the very least the registry key with the folder's location. If you can't make it work, send me a message either here on the forums or over Discord, and I'll help you fix it.

Additional Notes:

Added by Spankitty:

Additionaly a little picture from another xdata topic to clarify even better where to find the bitmap once you opened the model in the browser.

browser_1.jpg

Added by Twimitar Silque:

Good guide: concise, straightforward, and at the end, you get lava horns! Another time-saving guide is coldest's Textures database: loads of textures and patterns with their bitmap resrefs already looked up.

https://forum.sinfar.net/viewtopic.php?f=315&t=14318

Added by Ghengra:

Something that might help to navigate in NWN Explorer…when you search for a resource by name, it searches from the top of the list to the bottom. So, to save a bit of time, if you know that the resref is in the custom haks for example, you can click on “NWN Hak Files”, then Ctrl+S + type the name + Enter and it'll start the search there and skip all the vanilla NWN resources.

building/xdata_mapping.txt · Last modified: 2019/09/01 12:44 by LockOn