Placeable:Tutorial
From NWN1 Custom Content Guide
Contents |
Creating a Custom Placeable
Introduction
In this tutorial I'll guide you through the process of creating a simple placeable for NWN. This tutorial has been written using 3dsMax6 , but all it's steps should easily translate to Gmax, as most of it's functions and layout are the same.
The tutorial covers some basic modelling and texturing basics as well as simple animations that are applicable to whatever you are modelling, no matter what export script you might prefer to use. I kept the export-script specific part seperate, to make this tutorial a little more generic and useable with other export scripts than NWmax. This might seem a bit cumbersome to experienced NWN modellers (it does to me), but keeps the NWN specific processes from leaking into the general processes applicable to every other modelling job. The tutorial also shows how to get the custom model into the game, as well as some basic use of NWN emitters.
You'll create a simple, but complete placeable chest in the course of this tutorial.
Make sure you have set up your Max/Gmax as described here : Setting up 3dsMax and Gmax for NWN before you start .
All of the images can be enlarged by clicking on them, make use of that. There's a lot of info in these images that is more easily shown than written.
Modelling
| Image:V plctut 1.jpg | Go to the create panel and select box.
Extend the ManualEntry rollout. Create a box of 60 x 120 x 50 cm dimensions. |
| Image:V plctut 2.jpg | Convert it to an editable poly. |
| Image:V plctut 3.jpg | Now we want to create the lid of the chest.
Select and extrude the top polygon of the box by 10cm. |
| Image:V plctut 4.jpg | Use a 10 cm inset to the selected polygon. This will add more faces. |
| Image:V plctut 5.jpg | Select the move tool and move the still selected polygon up 10cm to 70cm . |
| Image:V plctut 6.jpg | Now select all the polygons of what will be the lid of the chest.
(That's all but the lower base from which you extruded) In the EditablePoly properties hit the 'detach' button. A window will come up, asking you for a name. You can call it whatever you want,or leave it as it is, I call it 'lid' . |
Now rightclick in your viewport, select 'hide selection' to hide the box object. The box will disappear from the viewport. It's still there, only hidden. Now select the lid by clicking on it, and rotate the viewport so you can see it's bottom. Actually, you won't see much, as there are no faces there, but as we want to animate the lid to open later on, we need some geometry here. You will have to add it in.
| Image:V plctut 7.jpg | Enter polygon mode on the object again and select 'Create'.
You have to draw a polygon by clicking the verts (the blue dots on the corners) . Do it in the order I show you in the image, else your polygon might face the wrong direction, to the inside of the lid. When you reach vert #4, doubleclick on it to create the polygon. I remember this being a bit tricky when I started some years ago, so don't get frustrated here if it doesn't work out at once... hit undo if it didn't, and try again. |
Leave create mode by clicking the button again and rightclick in the viewport. Select 'UnhideAll' which will show you the box you hid before.
Deselect the lid by clicking an empty space in the viewport. Select the box and 'hide unselected' which will now make the lid disappear. Move the viewport so you can see the top of the box and paint a polygon on top of it just as you did for the lid. I won't guide you through repetive processes, so see above how to do this. With the new created polygon selected, hit the inset button again and inset it by 5cm. Then hit the extrude button and extrude it by -30, which will create the interior for the chest. This should leave you with something like this:
Now watch the box from below. Select the bottom polygon and hit 'delete' on your keyboard. This poly will never show in the game, so we remove it to lower the polycount.
Now this could be considered a chest... But it's a little too plain and simple. Let's add a little more to it.
| Image:V plctut 9.jpg | Create another box at position 0/0/0 , 120x60x15cm is my size of choice.
It should cut through the wide front and back of the box, as we will use this to cut away some part of it. On the Create panel there is a dropdown list. Choose 'compound objects' . With your chest box selected click on the 'boolean' button. You will be presented a list of options you can do. Leave as it is ('subtraction a-b' should be the selected option) , and hit 'Pick Operand B' and select the new created box in the viewport. This will cut away the parts where the two objects meet. |
| Image:V plctut 10.jpg | In the create panel, rightclick the 'boolean' and select 'Convert To Editable Mesh' .
Which will turn your object into a mesh object. |
| Image:V plctut 11.jpg | Go to vertex subobject mode by pressing the first button in the row of buttons.
Now go to the front viewport, draw a selection around the corner of the gap you created, like I do in the image. The panel should show '2 vertices selected' when you do this. These are the front and back verts of your box. Move these a few cm inwards. 5cm looks like a good value here, you may want to enter relative move mode for this, which you can do by pressing the small button on the left besides the X/Y/Z entryboxes on the bottom of the (G)Max screen. |
| Image:V plctut 12.jpg | After that draw a few polygons using the polygon create tool of the editable mesh object to
the sides of the stands, as they might be seen ingame. You may have difficulty drawing these, because the edges get faded away when you turn around the object. Turn off the backfacecull by rightclicking on the object and select 'properties' . In the menu presented remove the check from 'Backfacecull' and hit 'OK' . Now your object will show with two sides in the viewport, this is only a visual guide, there are no polygons created by this. You may turn backfacecull back on later, if you wish. |
At this point, we call this object done, geom-wise, for this tutorial. You might want to add more details, but don't overdo it, as it is a quite small object and small details won't be very visible ingame.
Texturing
We won't go into depth on texturing in this tutorial. We'll also only use references to existing NWN textures. To get the textures, run NWNexplorer and export the textures you want to use by rightclicking on it and hit 'export as tga'. Save those to a folder you can easily find. I exported all NWN textures to several folders for easy access, you may want to do that, too.
| Image:V plctut 13.jpg | Bring up the material editor, select any of the material slots,
set the diffuse color to white. Now hit the small box on the right of the 'diffuse'. This will bring up another window...select 'Bitmap' and browse to your texture. I use tin01_barel.tga from the TIN01 tileset textures. The Texture will now appear in the editor slot. In the button row below the material slots you'll find two important buttons.. 'Apply to selection' (a small arrow) and 'Show Map In Viewport' ( a checkered box). The first will apply the selected material to your selected geometry objects, and the second will enable the texture to be shown in your viewport. |
Enable the texture, and select both objects. Now hit 'Apply to selection' and the texture will show on the objects in the viewport.
Select the chest and go to the modify panel. Make sure no subobject mode (eg Vertex Mode) is enabled, and if it is, disable it by clicking it's button. From the modifiers dropdown box select 'UVW map' . The modifier will be added to the stack. Select the 'UVW Map' modifier twice (until it's highlighted). In the modifiers properties, select box and set it's size to 200x200x200 . You'll notice the gizmo in the viewport will change it's size according to these settings. You'll also notice that the texture's settings are modified by these settings. Experiment a bit with the settings if you want to.
| Image:V plctut 14.jpg | Now, with the Modifier still highlighted, move the gizmo along the z-axis by grabbing the
x/y/z arrows in the viewport. You'll see the texture 'wander' on the chest. Bring it to a position where the metal band is on the upper end of the box. Basically, that's already nice. But you'll see that the top border and the inlay ground of the chest aren't correct. |
You'll have to adjust that by using the UVW-unwrap possibilities. This is maybe the most hard part of this tutorial, as it ain't easy to explain how to use this modifier. There are about a million tutorials on the web, try to read a few if you want to go deeper into this. We'll go through the most basic functionality only here.
| Image:V plctut 15.jpg | Add an UnwrapUVW modifier to your stack.
Highlight it and click 'edit' on the modifier's panel. This will bring up a new window displaying the mapping information. Arrange your window so that you can see both your viewport and the Unwrap edit window. |
| Image:V plctut 16.jpg | Now click the bottom interior of your chest, and in the Unwrap edit window click the small
triangle just below the edit screen. This will remove all faces you're not editing ( have selected in the viewport ) at the moment, making it easier to see what you're doing. In the edit window, draw a selection over all verts and movew the box around until you only have wooden part in it. |
| Image:V plctut 17.jpg | Now do something similar with the top edges of the box, move the edges into the metal areas, one polygon at a time is easiest.
So you have a metal girding along the top. You will have to use the turn and move tools for this. These are in the upper left corner of the edit window. These few lines might actually take more time than modelling the object itself. |
Now go to the lid object and map this, just like you did for the box. Don't forget the bottom of the lid.
After you're done, it should look (at least a bit) like this: Image:V plctut 18.jpg
Animation
We will now add some basic animations to the chest placeable. This will be simple animations like opening and closing of the chest.
At this point it is a good idea to center the pivots and reset X-Forms on the objects.
Create a dummy (create-helpers) at the position 0,-30,0 . Name it 'anim_lid' (the name is not important in this case, it just helps you to see what it's used for, the animation of the lid in this case) . That's the position of the backside of the chest. It's easiest to place it in the top viewport,then adjust it's position with the move tool.
Then place another dummy at 0,0,0 . Name it 'anim_base' , again, the name is not really important. This is our basic animation dummy. All animation we do to the whole chest object will be done with it.
Now link the Lid to the 'anim_lid' dummy, and the chest and 'anim_lid' dummy to the anim_base' dummy. Your linking should look like this when you're done...
- anim_base
- anim_lid
- lid
- chest
- anim_lid
| Image:V plctut 19.jpg | I always start by creating a 'default' animation.
This animation is played when no special state like 'open' is active. In the case of our chest, it's an animation where nothing happens, but we'll add it anyway. Select the 'anim_base' dummy and hit the key symbol just below your viewport. This will create a keyframe at position 0 in your timeline. Now move the timeline slider 1 keyposition to the right by using it's right arrow and hit the key symbol again. Another keyframe will be created at time 1 . |
Select the 'anim_lid' dummy. Enter rotation tool mode by clicking the curved arrow in the top tool bar. You also might want to enable 'angle snap toggle' which will make rotation animations easier, because it sets rotation steps to 5 degrees instead of a free value. Create another keyframe at time 10 (move the slider there and hit the key symbol). Now enable 'Auto Key' right beside the key symbol. When 'Auto key' is enabled, every animatable change like moving or rotating the object will result in a keyframe. Move the slider to time 40 by dragging it there.
Note: Remember to turn off AutoKey when you're not animating something. Else every change you do will be recorded as animation which may screw up your model.
| Image:V plctut 20.jpg | Now grab the rotation gizmo (the spherical thingy where your dummy is) and move it up 65 degrees.
You'll notice the lid move with the rotation of the dummy. (Instead of grabbing and rotating the rotation gizmo, you could also enter the value in the fields on the bottom of the max screen) . This is the animation which will be played ingame when the chest is opened. You can move the animation slider around a bit to test your animation if you want. |
Now we need an animation that is our box in the 'open' state. This is a still, so create two more keys at time 41 and 42 by hitting the key button.
To create the closing animation, move the slider to time 50, create a keyframe and then move the slider to time 80, rotate the dummy down again, so the chest is closed. ( The only reason we go on animating at time 50 is that it easier to keep track of animations when you start at a 'full' time . You could also have started the animation at 43 and let it end at 73 if you wanted to. )
Create another two keys at 81 and 82 for the 'closed' animation/state .
| Image:V plctut 21.jpg | That's how your timeline should look like now. |
What is left now are the animations for 'damage', when someone's beating up the chest, and the destroy anims, when the chest is getting destroyed.
Select the 'anim_base' dummy and enter move tool mode. Your 'Auto Key' should still be enabled.
We'll start with the damage animation. This will play when the object is damaged and we'll simply move the box a bit. Move the slider to time 85. Create a keyframe. Go to time 90, move the 'anim_base' -10cm in the y direction. You'll notice that the whole chest get's moved,including the lid, not only the chest. That's because all is parented to the 'anim_base' dummy.
Advance 5 more frames to 95 and move the 'anim_base' back to y=0 (or +10cm) .
| Image:V plctut 22.jpg | As you may see, we are already at the end of the animation bar, and it looks like we have no more space left for the
missing destroy animations. You'll have to expand the view on the timeline. To do this rightclick the symbol to the right of the key buttons that looks like two arrows pointing out : |<>| . In the upcoming window enter 50 and 150 in the start and end animation fields. This will move the time you currently view into these dimensions. Hit OK. |
The destroy animation actually is two animations: One animation where the object is exploding, turning over or whatever you have in mind. The other hides the object from view, moving it below the ground in most cases.
We'll use an emitter or two to show the object is destroyed, but we'll add it in later. Just create two keyframes at 100 and 110 to 'reserve the space.
Now with the anim_base selected and AutoKey enabled go to time 120 and set a keyframe. At Time 121 move the anim_base down on the z-axis, I use 500 cm, just to be safe . Create another keyframe at 122 .
That's it so far for the animations.
Make sure you turn off AutoKey now.
Interaction Dummies
At this point you have to decide what you want to call your model. You have to know that a placeable's naming has to consist of two parts, a prefix and a suffix, which should be seperated by an underscore '_' . The Prefix can be anything you like as long as the total doesn't exceed 12 characters, while the suffix has to have three chars. If you do not follow this naming convention, some of your special nodes may not work as expected.
In this tutorial I decide that the model will be called 'tutchest_001' , where 'tutchest' is the prefix and '001' is the suffix. I will use the terms 'Prefix' and 'Suffix' in the following chapter to make this tutorial a little more generic.
We will create a set of dummies now, all these dummies have to follow a special naming scheme to be recognised by the NWN engine as a special purpose dummy. These dummies' positions represent positions where certain events take place, like where a magic missile hits your object for example. There are two kinds of these 'special dummies' . One kind is objectspecific, while the other is related in some way to the PWK, which is expressed by their naming.
Let's start with the object specific dummies.... Create 5 dummies, and name them just like in the table below (<suffix> stands for '001' in this case)
| Naming | Purpose |
| <suffix>_ground | no idea :D |
| <suffix>_hand | where the object is operated on (picklock for example) |
| <suffix>_head | where 'head' FX are played |
| <suffix>_head_hit | no idea :D |
| <suffix>_impact | where impact VFX like magic missile are directed to |
Place the above dummies in an apropriate position ( for example: the 'hand' dummy should be somewhere on the front of the chest, while the 'impact' should go somewhere inside the chest. )
Create another dummy name it:
<prefix>_<suffix>_pwk
This is the PWK-dummy. All objects linked to it will get written to the PWK-file once you export the model. Make sure it's in the same position as the modelbase, which in this case we haven't created yet. Just place it at 0/0/0 .
Add another dummy
<suffix>_pwk_use01
This an 'UseDummy' . It's position describes where a character will use the object from if he can't reach the modelbase. This is important if you have objects with really large PWKs, where the character can't reach the modelbase to use the item. So you should place this dummy in some reasonable position outside of the pwk. You can have more usedummies than just this one in your model if you want to. Just increase the number in the usedummy to get more. (for example 001_pwk_use02, 002_pwk_use03 etc )
The PWK
| Image:V plctut 23.jpg | The PWK is a simple mesh that tells the engine where the player can NOT walk,
so he doesn't move through objects like our chest. Create a plane with 1x1 dimensions and it's size only a bit larger than the chest's base. 70 x 130 cm is quite right. Make sure it's at position 0/0/0 and convert it to an editable mesh. You should call it 'PWK' (again, only for recognition) . Convert it to an editable mesh object by rightclicking on 'plane' and selecting 'Convert To editable mesh' in the menu. |
Creating The MDL
Until here, it doesn't matter which export script you use, as we didn't add any object specific to one.
Now let's get to the NWmax specific part.
Note that this tutorial uses NWmax 0.7 , so there might be slight differences to your version.
| Image:V plctut 26.jpg | First off, you should add an 'AuroraPlaceable' modifier to your PWK dummy ('tutchest_001_pwk' in this case) .
Make sure the option is set to 'Placeable [PWK]' , as it should be by default . This will make the exporter write all children of this object to the PWK file, without this, no pwk file is written. |
| Image:V plctut 27.jpg | Create an AuroraBase from the dummy object list, choose type character for it and place it at 0/0/0 .
Name it 'tutchest_001' (or <prefix>_<suffix> you want to see it that way ) . I will refer to this as the modelbase. |
Now link your 'anim_dummy' to the modelbase, this will link all model parts to it, too, as they are all linked to it. Then link all 5 object specific dummies and the PWK-Dummy to it , too. Link the use-dummy to the PWK dummy to make sure it will get exported to the PWK file. Also link the 'PWK' mesh to the PWK-dummy.
| Image:V plctut 24.jpg | Your linkage should look like this now. |
Now you have to add the animations to the modelbase. To do this you have to remember the start and end frames of the animations you created before.
Select the modelbase and go to the modify panel. In the MDL properties rollout you'll find a large box 'animation parameters', this is where we'll work now.
Scroll down until you see both the rollout window and the large animation list window (which is empty at this point) .
Now select 'default' from the rollout.
Look down to the 'StartFrame' and 'EndFrame' boxes.
Enter '0' and '1' respectively. Hit the 'Add' button. The animation 'default' will now be added to the animation list window with the entered keyframes.
You just added an animation to the model. Do the same with the following animations and keyframes numbers:
| Image:V plctut 25.jpg |
|
Now we are ready to export the model for the first time. Point your export directory in the model base to your ...\NWN\override\ folder and hit 'ExportModel&Anim' on the modelbase panel.
Alternately you can use the NWmax panel:
Open the 'Utils' rollout, in the 'Reset Export Directory' box, browse to your override folder, and then hit the 'Reset' button. This will make all your AuroraBases in the scene point to this folder. You can then hit the 'Export all or selected' button on the NWmax panel.
Getting it in the game
Now it's time to test the placeable ingame.
| Image:V plctut 29.jpg | Use NWN explorer to export the 'placeables.2da' from the NWN resources to your override directory. |
Based on which NWNversion and patch you are on there can be slight differences where you find yours. I have NWN and both Expansions (SOU/HOTU) installed, so I find mine in the NWN:HotU MainData - data\xp2.bif - GameData - placeables.2da Where you find yours may depend on your version.
Open the placeables.2da you just extracted with a texteditor. You can use windows' built in notepad, I use textpad. We'll now copy and paste an existing line from this 2da, as there are some chest in the game already and there's no need to make up the settings for another chest.
Copy the whole line of entry #7, which is 'Chest1' to the end of the list. Then go to the end of the file, and paste the line there. You'll need to adjust the settings of this line to add your new placeable to the game resources. The last entry in my placeables.2da is 479, so I edit my pasted line number to 480. Again, this may vary, depending on your game version, simply add 1 to the last entry.
Then replace 'Chest1' with 'ChestTut' , which will be the name that will show on the appearance tab in the toolset. Replace '5348' with '****' in the STRREF collumn, which will make the entry of the name collumn show in the toolset. The next entry is the model reference. Enter your model's name here, 'tutchest_001' in this case. Image:V plctut 30.jpg
Now run the toolset.
Because you placed the models and 2da in override, there's no need to create a hak. You also don't need to copy any textures, because we referenced an existing NWN resource.
Create a new module or open an existing (one that isn't using a placeables.2da in a hakpak) . Place any placeable, but it's best use a chest, as it already has all the statistics set you need for your new chest to work correctly. Open the properties of the placeable and browse the 'appearance' dropdown for 'ChestTut' , which should be near the other chests. Once you select this, the model changes to your custom model appearance.
You can go and check your placeable ingame now if you wish.
Fine Tuning
A few things are still missing for this placeable to be complete. First off ,we still got the missing explosion in the 'die' animation I promised you, and there are some possible shadow problems to solve. You might also want to create a new portraint for this item. There's a section for portraits on these pages, consult these if you want.
Fine Tuning - Emitters
Create an emitter. You'll find the AuroraEmitter in the create-helpers menu. Place it inside the chest, (0,0,40 for example).
| Image:V plctut 33.jpg | This one will fire a dust explosion once the chest is destroyed.
Use the settings in the image, I also marked the most important settings. |
Create a second emitter. This one will fire a chunk of wood.
| Image:V plctut 34.jpg | It uses a chunk model, that is instead of using a texture for it's particles, it uses a model.
This can be any model you like. Because it's a model, many parameters ( like alpha and size values ) for the particle aren't applicable to a chunk emitter. Most of these option will be faded out once you enable the chunk model. We'll use one of the chunk models that come with NWN : plc_chunk_w01.mdl . Remember to not include the ending '.mdl' in the chunk model box. Again, you can use the settings from the image for your emitter. |
Link both emitters to the modelbase.
Select the modelbase and open it's parameters.
Move down to the 'Events' box.
Move the animation slider to time 100 and hit the 'detonate' button under 'Quick Events' .
A 'detonate 100' will be added to the event list .
This indicates that all emitters part of a given animation are fired at time 100, which is in the scope of the 'die' animation.
Export your model and destroy it ingame to see the emitters in action.
You can find more info about emitters here : Aurora Emitter
Fine Tuning - Shadows
While you may not notice any problems with the shadows in this object,
there are some things to note about shadowcasting in NWN.
Read this : Shadows to learn more about it.
You got to know that shadowcasting is very CPU intensive, and having as less objects cast shadows as neccessary is a good thing to do. Currently our whole model does cast shadows, as we didn't do anything about it.
But does the interior of the chest really need to ? No. So let's turn that off.
Select the chest and bring up it's properties, if you didn't do already, collapse the present modifiers (rightclick in the modifier list - collapse All).
| Image:V plctut 35.jpg | Now select the whole interior of the chest in polygon subobject mode and detach it. Selecting polygons/faces can get tricky in max, you might want to turn on 'ignore backfacing' to prevent you from selecting more than wanted.
Select polygon by polygon using <ctrl> + leftclick . |
Now select the detached object and link it to the 'anim_base' , as a detached object looses it's linkage. We want to turn off shadows on this object.
| Image:V plctut 36.jpg | You can turn off shadows on a per object basis by using an AuroraTrimesh modifier. Add one to the interior object and make sure the 'shadow' checkbox is disabled. |
Conclusion
When you're done editing your object, you should create hak file with it. If you don't know how to that, read more here : HakPaks You should remove all content from override after you're done, to prevent troubles with any other mod you might be playing / creating.
For more info regarding placeables, check here Placeables.
Main_Page | Placeable Tutorial
free nokia ringtones Gas Powered Scooter Electric Scooter Scooter Store Gas Scooter paris hilton nude Order amoxil online
phentermine
buy phentermine
cheap phentermine
phentermine 37 5
phentermine diet pills
phentermine online
phentermine order
phentermine sale
phentermine discount-phentermine phentermine-online cheap-phentermine buy-phentermine order-phentermine diflucan
