Saturday, August 18, 2012

Making the walkmesh and ground be two different levels

Kivinen ( http://www.kivinen.iki.fi/nwn/ ) made a number of utilities for manipulating nwn/nwn2 files. SGK73 figured out how to use the trnpack and trnunpack utilities to have an area with a walkmesh different than the visible ground, which he used to create snowdrifts for a player to walk through. There's a screen from SGK73's area to the right. The original area that came from is here:  http://nwvault.ign.com/View.php?view=NWN2PrefabAreas.Detail&id=253

SGK73 explained how he did on that page, but it wasn't clear for me. I've put his original comments in italics, and mine in regular. I rewrote parts 8 through the end for more "I need to be told exactly", which I personally needed :-)


First you need to work in a directory for this to work, you should be anhyway because it's alot more stable saving than a mod file and alot faster.

1:make base terrain, gound level without snow.

2:plot the walkable tiles

3:place helper objects the "Sunken City {Ruins 01 (X1) TINT}" scaled to 0.2264802; 0.2264802; 0.2264802 is a good choice since the bevel on it coincides with an average humans hip and the top of a minimal halflings head. Place these, lot of them, all over the walkable area and some on paths leading out of the area. Position lock all of them.

SGK is doing this to get a good snow height, if you are doing other things you may not need to do this.

4:bake this area and duplicate it, do not delete it as you will need it later when you need to modify the walkmesh.

5:in the duplicated area use Raise, Lower and Smooth to create snowdrifts and snowlayer. A size 1 brush with a large falloff of about 8-15 or so depending on the area being raised, with about 5 to 15% pressure.
Basically, make your intended visible ground.

6:save and close the toolset, this was neccesary atleast for me since
the files was locked by the toolset it seems, atleast it crashed:).

7:***BACKUP YOUR MODULE***


8: In windows explorer, make a tmp folder in /modules or on the desktop or wherever, copy
the [area_of_walkmesh_to_use].trx to the tmp dir

9. If you haven't already download trnpack.exe and trnunpack.exe from http://www.kivinen.iki.fi/nwn/downloads.html . Save them into this tmp folder.

10: Open up a command prompt, and from the command prompt navigate to where your tmp folder is, and unpack your trx with the command: trnunpack [area_of_walkmesh_to_use].trx

11: In windows explorer, in this tmp folder there now should be a file called [number].aswm, copy this file somewhere safe as it is the walkmesh you will insert into the other area, delete the other files including the .trx you copied, make sure that you copied it and not moved it. (it didn't seem to matter if you copy or move for me)

12: In windows explorer, copy the [area_of_visible_ground_to_use].trx to the tmp dir and unpack it with trnunpack (same command), In windows explorer, delete the [number].aswm copy the other first .aswm file that you saved elsewhere, to this dir.

13: In windows explorer, make a folder in this tmp folder, call it area1. Move all the non trx files from your tmp folder into this area1 folder.

14: From the command prompt use trnpack with the -d and -o switches to pack all the files together in a new .trx. The command is: trnpack -d area1 -o [area_of_visible_ground_to_use].trx . The -d area1 tells the program what folder to look in, the -o (the letter o) part tells the program what to name the trx file it creates. The file will be created in the same folder as the trnpack program (in this example, the tmp folder).

15: Copy the resulting .trx file from the tmp folder to the original module folder, and overwrite the original trx.

16: Run the module. (you can safely load the module in the toolset and run it via the toolset).

17: Say "Thank you Kivinen and SGK73!" This step is optional, but highly encouraged :-)

1 comment:

  1. Hi Kamal,

    I use a few of SGK73 areas in my modules ... the latter two modules. I was very impressed with what I saw and was a contributing reason as to why I accepted prefabs in my own work.

    Knowing you are also a good area builder, it does not surprise me that you mention their work here now. All the best with this!

    Lance.

    ReplyDelete