The general structure of a DAT-file is:
Code:
- material
- (optional) embedded image
- texture map (set to: Ambient Occlusion)
- (optional) embedded image
- root node
- model
- label (name of node/model)
- controllers (f.ex. UnifiedRenderControler)
- subnodes
Whenever building new DAT-files, it is best to use an existing file that matches the layout of the unit/object you are building. For interiors, you pick an interior file. For a ship, you pick a ship-file. Then you strip it down to a bare minimum and build from there. I tend to copy alot from other files too by using CTRL+SHIFT+C (copies selected subtree structure instead of just a single chunk).
For the AO-map, when using Max, you must ensure you use the correct import function (import UVW-file for AO-map, instead of extra OBJ-files). Obviously, you must have exported the UVW-file from Max.
So you have:
- model.OBJ (main model)
- model-uv2.UVW (AO-map)
The extra channels 3, 4 can be forgotten. The game does not use them, and they are left overs from the devs (iow. channels they used during design of the models).
If you have an AO-map, you must have the UnifiedRenderControler. Again, check existing DAT-files on where to place the controller. It should be a child of the root-node, and placed before any subnodes, but after the label/model.
Last, the order of each chunk is very important (a treenode = chunk). The order is indicated by the number in the name (and seen at the top of each chunk-page). You can move chunks up/down in this order using the green arrows. Again, check existing DAT-files (or reuse them) for the correct order.
Quote:
Originally Posted by Hans Witteman
I badly need help i get this error message from Sh3 after saving : ``the node is referencing a material but the index of the material is higher than the index of the node``.
|
This message indicates that the material-node is placed after the node that references it. Look at the number in the name of each treenode. If f.ex. the material it's number is 10 but the node that uses it has number 7, you get this message. Correct this by moving the material (and it's subnodes) to the top of the file using the green up/down arrows.
[edit]
Final note: before importing an OBJ-file, you MUST have set up the DAT-file with all the materials (use the same name or order as in Max), and have those materials assigned to the node that 'hosts' the model-chunk (the one you import into). If not done, the import may succeed, but will not yield correct rendering in most cases.
Hope this helps,
skwas