Saturday, April 7, 2012

Making more plants for Skyrim - Part II: nif and in to the game

This part describes how to create nif files that have the new texture. For this you need a tool called NifScope (I have version 1.1.0-rc6). Make sure you download the RC version, it works with Skyrim nif. I follow the tutorial made by ChickenDownUnder on re-skinning meshes, it can be found on the Nexus.

The procedure is quite simple, the step in short:
  • Put the new texture and original nif file in the right folder 
  • Change texture path in NifSkope
  • Change ID and link to the new nif in the CK 
To get the original nif files unpack Skyrim.bsa, if you have not done this before, you can do it with for example BSAopt. The grass meshes are found under Meshes\landscape\grass in the BSA. Make a copy of the grass nif you want. I will use "tundragrassobj03.nif"

Depending on what you want to reskin you have to put the files in the right folders. I will put the new texture under Data/Texture/landscape/grass and the original nif file that I will reskin in Data/Meshes/landscape/grass. If I put them any place else the CK can't find the nif file later on. You don't have to have them in these folders when you work, but before making the new grass in the CK they have to be in the right folders.

Reskin in NifSkope

1. Open NifSkope and Load the original nif. In my case this is "tundragrassobj03.nif".

2. The texture path can be found under 4 BSShaderTextureSet/Textures and are indicated by a purple flower. There are two strings that define the texture path for this model, the first is the texture the other the normal.
 3. Right click on the first texture string, and select Texture/Choose and navigate to where your texture is. Now NifSkope will show the right texture, but in the case of my flowers its really hard to see anything.
If you get a long texture link that starts at the harddrive like, c:\....steam\ and so on you need to change this.  Double left click on the texture string path, remove anything before textures\landscape\grass\nameofyourplant.dds. Repeat this procedure for the normals (if you have one).
4. You can also change the name of the model, it is not necessary but will look nicer. There are two places to change the name, in 0 BSFadeNode and 1 NiTriShape. Right click on the string and choose Edit string index, then write in the name.

5. Press Save As to save the nif file.
Now you have a re-skinned nif file, the next step is to get it in to the CK.

Creation kit

Edit: 
Morcroft Darkes pointed out that the CK loads the nif models for grass (and probably all models) when it opens, so and changes made to the model when the CK is open won't show up until you close the CK and open again.

1. Open the CK, load your mod and Skyrim.esm. The grasses are found in the Object window under WorldObjects/Grass/Landscape/Grass.

2. Double click on the original grass, this will open the grass window. In ID write the name of your new grass and click the Art file Edit, choose the new nif file. Click OK, now the CK will ask you if you want to create a new object, press Yes.

3. If you want to use the new grass/flower you need to associate it to a ground texture and paint that texture somewhere (see part I on how to do that).

Save your mod and have a look in game :)

/E


4 comments:

  1. I can't seem to make this work. The grass won't allow any other textures except for the default texture. For example, if I rename my custom .nif to "tundragrass01.nif", it'll change the grass to look like tundragrass, even though the .nif, when opened in nifskope, is pointing to my custom texture. I can rename the .nif to be the same as any preexisting grass, and it reverts to that grass. I can't make custom grasses at all.

    ReplyDelete
    Replies
    1. I have no idea what could be wrong, sound really weird. Could it be a ini file setting for the editor. There is a thread on the Bethesda forum where similar problems are discussed, perhaps there is some answer there:
      http://forums.bethsoft.com/topic/1375479-new-worldspace-grass-appears-in-the-ck-but-no-grass-ingame/page__p__20807894#entry20807894
      Good luck!

      Delete
  2. Nice spring flowers and a really useful tutorial here. Helped me solve problems I was having with my own (really basic) custom grasses.

    Just one thing that took me ages to figure out - and it's not your fault! The Creation Kit seems to cache the grass nif models that are present when it loads - and won't allow you to add any that are not, or to correct any that it's already seen and thrown an error for.

    When creating or adding grasses, do it with the CK closed. Then Open the CK (like it says!) to use them. If you've made a mistake in the editing and it errors you need to close the CK; fix the error; then re-open the CK to test! Tedious but necessary.

    ReplyDelete
    Replies
    1. I have never tried to make changes to nifs with the CK open, always do the nifs in batches and them try it out. Thanks for pointing this out, I would never have run in to the problem because of the work flow I have :) I'll add it to the guide.

      Delete