Zone Tutorials by Duckling
Zone Tutorials by Duckling
Rev 2
Table of Contents
Creating Textures................................................... 1
Importing Textures................................................. 2
SpotData and QMP................................................. 5
Animated Textures..................................................8
Single Model Door................................................ 11
Door Relation Code.............................................. 15
Creating Textures
Download image editing software.
Recommended: Paint.Net [here] As it properly creates .dds texture files
Alternative: Gimp [here] works pretty well, easier to use. Has some issues with .dds that
may cause problems when stacking textures on top of eachother.
After creating a texture to use, you must export it in the DDS file format.
On Export you would follow these settings.
Compression: BC3/DXT5
Mipmaps: Generate Mipmaps
Importing Textures
Download preferred Blender version through 2.8 and 3.6
Download and install the NifTools plugin for Blender [here]
Compatible with Blender 2.8-3.6. NOT compatible with Blender 4.0.
Open Blender and go to Edit > Preferences > Add-Ons and install by selecting the zip file you
have downloaded. Then enable the plugin.
Create a model and then enter the Scene Properties and open the NifTools Scene Panel to
select the game, Shin Megami Tensei: Imagine.
Extract the model you just created by going to File > Export > (.nif)
Add the new model you just created to the template by right clicking the NiTriShape then going
to Block > Copy Branch
Open up the template nif and select the NiNode and right click then Block > Paste Branch
You can edit the Translation which is moving the object around the scene, Rotation of the object,
or the Scale by clicking on the NiTriShape
When duplicating a block in Block > Duplicate Block or importing multiple of the same object
You would have to right click String > Edit String Index and make a new entry by typing in a new
name and pressing Ok
You can clear any unused String values by right clicking Optimize >
Remove Unused Strings
To apply a texture you would, Navigate to Node > Attach Property > NiTexturingProperty
[do NOT use NiTextureProperty, it will not work]
Right click the NiTexturingProperty then navigate to Texture > Add Base Texture and select the
.dds file that was created earlier.
Select the newly generated NiSourceTexture then right click it Texture > Embed to apply the
texture to your object.
Select NiSourceTexture again and go down to FilePath, Right click and select Edit String Index
to change the string to not include your PC’s file path. For privacy's sake do not forget to clear
unused strings.
Open DynamicMapData.bin
comp_bdpatch load dynamicmap DynamicMapData.bin DynamicMapData.xml
Add a new entry with the Map ID you plan to use. Add the SpotData file you just made under the
spotDataFile member.
Build the floor layout of your zone using planes, but make sure they’re all built to size in
the modeling software as NifSkope’s resizing will not work for future steps.
Required material from this point onwards are.
3dsMax 2016
3dsMax NifTools Plugin [here]
QMP Import/Export scripts [here] (Created by Fizzy, Revised by Duckling)
DO NOT MOVE AROUND THE MODEL IN 3DS MAX, IT WILL MISALIGN EVERYTHING
Import the Nif of the floor layout file you have just made in NifSkope with File > Import
We are going to begin generating the QMP file which dictates where the player is able to
move within the playable area.
In 3dsMax go to Create > Shapes > Line then begin outlining the entire playable area
you just created. But every surface needs a new line.
a. Click on the corner, go to the next corner, click, right click, click again.
Doing this will create a line on the surface and start creating a new line immediately after to do
the next line.
When you are finished outlining the entire floor, Delete the floor layout but keep the lines
you just created. Then go to Scripting > Open Script… and locate the QMP Exporter.
With the QMP Exporter open press CTRL+E and save the xml file.
Open the XML that was just created and replace all the IDs with 1, since they're set to 0
by default and that will break player movement.
The script currently is unable to handle NavPoints so they will have to be dealt with manually.
The QMP file and NIF file will be placed inside your GameFiles > Map > Zone > Model
Open the zone in Comp_Cathedral through the file you created in ServerFiles >
Datastore > Zones
Zone in and select the corner you'd like to start at, and at the bottom left there will be
coordinates that you will use to create your navpoints.
Convert the xml into a bin again then do View > Refresh to get a more reliable update on
your progress… comp_bdpatch save qmp ExportedFile.xml ExportedFile.bin
Animated Textures
To start off, this is not the most optimal way to do it and may bloat up the file size of your map
more than necessary.
You first need a texture, which I recommend 128x1024 (8 frames) or 128x2048 (16 frames).
Each frame of the animation will be 128x128 in size and if you have any leftover space I
recommend just copying the last frame to fill out the remaining spaces.
With the texture made and exported as a .dds file, I imported a model I would like to apply an
animated texture to into my zone in nifskope. I used a 16 scaled plane for the demonstration,
but it will work on any model.
Remember to add all the basic properties to your object like the NiColorExtraData and
NiMaterialProperty,
With an optional property NiVertexColorProperty set to “Emissive + Ambient + Diffuse” and
Vertex Mode set to “Source Ambient/Diffuse” in the flags.
To start off with preparing the model, click on the NiTriShape, then Flags and have Hidden
unchecked with Collision Detection being Triangles that has Lighting
After that is done right click the NiTriShape then navigate to Node > Attach Property
And add a NiTexturingProperty to the object.
With that NiTexturingProperty you will apply the texture you just made by right clicking the
NiTexturingProperty, Texture > Base Map and selecting your texture. Note: DON’T EMBED
Then you will have to go back to your NiTriShape, Right Click it and Texture > Edit UV
With this screen open you will have to select the two right points and move them to the left until
a single frame fills the object.
After the texture is set. I would go back to NiTexturingProperty, navigate down to Base Texture
within the details of the node, and change the flag to have Clamp Mode be “Wrap Both”, and
Filter Mode be “FILTER_BILERP_MIPNEAREST”
Then just above that in the details you will see a Controller with a green plus next to it. Click that
and add a NiTextureTransformController.
In NiTextureTransformController, Edit the flag then check Active and set the Loop Mode to
“Cycle”
Stop Time depends on how long the animation you are using is.
To calculate this do 0.15 x (# of Frames)
You would then go down to Texture Slot and make sure it is set to BASE_MAP, then edit the
Operation to be “TT_TRANSLATE_U”
Go up to where it says Interpolator, press the green plus and add a NiFloatInterpolator
Open up Data and where it says Num Keys, edit that value to be how many frames your
animation has. Then edit the Interpolation to be “CONST_KEY”
Press the green refresh symbol and open up all the Keys. These will be the individual frames of
your animation.
For some preliminary information. The first key should always be set to 0. And if the animation
ends up playing backwards try setting all the Value’s for each frame to be negative.
Now with that said, move onto the 2nd key, set the time to 0.15 and the value to 0.125.
If the UV is aligned properly this will immediately snap to the next frame.
Move on to the 3rd key, and start adding up, by setting the Time to 0.3 and the value to 0.25
You will keep doing this and increasing the Time by 0.15 and Value by 0.125 for every key until
they are all filled out.
The animation may not look right and may be skipping in nifskope. But if built properly then in
game it will be playing smoothly.
Creating Doors
Create a model of your door and open it in nifskope
You will have one TriShape per door, Each will have to be set up the same way as the other.
Add your texture, NiColorExtraData, MaterialProperty, and any other properties you need.
In NiTriShape navigate to the Flags, make sure Hidden is not checked and set the Collision
Detection to “Triangles”.
Scroll down and open Material Data, then set Has Shader to Yes
Right-Click Shader Name and edit the string to be COE_Blender then change the Extra Data to
4
Now right-click each NiTriShape, navigate to Node > Attach Parent Node and apply a NiNode
This NiNode will be the door, so you want to name it accordingly. i.e. “Door01” which I will refer
to it as from this point onward. (If model has 2 doors, name the other “Door02”)
In Door01 you would want to change the Flags to have Hidden unchecked, Collision Detection
is “Continued” and Skin Influence is checked.
Scroll down to Num Children, make sure it is set to 1 and that the Children below that is pointing
towards the NiTriShape
You will now name this NiNode the same thing as what your nif file will be called, with
NonAccum at the end. i.e. “CustomDoor_001_door_01 NonAccum”
If you have a model with 2 doors, You would instead rename the first NiNode/Scene Root
Now in the NonAccum you would want to edit the flags to have Hidden unchecked, Collision
Detection set to “Triangles” and Skin Influenced checked.
Again, I’d double check the Children to make sure they are attached to Door01.
Once that is done you would want to again attach another NiNode to the NonAccum
Right-Click NonAccum, Node > Attach Parent Node then select NiNode
You will now name this new NiNode to be the same as the NonAccum but with the NonAccum
part removed. i.e. “CustomDoor_001_door_01”
You will edit the flags to have Hidden unchecked, Collision Detection set to “Triangles” and Skin
Influenced checked.
But now you would want to Right-Click the newly created NiNode
Navigate to Node > Attach Extra Data, then add a NiStringExtraData
After that is done you would want to backtrack to the CustomDoor NiNode, navigate to the
Num Extra Data List and make sure it is set to 1, if not then add 1. then refresh and link it to the
NiStringExtraData you just created.
Just below that there is the Controller, Click the green plus, add
NiMultiTargetTransformController
In the NiMultiTargetTransformController you want to check Active and set Loop Mode to “Clamp”
Make 2 Num Extra Targets, and set the first target to the NonAccum, second target is Door01
From this point on you would have to make the animations of the door opening and closing.
Animation 0 is a single keyframe of the door in the closed position
Animation 1 is the animation of the door opening
Animation 2 is a single keyframe of the door in the opened position
Animation 3 is the animation of the door closing
You would create these 4 animations in Blender and export as a KF file using the Nifskope
Blender Plugin. Leave “Use NiBSAnimationNode” unchecked.
For consistency you would want to name the kf’s the same as the door and number them.
With the nif set up and the animations created. You would want to make a kfm file. Which you
can use any existing kfm as a base to work off of.
But when opening a kfm into nifskope you would want to eid the NIF File Name to be
“/CustomDoor_001_door_01.nif”
Then you would edit the master to be the same as the NiNode name which would be the same
as the nif name. “CustomDoor_001_door_01”
Have Unknown Byte and Unknown Int 1 both set to 1, Unknown Int 2 is set to 0
Unknown Float 1 and 2 are set to 0.1
How to attach the animations to the nif. You would want to set Num Animations to 4
Select NiControllerSequence
Edit the Name to be whatever you want. It will be what your animations labeled in NifSkope
when viewing your animation.
Go down to the Accum Root Name and edit the string to be the name of your door’s NiNode
i.e. CustomDoor_001_door_01
Door Relation Code
To start you would make a new entry in CModelData3 location in GameFiles/BinaryData/Shield
Give it a unique ID
Edit the “model” to be the name of the .nif
At this point I would make or locate audio you would like to use as a Sound Effect.
Insert the audio in GameFiles/sound
Put the file in either BGM or SE depending on its purpose.
Once the door is in place you would open oNPCData found in GameFiles/BinaryData/Shield
Then create a new entry with a unique ID
The BarrierName would be *door1 and will point towards the object you placed
The ObjectName would be @door1 and will point towards the NiNode you created
Edit ModelID2 to be the ID of the CModelData3 entry you created earlier.
At this point the door is complete and ready to be implemented into any event you’d please.
But for testing you can just make a simple NPC_STATE_TRIGGER within your zones SpotData
You would just insert the ID you put in oNPCData within the first element under “args”.