Custom Content v3_0.pdf

Embed Size (px)

Citation preview

  • 8/22/2019 Custom Content v3_0.pdf

    1/208

    Wherein some of the mysteries of developing wondrous objectsfor Neverwinter Nights are revealed.

    Eligio [email protected]

    http://home.cogeco.ca/~eligio/

    http://home.cogeco.ca/~eligio/http://home.cogeco.ca/~eligio/http://home.cogeco.ca/~eligio/
  • 8/22/2019 Custom Content v3_0.pdf

    2/208

    Table of Contents

    Introduction...................................................................................................................................... 4The Tools......................................................................................................................................... 5

    3D Modeling ................................................................................................................................. 8Weapons........................................................................................................................................ 10

    Part 1: Understanding How NWN Represents Weapons .......................................................... 10Part 2: A Rose by Any Other Name........................................................................................... 11Part 3: Creating the 3D Model ................................................................................................... 16Part 4: Creating the 2D Weapon Icon........................................................................................ 21Part 5: Using a Hakpak.............................................................................................................. 24Part 6: The Weapon Resource File............................................................................................ 28Part 7: The Weapon Blueprint.................................................................................................... 36Part 8: Special Touches............................................................................................................. 37Part 9: Models that bend............................................................................................................ 39

    Character Portraits......................................................................................................................... 40Part 1: Understanding How NWN Represents Portraits ............................................................ 40Part 2: Creating Your Portrait Files ............................................................................................ 40Part 3: Using Your Portrait for a PC........................................................................................... 42Part 4: Using Your Portrait for a NPC ........................................................................................ 43

    Custom Voicesets.......................................................................................................................... 48Part 1: Understanding How NWN Represents Voices............................................................... 48Part 2: A Rose by any other Name ............................................................................................ 52Part 3: Updating Sound Files..................................................................................................... 55Part 4: Creating a New Voiceset................................................................................................ 56

    Items without Models..................................................................................................................... 60Part 1: Understanding How NWN Represents Items................................................................. 60Part 2: New Icons for Existing Items.......................................................................................... 61Part 3: New Item Resources...................................................................................................... 63Part 4: Other Items..................................................................................................................... 66

    Spells ............................................................................................................................................. 67Part 1: The Spell Icons............................................................................................................... 67Part 2: The Spell Resource........................................................................................................ 68Part 3: The Item Property Spells Resource ............................................................................... 75

    Part 4: The Spell Script.............................................................................................................. 76Part 5: Packaging it all up .......................................................................................................... 80

    Custom Armor and Clothing .......................................................................................................... 81Part 1: Understanding How NWN Represents Armor................................................................ 81Part 2: That Rose Thing Again................................................................................................... 83Part 3: Finding the Armor Model and Texture............................................................................ 86Part 4: Creating a New Texture ................................................................................................. 89Part 5: The Armor Resource Files ............................................................................................. 91Part 6: NWNArmory ................................................................................................................... 92Part 7: Additional Notes ............................................................................................................. 93Part 8: A note on clothing........................................................................................................... 94Part 9: Notes on heads and helmets ......................................................................................... 94

    Creatures....................................................................................................................................... 96Part 1: Understanding How NWN Represents Creatures.......................................................... 96Part 2: The Creature Resource File ........................................................................................... 98Part 3: Creating the 2D Portrait................................................................................................ 103Part 4: Creating the 3D Model ................................................................................................. 105Part 5: Animation...................................................................................................................... 109Part 6: Soundsets..................................................................................................................... 125Part 7: The Creature Blueprint ................................................................................................. 126Part 8: Danglymesh ................................................................................................................. 127Part 9: Skin and Bones ............................................................................................................ 128

  • 8/22/2019 Custom Content v3_0.pdf

    3/208

    Custom Races............................................................................................................................. 133Part 1: Custom Race Resource Files....................................................................................... 133Part 2: The Dynamic Character Model .................................................................................... 136

    Visual Effects............................................................................................................................... 142Part 1: The Model File.............................................................................................................. 142Part 2: Emitters ........................................................................................................................ 143Part 3: The Visual Effects Resource File ................................................................................. 151

    Other Tutorials ............................................................................................................................. 154Ambient Music (BMU files)....................................................................................................... 154Area Load Screens .................................................................................................................. 155Doors........................................................................................................................................ 155Introductory Movies.................................................................................................................. 155Placeable Items........................................................................................................................ 155Placeable Sounds (WAV files)................................................................................................. 156Texturing .................................................................................................................................. 156Tilesets..................................................................................................................................... 156Tilesets by Retexturing ............................................................................................................ 157Other Content and Modeling Tutorials..................................................................................... 157

    Notes on Other .2da Files............................................................................................................ 158Feats.2da ................................................................................................................................. 158

    Tools Guide ................................................................................................................................. 162Zoligato's NWN Viewer ............................................................................................................ 162Bioware's Hakpak Editor .......................................................................................................... 162Modeling Tools......................................................................................................................... 165Biowares DDS Compression Tool........................................................................................... 166DDSTools................................................................................................................................. 167Tlkedit....................................................................................................................................... 168

    Special Effects Reference ........................................................................................................... 170Spell Audio Effects................................................................................................................... 171Spell Visual Effects .................................................................................................................. 180Scripting Visual Effects ......................................................................................................... 191

    Change History............................................................................................................................ 207

  • 8/22/2019 Custom Content v3_0.pdf

    4/208

    !

    The Aurora Toolset for Neverwinter Nights (NWN) provides the building blocks for your custommodules from tilesets to create your dungeons to creature templates for designing your

    encounters. The toolset is both flexible and limiting at the same time. Flexible - because youassemble the building blocks in whatever fashion you desire to create your world. Limiting -because the blocks are not as varied as your imagination.

    However, with the right add-on tools, those outer limits can be pushed as far as your time andimagination will take you. Creating custom content for Neverwinter Nights can seem like adaunting task but the rewards are great. And it is not as complex as it sounds not after youunderstand how all the bits and pieces of the toolset fit together.

    This tutorial attempts to show you how some of the pieces of the puzzle fit together. It does notcover all types of custom content; there are already some good tutorials available that I referencenear the end of this document.

    Notes: This tutorial is still under construction. I will cover additional tools and details for different

    types of custom content in future versions. Any notes or quirks or bugs in the toolset that Imention in this document exist at least as of version 1.29 of the NWN game.

    "#

    This tutorial and what I have been able to piece together about developing custom content buildsupon what others have done: it is compiled from various sources on the Neverwinter boards, bitsand pieces of tutorials, and personal experimentation. Sources are varied and there are too manyto name them all. However, let me acknowledge now some of the key contributors:

    Danmar, primarily for information on weapon modeling

    Conjumen, for information on custom portraits

    Ddraigcymraeg, for information on voicesets

    Zoligatoand his wondrous NWN Viewer.

    Kaine, for detailed information about spells.

    SamJonesand Lisa, for explaining PLT files.

    Haelixand Juppfor explaining creature creation and animation.

    I will confess up front to having used portions of tutorials and sound bites from these people to asa starting point and then sought to clarify and expand them for my own use and the general NWNpublic. And there are more whose ideas and posts have influenced this tutorial. Forgive me inadvance for not being able to include all of you. Thanks to Jay Wataniumak and Bioware for fillingin some of the holes in previous versions of the document.

    $

    Please note that these tutorials are provided as-is, with no guarantees that they will beparticularly useful for what you wanted to accomplish. Also, the author(s) cannot be heldresponsible for damages done to your computer, applications and/or game installation byfollowing these instructions. Caveat emptor.

  • 8/22/2019 Custom Content v3_0.pdf

    5/208

    %

    &

    %%

    If you wish to create custom content you will need a few tools in addition to the Aurora toolset.

    '()*This viewer (http://nwvault.ign.com/Files/other/data/1026158289673.shtml ) lets youbrowse the NWN resource files (all of the model, textures, pictures, text, etc.) that make upthe content of the game. It also allows you to extract these files so that you can modifythem or use them as a base for making your own custom content.

    +(,#-#

    A hakpak is a file (with the extension .hak) whereyou add custom content files to either supplementor override standard Bioware content. Forexample, you can use a hakpak to makeNeverwinters standard goblin a different color(overriding standard content) or to add a newmonster such as an Owlbear (adding newcontent). To use your hakpak you must add it as aresource to your module. For instructions on howto do this, refer to the Hakpak Editor section at theend of this guide.

    Anybody who plays your module will need a copyof your hakpak so be sure to distribute it along withyour module itself.

    .%

    The complexity and expense of the modeling toolsyou use is completely up to you and what kind ofcustom content you want to build. You have manyoptions:

    a) Simple copying and retexturing. If all you wantis the ability to copy models, rename them andretexture them, there is a simple utility you canuse. NWN can read either binary or ASCIIversions of the model files (most of the NWNfiles are compiled into a binary format). The reason for turning them into ASCII files isthat you can edit the ASCII model file with a text editor and change simple things like

    the texture file used and the model name(make sure you change all instances).

    NWNMdlComp(http://www.torlack.com/index.html?topics=nwnmdlcomp_readme) will take a binarymodel file and turn it into an ASCII modelfile and vice-versa.

    Warning Another way to override Bioware

    content is to drop a file into the/override folder of your game

    directory. However, you should not dothis.

    Hakpaks are much cleaner they cangroup many overridden files into onepackage and, more importantly, theyare specific to a module.

    Putting a file into the /overridedirectory will override it for all modulesyou play on that computer which mayhave unintended consequences onother peoples games.

    In general, dont use the /overridedirectory. The only valid use of the

    /override directory that I wouldrecommend is for temporarily andquickly testing your content withouthaving to go through the process ofupdating a hakpak, saving it, etc. Onceyou have finished testing, dont forgetto load the new content into a hakpakand take it out of the /overridedirectory.

    Notes I no longer reference c-tools because

    NWNMdlComp is a more up-to-dateversion of what the original programcould do.

    http://nwvault.ign.com/Files/other/data/1026158289673.shtmlhttp://nwvault.ign.com/Files/other/data/1026158289673.shtmlhttp://www.torlack.com/index.html?topicshttp://www.torlack.com/index.html?topicshttp://nwvault.ign.com/Files/other/data/1026158289673.shtml
  • 8/22/2019 Custom Content v3_0.pdf

    6/208

    %

    b) If you want to try modeling work without an expensive modeling tool, try gmax(http://www.discreet.com/products/gmax/). It is a subset of 3ds max for non-commercial game designers and it is available free. To use it for NWN you also needto pick up the Waylands GMax MDL import/export script(http://nwvault.ign.com/Files/other/data/1029721132840.shtml ) andNWNMdlComp(above). Gmax and its tools do not support creation of emitters (an advanced topic for

    NWN modeling so you may not care since most models do not use emitters).

    c) There are low cost modeling tools available on the net. Milkshape 3D(http://www.swissquake.ch/chumbalum-soft/) is a low polygon 3D modeler originallymade for Half Life. Milkshape import/export scripts(http://www.augustweb.com/~anim8r/html/closet_tools.htm ) are available to supportNWN and a host of other formats. I have read that the import/export plug-ins forMilkshape3d appear to have been made for the beta toolset before the game wasreleased. They rotate body parts 90 degrees counter-clockwise so you have to eitherrotate 90 degrees clockwise before exporting - that is rotate the model not the view -or else import/export your model a total of 4 times to return it to original position.Beggars cant be choosers.

    d) Professional modeling. Buy 3ds max (http://www.discreet.com/products/3dsmax/).Pawn your car. Mortgage your house. Sellthe rights to your firstborn child. Once youhave done that and have the 3ds software,you need a set of MAX Scripts to exportand/or import model files. The MDL Plug-inSuite 1.0(http://www.bricksbuilder.com/nwn/utils/) byscooterpbis the utility of choice here. This isa set of tools developed by the communitythat will let you import Biowares models into3ds max 4 or 5, manipulate them, and exportthem as ASCII mdl files. Bioware has also released their Export Scripts for 3ds max(http://nwn.bioware.com/downloads/max_script.html ). Grab them and BiowaresExport Scripts Documentation

    (http://nwn.bioware.com/downloads/max_docs.html ).

    e) More professional modeling. Buy Lightwave 3D (http://www.lightwave3d.com/).Joviexhas released Import/Export scripts for Lightwave(http://www.onarom.com/Plugins/nwnmdl.asp ).

    f) ObsidianSS(http://nwvault.ign.com/Files/other/data/1030162054010.shtml) is a tool for scaling andskinning existing models (it does nothing that

    cannot be done with gmax or the othermodeling tools but some people find it agood tool if they just want to scale and skinexisting models without learning gmax). Ifyou are interested in ObsidianSS, here is atutorial on re-skinning an existing model(http://nwvault.ign.com/dm/modeling/tutorials/lllSnakeeyeslll/BlackBalorTutorial.htm) usingObsidianSS.

    Warning Bioware has only released the export

    scripts - no import scripts. This meansyou cannot load their existing contentfrom a Bioware MDL file. You can onlyexport a model you create from scratch.I believe most modellers make heavyuse of scooterpbs suite and morelimited use of Biowares scripts.

    Notes Note that ObsidianSS does not scale

    animations properly creatures nolonger attack where they should. Small

    ones swing in front of the target andlarge ones well behind it.

    I suspect this is because the motionsscale down or up but the game enginedoes not know to change attackdistance between the creature and thetarget. This may be fixable withparameters in the appearance.2da file(like HITDIST) but needs to be tested.

    http://www.discreet.com/products/gmax/http://www.discreet.com/products/gmax/http://nwvault.ign.com/Files/other/data/1029721132840.shtmlhttp://nwvault.ign.com/Files/other/data/1029721132840.shtmlhttp://www.swissquake.ch/chumbalumsoft/http://www.swissquake.ch/chumbalumsoft/http://www.augustweb.com/~anim8r/html/closet_tools.htmhttp://www.augustweb.com/~anim8r/html/closet_tools.htmhttp://www.discreet.com/products/3dsmax/http://www.bricksbuilder.com/nwn/utils/http://www.bricksbuilder.com/nwn/utils/http://www.bricksbuilder.com/nwn/utils/http://www.bricksbuilder.com/nwn/utils/http://nwn.bioware.com/downloads/max_script.htmlhttp://nwn.bioware.com/downloads/max_script.htmlhttp://nwn.bioware.com/downloads/max_docs.htmlhttp://nwn.bioware.com/downloads/max_docs.htmlhttp://www.lightwave3d.com/http://www.lightwave3d.com/http://www.onarom.com/Plugins/nwnmdl.asphttp://www.onarom.com/Plugins/nwnmdl.asphttp://nwvault.ign.com/Files/other/data/1030http://nwvault.ign.com/dm/modeling/tutorials/http://nwvault.ign.com/dm/modeling/tutorials/http://nwvault.ign.com/Files/other/data/1030http://www.onarom.com/Plugins/nwnmdl.asphttp://www.lightwave3d.com/http://nwn.bioware.com/downloads/max_docs.htmlhttp://nwn.bioware.com/downloads/max_script.htmlhttp://www.bricksbuilder.com/nwn/utils/http://www.discreet.com/products/3dsmax/http://www.augustweb.com/~anim8r/html/closet_tools.htmhttp://www.swissquake.ch/chumbalumsoft/http://nwvault.ign.com/Files/other/data/1029721132840.shtmlhttp://www.discreet.com/products/gmax/
  • 8/22/2019 Custom Content v3_0.pdf

    7/208

    %

    /

    There are other 3D modeling tools but import/export scripts for these currently do not exist.A number of people ask about Maya because there are free/low-cost educational versionsavailable and it is reportedly better at animation than 3ds max or gmax. However, thereare no import/export scripts for Maya directly from and to NWN. They could be written forthe professional version if somebody has the inclination the SDK exists for the fullversion although the educational versions do not accept plug-ins and use a proprietary file

    format so you are out of luck there.

    %

    The complexity and expense of the image editing tools you use is also completely up toyou and what kind of custom content you want to build. You have many options:

    a) Picture Publisher from Micrografx (now a Corel product). Moderately advancedimage editing, this is one of many packages bundled with common hardware likescanners (thats how I got mine).

    b) Photoshop (http://www.adobe.com/products/photoshop/main.html ) from Adobe. Didyou sell your firstborn to get 3ds max? Put the second child up on the auction block

    too. You wont get as much for the little rascal as you did for the first one but it shouldbe enough to get a copy of Photoshop.

    c) Paint Shop Pro (http://www.jasc.com/products/psp/) from JASC. The poor-mansPhotoshop. You should be able to get it for the price of your dog.

    d) GIMP (http://www.gimp.org/) is a freely distributed piece of software suitable for suchtasks as photo retouching, image composition and image authoring (open source,natch). Contrary to popular belief, it runs on Mac and Windows in addition to Linux. Ifyou really are attached to your children and your pets, this is the way to go.

    e) MSPaint from Microsoft. Wait, did I say that? Actually, MSPaint does not support theTarga bitmap format so it will not work for NWN.

    f) Your choice of 15,237 other image-editing programs.

    $$%+0$$-%

    Either DDSTools (http://downloads.neverwinternights.de/tools/ddstools.zip ) or BiowaresDDS Compression Tool (http://nwn.bioware.com/builders/texturetutorial.html ) can beused to compress your textures into DDS format for faster rendition on higher end 3dvideo cards. While not absolutely necessary, it will give your objects that extra level ofprofessional shine. It allows your hardware to switch between very hi-res textures whenviewing an object close up while using low-res textures for the same object viewed at adistance. These are only necessary if you create custom textures for your models.

    )"1(http://nwvault.ign.com/Files/other/data/1053910703210.shtml ) is used to duplicate armorpieces when you are creating new armor for all the different PC races or creating new PCraces.

    http://www.adobe.com/products/photoshop/main.htmlhttp://www.adobe.com/products/photoshop/main.htmlhttp://www.jasc.com/products/psp/http://www.jasc.com/products/psp/http://www.gimp.org/http://www.gimp.org/http://downloads.neverwinternights.de/tools/ddstools.ziphttp://downloads.neverwinternights.de/tools/ddstools.ziphttp://nwn.bioware.com/builders/texturetutorial.htmlhttp://nwn.bioware.com/builders/texturetutorial.htmlhttp://nwvault.ign.com/Files/other/data/1053910703210.shtmlhttp://nwvault.ign.com/Files/other/data/1053910703210.shtmlhttp://nwvault.ign.com/Files/other/data/1053910703210.shtmlhttp://nwn.bioware.com/builders/texturetutorial.htmlhttp://downloads.neverwinternights.de/tools/ddstools.ziphttp://www.gimp.org/http://www.jasc.com/products/psp/http://www.adobe.com/products/photoshop/main.html
  • 8/22/2019 Custom Content v3_0.pdf

    8/208

    %

    2

    +0-3%4-

    (http://nwdownloads.bioware.com/neverwinternights/misc/photoshop_plt_plugin.zip ) is forpeople who use Photoshop to edit their image files. This tool will allow you to export themas PLT texture files for use in armor and head models.

    30-(http://www.lordemil.com/NWN/pltcon.exe) is used if you dont have Photoshop because itchanges PLT texture files into editable bitmaps and back again.

    $1(5657

    (http://nwvault.ign.com/Files/other/data/1027785116370.shtml ) is used to create or editNWN .ssf voiceset files. There are some bugs with this utility that may cause problemsalthough it is generally stable.

    #

    (http://www.chilliweb.co.uk/chilliskinner/) is used to unwrap an object for texturing in 3ds

    Max or gmax. Apparently 3ds max version 5 does not really require Chilliskinner; many ofthe capabilities of that tool are building into the advanced unwrapping features of v5.ChilliSkinner is really a set of Maxscripts.

    %4-

    (http://www.texporter.com/) is used to unwrap an already textured object into a bitmap forpainting (after you have run ChilliSkinner, for example). This is not strictly necessary whentexturing because you can always do a printscreen when unwrapping objects and use theprintscreen as a template for your texture (which is good because Texporter is a plug-inand can only run in 3ds max it does not work on Gmax).

    8$0

    (http://codicc.city-of-doors.com/) is used to generate custom races.

    $.

    This guide is not a 3d modeling course. Nor will it teach you in the ins and outs of texturing. If youalready know how to model, you have won half the battle. Pick up a copy of your favoritemodeling tool and dive right into this tutorial. If you dont, Discreets gmax is a good place to startand it includes lots of tutorials.

    If you dont know what a mesh is and need help with the real basics, there are other resourcesthat can help you:

    /is a site for game modeling (Quake, UnReal, HalfLife, etc.).

    http://www.quake3world.com/ubb/Forum11/HTML/001100.html (the .

    http://www.3DTotal.com/ has a lot of tutorials, and a lot of samples. Check out the fancyswords in the Models section under the Medieval/Historical section (unfortunately, they are toohigh-poly to use directly in NWN). As another example, you can find a tutorial to model Joan ofArcs sword (http://www.3dtotal.com/ffa/tutorials/max/joanofarc/sword1.asp ) here.

    http://www.computerarts.co.uk/tutorials/3d/ also has tutorials on basic modeling and animating.

    http://nwdownloads.bioware.com/neverwinternights/misc/photoshop_plt_plugin.ziphttp://nwdownloads.bioware.com/neverwinternights/misc/photoshop_plt_plugin.ziphttp://www.lordemil.com/NWN/pltcon.exehttp://www.lordemil.com/NWN/pltcon.exehttp://nwvault.ign.com/Files/other/data/1027785116370.shtmlhttp://nwvault.ign.com/Files/other/data/1027785116370.shtmlhttp://www.chilliweb.co.uk/chilliskinner/http://www.chilliweb.co.uk/chilliskinner/http://www.texporter.com/http://www.texporter.com/http://codicc.cityof/http://www.polycount.com/http://www.polycount.com/http://www.polycount.com/http://www.quake3world.com/ubb/Forum11/HTML/001100.htmlhttp://www.quake3world.com/ubb/Forum11/HTML/001100.htmlhttp://www.3dtotal.com/http://www.3dtotal.com/http://www.3dtotal.com/ffa/tutorials/max/joanofarc/sword1.asphttp://www.3dtotal.com/ffa/tutorials/max/joanofarc/sword1.asphttp://www.3dtotal.com/ffa/tutorials/max/joanofarc/sword1.asphttp://www.computerarts.co.uk/tutorials/3d/http://www.computerarts.co.uk/tutorials/3d/http://www.computerarts.co.uk/tutorials/3d/http://www.3dtotal.com/ffa/tutorials/max/joanofarc/sword1.asphttp://www.3dtotal.com/http://www.quake3world.com/ubb/Forum11/HTML/001100.htmlhttp://www.polycount.com/http://codicc.cityof/http://www.texporter.com/http://www.chilliweb.co.uk/chilliskinner/http://nwvault.ign.com/Files/other/data/1027785116370.shtmlhttp://www.lordemil.com/NWN/pltcon.exehttp://nwdownloads.bioware.com/neverwinternights/misc/photoshop_plt_plugin.zip
  • 8/22/2019 Custom Content v3_0.pdf

    9/208

    %

    9

    http://www.cgtalk.com/ is a very active forum on modeling. There is a great tutorial on texturingand others on general 3d modeling.

    comp.graphics.packages.3dstudio the 3dstudio newsgroup. Tips, tricks, FAQs andflamefests. What more could you ask for?

    http://www.3dlinks.com/ includes discussion forums and other information that you may find

    useful. http://www.3dark.com/ was recommended in another post but I found the practical content to

    be fairly low (unless you want to join the 3d animation industry).

    http://www.3dcafe.com/ is, unfortunately, a subscription site. It does have a section with freemodels that you may be able to use as a starting point.

    http://mojo.gmaxsupport.com/Sections/MaxScripts.html has scripts that can be used with both3ds max and gmax.

    http://supadetail.gmaxsupport.com/has gmax tutorials.

    http://tdp.nu/cgi-bin/plugsearch_r4.pl?search=gmax has plug-ins and scripts for both 3ds Maxand gmax.

    http://www.scriptspot.com/start.htm also has plug-ins and scripts for both 3ds Max and gmax.

    http://maxres.cgworks.com/scripts/has scripts for 3ds Max.

    http://max3d.3dluvr.com/plugins.php has plug-ins for 3ds Max. This site also has some goodtutorials on subjects like animation.

    http://www.maxplugins.de/has more plug-ins for 3ds Max.

    http://www.melax.com/polychop/plugin/index.html has polychop. This is a plug-in that reducesthe number of polys in your mesh (in case you got a little too excited making the ultimate hi-resolution model and cant find a PC fast enough to run it)

    Paul Steed (Quake II/III fame) apparently has a book called "Modeling a character in 3DSMax". I have not used it myself but I am told it is a very good book that explains how to model

    and skin a one piece character mesh for export to any game/application. It is 500-odd pages,about USD $45.

    I would recommend you get started by doing some of the basic tutorials that come with yourmodeling package. Then move on to looking at the existing NWN models. Review them, modifythem, understand them, and finally make your own.

    http://www.cgtalk.com/http://www.cgtalk.com/http://www.3dlinks.com/http://www.3dlinks.com/http://www.3dark.com/http://www.3dark.com/http://www.3dcafe.com/http://www.3dcafe.com/http://mojo.gmaxsupport.com/Sections/MaxScripts.htmlhttp://mojo.gmaxsupport.com/Sections/MaxScripts.htmlhttp://tdp.nu/cgibin/plugsearch_r4.pl?search=gmaxhttp://tdp.nu/cgibin/plugsearch_r4.pl?search=gmaxhttp://www.scriptspot.com/start.htmhttp://www.scriptspot.com/start.htmhttp://maxres.cgworks.com/scripts/http://maxres.cgworks.com/scripts/http://max3d.3dluvr.com/plugins.phphttp://max3d.3dluvr.com/plugins.phphttp://www.maxplugins.de/http://www.maxplugins.de/http://www.melax.com/polychop/plugin/index.htmlhttp://www.melax.com/polychop/plugin/index.htmlhttp://www.melax.com/polychop/plugin/index.htmlhttp://www.maxplugins.de/http://max3d.3dluvr.com/plugins.phphttp://maxres.cgworks.com/scripts/http://www.scriptspot.com/start.htmhttp://tdp.nu/cgibin/plugsearch_r4.pl?search=gmaxhttp://supadetail.gmaxsupport.com/http://mojo.gmaxsupport.com/Sections/MaxScripts.htmlhttp://www.3dcafe.com/http://www.3dark.com/http://www.3dlinks.com/http://www.cgtalk.com/
  • 8/22/2019 Custom Content v3_0.pdf

    10/208

    )-

    )-

    Lets start by modeling a new weapon. I want to be able to create Wave, the trident from S2

    White Plume Mountain. We will start by creating a simple trident head and test it out. Then, afterwe have it working, we will tweak the content to add additional features.

    Where do we begin? Well, it usually helps to start with something that at least vaguely resemblesthe final product you want to create at least until you have done a few of these. We would startwith an existing Bioware model but NWN does not include a trident as a standard weapon. Butwait, a spear is similar to a trident (a pointy thing on the end of a long stick) and you attack with itin a similar motion (by jabbing the sharp end at your opponent). So we will start with a spear asour base model.

    :;,)

  • 8/22/2019 Custom Content v3_0.pdf

    11/208

    )-

    What you dont see directly is that each of these models is actually made up of three distinctpieces (top, middle, and bottom). By mixing and matching these pieces, you can create a lot ofunique weapons with the basic items included in the game. In our example, the basic spearconsists of the spearhead (top), the shaft (middle), and an end cap (bottom). A sword consists ofthe blade (top), the guard (middle) and the hilt (bottom).

    While we are here, play with the Model and Color values. By changing the Model values, you canchange the shape of each component. By changing the Color values, the shape of each partdoes not change but you can change the color of each component.

    Now that you understand the different parts of a weapon model, lets get started.

    :"

  • 8/22/2019 Custom Content v3_0.pdf

    12/208

    )-

    data/models_01.bif contains the characterand creature models

    data/models_02.bif contains the armor/modelpieces, placeable items,and weapon models

    We will use data/models_02.bif because we wantthe weapon models.

    .%1-

    Scroll down, way down. What you want are the modelsthat start with w.

    Weapon models are named using the format:wxxyy_z_nnn. The prefix represents the model type fora weapon. The remainder of the name represents theweapon class and name for the model.

    !

    )-

    After the w, the next four characters (wxxyy) describe the class and name of the weapon:

    xx Model classyy Model name abbreviation

    Hint Check your /override directory and

    patch.bif first they contain officialupdates from Bioware (NWN Viewergets its data directly from the originalBIF files which may be out of date).

    Only if Bioware has not updated these

    files should you export a new versionfrom the original game installation. Ifyou don't follow these simple rules, yourisk undoing Bioware's bug fixes whenyou distribute your custom content.

    NWNViewer cant open patch.bifdirectly. To have it recognizepatch.bif, rename the filechitin.key to original.key.Rename patch.key to chitin.key.Now you can open it directly in theviewer. To open the original BIF files,reverse this process.

  • 8/22/2019 Custom Content v3_0.pdf

    13/208

    )-

    For example, wplss_t_011 equates to:

    w for weaponpl for polearmss for short spear

    Well get to the_t_011 part in a moment. First, here are the standard weapon resources fordata/models_02.bif:

    Type Class Name Maps toW Weapon

    AM AmmoAR ArrowBO BoltBU BulletDT Dart (I dont think this is really valid because

    it does not appear in the baseitems.2da file).AX Axe

    BTBattle Axe (two-handed)GR Great Axe

    HN Hand Axe (one-handed)BB ?

    QS ?BD ?

    QS ?BI ?

    MI ?BL Bludgeoning Weapons

    CL ClubFH Flail, HeavyFL Flail, Light

    HL Hammer, LightHW Hammer, WarML Mace, LightMS Morningstar

    BW BowLC Longbow, CompositeLN LongbowSC Shortbow, CompositeSL SlingSH ShortbowXH Crossbow, HeavyXL Crossbow, LightXR Crossbow, Repeating

    DB Double-handedAX Double AxeMA Dire MaceQS QuarterstaffSW Two-bladed Sword

    MG MagicRD RodST StaffWN Wand

  • 8/22/2019 Custom Content v3_0.pdf

    14/208

    )-

    !

    PL PolearmHB HalberdSC ScytheSS Short Spear

    SP SpecialGA Gauntlet? (I dont think this is really valid

    because it does not appear in thebaseitems.2da file).KA KamaKA KukriNN Nunchuka (I dont think this is really valid

    because it does not appear in thebaseitems.2da file).

    SC SickleSP ? (I dont think this is really valid because it

    does not appear in the baseitems.2da file).SW Sword

    BS Bastard SwordDG Dagger

    GS Great SwordKA KatanaLS LongswordRA RapierSC ScimitarSS Shortsword

    TH ThrowingAX Throwing AxeDT DartSH Shuriken

    WB ?LC ?

    Okay, sounds easy enough so far. But what are all those other numbers and letters I see indata/models_02.bif (the_t_011 stuff)?

    We have already looked at how NWN represents the different components of a model by lookingat the item properties under Appearance for a custom-created item. The options you choosecorrespond to the different model types in the data/models_02.bif file.

    First is the position code. We know there are three position codes for each weapon:

    t topm middleb bottom

    So in the earlier example, wplss_t_011 equates to the top piece (the head) of the short spear.

    .$

    There is a specific format for the id as well: nnz. There are two characteristics:

    nn Model (although Ive not seen the first character anything other thanzero and I have had trouble getting past 09)

  • 8/22/2019 Custom Content v3_0.pdf

    15/208

    )-

    &

    z Color/Texture (right now the ones typically supported are 1 = metal, 2= brass, 3 = wood) but you can add your own

    So in the earlier example, wplss_t_011 equates to the first model # and the initial color (usuallymetal, followed by bronze/brass/gold, followed by wood) of the top piece of the short spear.

    -.

    Now you understand the weapon models and their naming conventions. Well, almost. What aboutsome of those other models with names like waxbt_fxacid? There are special purpose modelsfor special effects:

    _mb The motion blur model_fxacid,

    etc.special effects (acid, etc.) shows the gameengine where to render the colored mist orflames that envelop different models

    _blur Ignore this model type. This looks like it isanother type of motion blur model but it is not. Itis not used for anything and is a vestigial modelleft from earlier game development days

    _000 Ignore this model type as well. It looks like anormal weapon model but it is not valid. It is avestigial model left from earlier gamedevelopment days as well

    So waxbt_fxacid shows the model for a weapon, an axe, in fact abattle axe, corresponding tothe effect you would get if that battle axe were magically enchanted to drip acid.

    There are a few weapons (e.g., the bullet) that do not have the full 3 parts. These are representedwith a format of wxxyy_nnn. Just exclude the Position Code.

  • 8/22/2019 Custom Content v3_0.pdf

    16/208

    )-

    :$.

    So with all of that in mind, I am going to create my models for atrident. If I look at the spear models, the first thing I see is that

    the standard shaft (m as in middle) and end (b as in bottom)models for a spear work just fine for a trident. So Im just goingto create a new model for the head of the spear (t as in top).Here are the basic steps using gmax. Directions may varyaccording to your software.

    1. Open the NWN Viewer.

    2. Select data/models_02.bif.

    3. Scroll down and select the model wplss_t_031.

    4. Right click on the row and select Extract file(s) to.

    5. Save the file to a new directory. This is a binary model file.You cannot easily open or read it in binary format.

    6. Open a command prompt window.

    7. Run NWNMdlComp d wplss_t_031 on the binary

    model file to convert it to an ASCII model file (it shouldhave the name wplss_t_031.mdl.ascii).

    "###$%#

    8. Open gmax. The NWN MDL Tool pane shouldautomatically open on the left side. If it does not, load it

    manually using Maxscripts | Run Script

    9. Load the spear model into gmax by opening the ImportMDL sub-menu in this pane (not the File | Importfunction) and using the Browse pushbutton to select theASCII file you created in step 6.

    Hint

    Start with a model you know works.There are models for swords, spears,even a flail with a chain linking head tohandle. Use this model to understandhow big to make your objects andwhere to place them.

    Complex models with lots of polygonswill slow down combat considerably.How many is too many? Well, it varies.I created Wave with 157 vertices. Thisis pushing the high end of what youwant. Many of the standard NWNmodels have less than 50 vertices. Iwould aim for 30-40 per model file. The

    CEP puts a ceiling of 300 polys for theentire weapon (all three parts).

    If you would like your object to have achrome finish, you do not have totexture it. Otherwise, figure out UVWmapping and do your own texturing.

    The default weapon texture isw_metal_tex.tga. The texture imageis comprised of blocks of textures,some alpha masked, some not. If youuse an alpha mask texture on aweapon then where it is transparent theunderlying shiny value will showthrough.

    The gmax and 3ds max export scriptsare a bit funky working directly with ablocked texture file likew_metal_tex.tga. You need a singletexture file for the entire object or youneed to do a proper UVW map.

    If the NWN MDL Tool pane does notcome up and you cant find the scriptsto load, you probably dont have thescripts installed. See the link at the endof this document to get a copy. Put the.ms files in yourgmax\scripts\startup folder.

    You can only export editable meshobjects. So if you model with shapes ornurbs you must convert to an editablemesh before exporting.

  • 8/22/2019 Custom Content v3_0.pdf

    17/208

    )-

    /

    &'#(

    10. You can minimize the MDL window after you open the file. Take a close look at the model youloaded. Note the relative size and position of the model. This is important because the relativeorientation and offset of your model now will be used when the game engine renders yourweapon in three pieces. The reason your spearhead is not centered at the origin (0, 0, 0) of the

    gmax space is because it must be far enough out to rest comfortably on the tip of the spearsshaft model (the middle piece). You must keep it there; otherwise it will not appear to beattached to the rest of the weapon when the game engine assembles the three models later.

    11. Note the base item. This is used by the import/export scripts to link special attributes to models(animations, etc.). The spearhead is a child mesh of the base. Dont change the name of themodel for now, or of the base (this is important for now we will change it for later models).The spearhead model has a name of wplss_t_031.

    12. Now modify the standard spearhead or replace it with your trident model (read the tutorials forgmax to see how to actually create 3D models).

    Hint Collapse your objects to editable

    meshes before applying any NWNmodifiers.

  • 8/22/2019 Custom Content v3_0.pdf

    18/208

    )-

    2

    )%#(

    13. If you created a new model, be sure to link it to the base item as a child object.

    14. Open the Export MDL sub-menu of the NWN MDLTools pane. Select Export MDL.

    15. Wait? Where is my exported file? It didnt even ask for afilename. The gmax import/export utility does not havethe ability to write files. What it does is dump an ASCIIversion of your model to the MAXScript Listener. Whatyou need to do is open MAXScript | Listener andthen copy and paste the listing into a text file. Save it aswplss_t_031.mdl and you are done.

    Hint Size matters.

    1cm in game = 1 max unit. If this is tooconfusing you can import anothermodel that is properly scaled.

    Because NWN uses a tiny scale, theimport export tool lets you import at amagnified scale of 100X magnification.It will then export at -100X to get it backto original size.

  • 8/22/2019 Custom Content v3_0.pdf

    19/208

    )-

    9

    *+,-#((#

    16. Copy your wplss_t_031.mdl file to the /override directory of your game installation. If

    you used a .tga file as a texture, put it in the samedirectory.

    17. Open up the Aurora Toolset. If it was still open frombefore, save and close the module and toolset first thenre-open it.

    18. Open your Weapon Tutorialmodule.

    19. Select the Area you created, and then the Item icon onthe right toolbar (it looks like a sword).

    20. Choose the Custom tab.

    21. Your original spear should be under the Weapons,Polearms category.

    22. Right click Trident and then select Edit from the pop-up menu.

    23. Select the Appearance Tab.

    24. Select Top model 3 if it was not already selected. I also chose the Bottom model 4 (one of the

    default models) because I like the bladed end better than the rounded model #1. And I madethe shaft gold (color 2).

    25. Click OK and then save your module.

    Hint This cutting and pasting thing from the

    listener is a bit annoying. You can get autility from NWVault that does this for youautomagically.

    You must close and re-open the Auroratoolset whenever you add something tothe /override directory. The gameand toolset only look at and load filesfrom the /override directory once,upon start-up. If you do not re-open thetoolset, it will not recognize any new

    resources.

  • 8/22/2019 Custom Content v3_0.pdf

    20/208

    )-

    .

    This is what you get when you look at your spear. It is starting to shape up. There are a couple ofproblems with this model that say we arent done.

    Note the picture on the right side it still looks like a spear with a default spearhead! Where isour trident? We need to create a 2D weapon icon to fix this.

    Now all basic spears using model 3 will look like tridents because we have overridden thedefault spear model. We need to change a few more things to fix this problem as well.

    Our trident is actually a spear. It will work fine this way but we may want to actually add anentirely new weapon, a trident, rather than piggy-backing on the spear forever.

    Note on ResetXforms:

    Have you ever opened up one of your creations in NWN and found it does not look like what yousaw in your modeling tool? Too big? Too small? Parts blown out of proportion or disappearing?Sounds like you have a problem with advanced transforms. This subject is so frequentlydiscussed and so problematic I thought I would pull it out into its own flagged section. Let me startby discussing why you need to care about resetting transforms.

    Gmax and 3ds Max can hold information about your object (whether or not parts of it aremirrored, which directions normals really point, how it is scaled and rotated, etc.) that is notexported with your model in a way that NWN can understand or use. What this means is that

    what you see in Max may not be the same as what you see in NWN.

    For example, objects can be transformed (scaled, rotated or moved) either in world spaceor insub-object space. Transforms in sub-object spacetake place when you transform vertices,edges, faces, polys or elements of an object (or all of them at the same time). Transforms inworld spacetake place by selecting your object at the highest level and transforming it.

    What this means is that if you rotate an object in world space, it will not be rotated when youexport it to the game. Or moved (transformed).Let me repeat that in different words because thispart is key: Bioware's NWN engine does not read world space transforms!

  • 8/22/2019 Custom Content v3_0.pdf

    21/208

    )-

    As you can imagine, this might be a huge problem. One way to fix this problem is to do all of yourtransforms at the sub-object level. However, this is only a partial solution because the sameproblem occurs with other operations as well (for example, mirroring objects often inverts thedirection of their normals or faces).

    The good news is that there is a way around it. In Gmax or 3dsMax you can do a ResetXformoperation on all the pieces of your model and then collapse each of these modifiers onto your

    editable mesh. By doing this, you are turning this complex transformation information intosomething simpler that NWN can understand. In practical terms it means what you see in Maxand what you see in NWN are more likely to be the same.

    ResetXform can be found on the Utilities panel. Use the ResetXform utility to push objectRotation and Scale values onto the Modifier Stack display and align object pivot points andbounding boxes with the World coordinate system. Reset Transform removes all Rotation andScale values from selected objects and places those transforms in an XForm modifier (no, really,it will). You can then collapse the modifier into your object and away you go.

    Some notes on ResetXform:

    Sometimes after you do a ResetXform you may need to clean up parts of your model. Forexample, often on mirrored objects doing a ResetXform will expose the fact that yournormals are really inverted. You will need to flip the normals on the mirrored part afteryou are done. These aren't things that ResetXforms breaks - they are things that wouldhave been wonky in the game and it is showing them to you early.

    You can also reset the transforms on the Pivot block of the Hierarchy panel. It will convertyour world space transform into a sub-object space level transform. However, it will notfix problems like reversed normals so the Utility panel is generally the way to go.

    You must do all of these things before linking your object to other objects (like theAurabase). Why? Because the ResetXform modifier affects child objects as well theparent. If your objects are linked together they will inherit transforms and scaling. Byresetting you are only really resetting them relative to the parent objects.

    So let me summarize: if your object appears differently in the game than it did in 3dsmax orgmax you probably forgot to reset the transforms on it. Make sure your object is unlinked

    and then use ResetXforms on the Utility Panel to clean it up before proceeding.

    !:$)-

    Lets start by fixing that picture. NWN 2D icons must be 32-bit Targa Bitmap (.tga) files (with analpha mask channel). Once you understand how the 3D weapon models are named, the 2D iconsare easy. Just add an i to the beginning of the 3D name. For example, iwplss_t_011 equatesto the 2D icon of the model # 1 and color # 1 (usually metal, followed by #2 bronze/brass/gold,and #3 wood) of the top piece of the short spear.

    There are two game files that contain all of the textures:

    data/textures_01.bif

    data/textures_02.bif

    You may need to use both. Use data/textures_02.bif for axe and short sword icons. Therest of the icons are in data/textures_01.bif.

  • 8/22/2019 Custom Content v3_0.pdf

    22/208

    )-

    /

    How big do I make the icon file? Note that in this example the icon for the spear top is 32 x 128pixels. But the different icons can be different sizes, just make sure they are a multiple of 32 andthat all the pieces for a specific weapon are the same size. In the case of our spear, we will usethe same 32 x 128. Why do we need to do this? We do it for the inventory management system ofNWN. Each box on the inventory grid is 32 pixels x 32 pixels. Our models have to align with thisgrid perfectly. Again, I suggest using an existing model to start.

    %

    I use the same basic process to create the 2D icon as I did for the 3D model:

    1. Open the NWN Viewer.

    2. Select data/textures_01.bif .

    3. Scroll down and select the file iwplss_t_011.

    4. Right click on the row and select Extract file(s) to.

    5. Save the file to the directory with your 3D model.

    6. Open the .tga file with an image manipulation program. I use Micrografx Picture Publisherbecause it came with my scanner and does most of what I need. Modify the standardspearhead or replace it with your trident model. Keep the name the same (this is still important

  • 8/22/2019 Custom Content v3_0.pdf

    23/208

    )-

    for now). Dont use any of that black space below the model when the game overlays themiddle and bottom pieces it will use that space. I chose to do a screen print of my 3D model asit shows in the Aurora Toolset, shrink it down, paste it over top of the sample file I extractedusing NWN Viewer, and then tweak the image to get it to look cleaner and brighter.

    0'

    7. Now, to do the overlays of the 3 model pieces, NWN uses a mask channel to know whichportions of the bitmap to lay down. What you need to do is create this mask channel for itbefore you save your image. Details on how to do this will vary depending on the software youuse. Using Picture Publisher, it has a magic

    wand for creating a mask. I start by creating themask of the black space surrounding the image(magic wands work best if given a single color toencapsulate). Then invert the mask so that it is amask of the trident head instead of one excludingit. I could have done a mask directly of the tridentbut it has many colors and I would probably haveneeded to zoom in and select the mask areamanually.

    8. Now save your image as a Targa Bitmap. Again,be careful. I needed to select Options first andexplicitly tell Picture Publisher to save the maskchannel. Otherwise it just saves the image as a24-bit Targa file instead of a 32-bit one withmask.

    9. Close and re-open your saved file in your image program. If the mask is still there you got itright. If not, try again.

    10. Copy the newiwplss_t_011.tga file into your /override directory.

    11. Open up the Aurora Toolset. If it was still open from before, save and close your module first,then close and re-open the toolset.

    12. Open your Weapon Tutorialmodule.

    13. Select the Area you created, and then the Item icon on the right toolbar (it looks like a sword).

    14. Choose the Custom tab.

    15. Your spear should be under the Weapons, Polearms category.

    16. Right click Trident and then select Edit from the pop-up menu.

    Hint If you see the icon in the toolset but not

    in-game then the dimensions areprobably wrong. In baseitems.2dathere is an icon height and width - thisis measured in squares on yourinventory screen in-game. Your iconsneed to be (32 x height) x (32 x width).tga files. If they aren't they still displayin the toolset (it is just a .tga, after all)but when the game engine tries to cramyour icon into the inventory squareswhere it should fit it cannot and givesup.

    Since we are using the spear entry, weare okay by copying the spear icon andkeeping its dimensions.

  • 8/22/2019 Custom Content v3_0.pdf

    24/208

    )-

    !

    17. Select the Appearance Tab.

    18. Your trident should now have a 3D model and a 2D icon. If you only have the head of yourtrident in the 2D icon, your mask was probably not done properly and NWN is overlaying theother two components with your entire image file. Check the mask again and repeat thesesteps.

    1'

    &:;,#-#Up until now we have been using the /override directory to load our new model and icon. This

    overrides the standard spear model 3 for any module you play. There are two shortcomings tothis approach:

    Using the /override directory is the wrong

    way to override content (except as a quick way totest your changes).

    You are replacing an existing model. This is acommon way of adding new custom content(select an existing object that you do not plan touse in your module and replace it with your

    content). But it does not allow you to use theoverridden item in that module. And your newmodel must behave exactly the same as whatyou are replacing (same damage dice, etc.)

    We will examine more sophisticated ways of adding newweapons. We are going to introduce two new conceptshere:

    Hint Why didnt we do this from the

    beginning instead of first replacing the03 spear model? We could have but Iwanted to show you both methods replace or adding custom content isapplicable to many different types ofcontent, not just weapons.

    The/overridedirectory can be faster fortesting models (without having toupdate hakpaks all the time) althoughpersonally I find the effort of startingand stopping the toolset all the timewhen you use the /override directory ifyou do to be time-consuming itself.

  • 8/22/2019 Custom Content v3_0.pdf

    25/208

    )-

    &

    Using a hakpak to load the content into NWN for a specific module (instead of using/override which affects allmodules you play on your machine)

    Adding a newspear model (instead of replacingan existing model).

    Start by moving your files out of the /override directory. Dont forget this step! This is one ofthe reasons I strongly recommend against using the /override directory it is too easy to

    forget and leave things in it. A month from now you will be wondering why one of your spearslooks like a trident in spite of everything you do to change it.

    1. Move wplss_t_031.mdl and iwplss_t_031.tga from the/override directory. We will put them in a hakpak

    instead.

    2. Rename the icon file we just created asiwplss_t_051.tga (dont put it in the /overridedirectory!). That way they will not override model 3.

    3. Go back and resave your model file aswplss_t_051.mdl. You should change the internal

    model name to be wplss_t_051 as well. You can dothat either from within gmax (change the name of themodel from WPlSs_t_031). Or, open the .mdl file with

    a text editor and changing all instances of wplss_t_031to wplss_t_051.

    4. Create a new hakpak (see appendix for instructions).

    5. Add your model wplss_t_051.mdl and iconiwplss_t_051.tga. If you used a .tga file as a

    texture, add it as well (if you used the standardw_metal_tex.tga, you do not need to include it againbecause it is already in the game).

    Hint Important: you must have both the 3D

    model file (.mdl) and the corresponding2D icon (.tga) in your hakpak. If youonly have one or the other, NWN willnot recognize the available model.

    Select the highest existing modelnumber for the weapon you are usingas a template (in this case the highestspear model is 4) and add 1 to it foryour model.

    The game works fine even if you do nothave all 3 colors or even the same # ofmodels for all parts of the weapon (e.g.,it is okay to have 5 spear head modelsand only 4 shafts and ends).

    Having said that, you should provide allthree colors (otherwise it is too easy tomis-select a model/color pair andaccidentally end up with charactersrunning around in-game with only two-thirds of a weapon).

  • 8/22/2019 Custom Content v3_0.pdf

    26/208

    )-

    233%#

    6. Save your hakpak.

    7. Open up the Aurora Toolset. If it was still open from before, save and close the module andtoolset then re-open the toolset.

    8. Open your Weapon Tutorial module.

    9. Select Edit | Module Properties and click on the Custom Content tab.

  • 8/22/2019 Custom Content v3_0.pdf

    27/208

    )-

    /

    +33#

    10. From the drop-down for the Hak file, add your hakpak. Ifit does not appear in the drop-down, your hakpak isprobably not in the /hak folder of your game directory.

    11. Save and close the module and then reload it.

    12. Select the Area you created, and then the Item icon onthe right toolbar (it looks like a sword).

    13. Choose the Custom tab.

    14. Your spear should be in the Weapons, Polearms category.

    15. Right click Trident and then select Edit from the pop-up menu.

    16. Select the Appearances Tab.

    17. Switch the top model type to 5 and you are done. It should look the same as it did before. Now

    I can use all four original spear models and the trident.

    Hint You can add more than one hakpak to

    a module. If you do this, take care howyou order them the contents of thehigher priority hakpaks override thelower priority ones. So, for example, ifyou put two longswords with the sameweapon ID in two hakpaks, the topmostone would be the one you get to playwith in the game.

    Sometimes the Aurora toolset getsconfused about hakpaks. I have foundthe best way to load or reload a hakpakis to close and re-open your module.

    So, to add a new hakpak to a module,save and reload your module afteradding the hakpak in the Advancedtab.

    If you have modified a hakpak and want

    to use the modifications, save andreload your module again.

    If all else fails, close and re-open thetoolset.

    If that still doesnt work, check thecontents of your hakpak again forcompleteness (remember, for aweapon you need both the 3d modeland 2d image).

    Remember that if you use a Hakpak inyour module, players must place thesame Hakpak in their 'hak' directory toplay the module be sure to bundle the

    Hakpak with your module when offeringit for download!

  • 8/22/2019 Custom Content v3_0.pdf

    28/208

    )-

    2

    :%)-

  • 8/22/2019 Custom Content v3_0.pdf

    29/208

    )-

    9

    Column Description Values

    containing the name for yourweapon.

    use the label for a name). However,this does not work. Instead, I went fora jog through dialog.tlk (it is abig file) and found that some forward-thinking individual at Bioware actually

    included many of the unused weaponnames so I chose 67251 (Trident). Ifyou cant find the right name for yourweapon, re-use one of the otherweapon names. This will give it thesame name as that item in the ItemWizard (more on this issue at theend of this section).

    Label The internal label for your weapon. I chose Trident. Use _ underscoreinstead of spaces if necessary.

    InvSlotWidth

    InvSlotHeight

    Inventory slot width and height. Make sure it matches the size of theicon you created earlier (in our case

    1 x 4 because our icon is 32 x 128).

    EquipableSlots Identifies which slots you can equipthe item into. This is a hexadecimalvalue. You must identify all of theappropriate slots, add together thevalues, and enter the correspondinghex value into this column.

    0x00000 Not equipable

    0x00001 Helmet

    0x00002 Armor

    0x00004 Boots

    0x00008 Gloves

    0x00010 Expendable Weapon

    (shuriken, etc.)

    0x00020 Shield or other

    offhand non-weapon

    0x00030 Missile weapon

    (bow, sling, etc.)

    0x00040 Cloak

    0x00180 Ring0x00200 Amulet

    0x00400 Belt

    0x00800 Arrow

    0x01000 Bullet

    0x02000 Bolt

    0x1C000 Creature Weapon

    0x1C010 Two-handed Weapon

    0x1C030 One-handed Weapon

    0x20000 Creature Armor

    CanRotateIcon Whether or not the icon in theinventory can be rotated to fit if thereis not enough room otherwise (I

    think).

    0 if no1 if yes

    ModelType The type of model. 0 normal item1 helmet2 weapon3 armor

    ItemClass Name of the new model you havecreated (without the_t_001extension).

    I used WPlTr to create a new class.Refer to your naming standards forthe basics.

  • 8/22/2019 Custom Content v3_0.pdf

    30/208

    )-

    Column Description Values

    GenderSpecific Are there gender specific versions ofthis item? No for everything exceptarmor. I cant for the life of meexplain why arrows are genderspecific, the one exception to this

    rule. Female characters get adifferent kind of arrow? That justseems politically incorrect.

    0 if no1 if yes

    Part1EnvMapPart2EnvMapPart3EnvMap

    Defines how the environment map isapplied to the alpha channel in themodel's textures.

    There is one map for each of thethree weapon parts:Part 1 bottomPart 2 middlePart 3 top

    1 will apply the environment map,giving you reflective surfaces. This isused for metal surfaces.

    0 will not apply the environment map.This is for wood-like textures and istypically used on the handle of amace, etc.

    '****' not applicable. This is used foritems that do not have 3 pieces orthat do not have an actual model.

    Default Model The default model for when the itemis laying on the ground.

    Typically it_bag.

    Default Icon Does not appear to be used foranything

    ****

    Container Is the item a container? 0 if no1 if yes

    This only true for one item, the largebox. This same item is also used tocreate large bag items like themagic bags of holding. Go figure.

    WeaponWield Identifies the animations a characteruses to wield the item.

    1 Non-wieldable/wearable4 Two-handed items (e.g.halberd)5 Bows6 Crossbows7 Shields8 Double-headed weapons9 Creature weapons10 Dart and sling11 Shuriken and throwing axe**** Standard weapons

    WeaponType The type of weapon and type ofdamage it does.

    1 Piercing2 Bludgeoning3 Slashing4 Slashing and Piercing

    WeaponSize Size of the weapon. 1 Tiny2 Small3 Medium4 Large

  • 8/22/2019 Custom Content v3_0.pdf

    31/208

    )-

    Column Description Values

    RangedWeapon Index to the type of ammunition usedby a ranged weapon.

    Note: it does not appear to bepossible, at least as of v1.29, to

    create a new ranged weapon. It ispossible to replace an existingranged weapon with a new one.

    This can point to either another item(for items that are projectile weapons- e.g., 20 for an arrow) or to the itemitself (for items that are thrown e.g.,59 for a shuriken).

    **** if this is not a ranged weapon.

    PrefAttackDist The preferred distance for attackingwith this weapon.

    Not sure how this is used. It could behow far away the character stands incombat or something.

    MinRange The minimum number of weaponmodels of this type.

    The actual value to put in here is therange you want x 10. It is hard tocheck what this actually doesbecause it probably only allocatesspace in an internal stack for weaponmodels.

    MaxRange The maximum allowed number ofweapon models of this type. Mostweapons have a limit of 10 models(and 3 colors). The game will ignoreany models higher numbered thanthis figure unless you change thisvalue.

    For weapons, the actual value to putin here is the range you want x 10.So it is 100 for most weapons. If youwant 11 longswords instead of 10,make it 110.

    For other items this field is notmultiplied by 10. Go figure.

    This field appears to have a limit of255 (i.e., it is a one-byte integer) soyou cannot have more than 25weapons of one type. Or 255 of otheritems.

    NumDiceDieToRole

    Number of dice to roll of type E.g., for damage of 2d6 you wouldput 2 in NumDice and 6 in DieToRole

    CritThreat Chance out of 20 that you will get acritical hit:

    20 only 119-20 218-20 3, etc.

    CritHitMult Damage multiplier if you get a criticalhit.

    I chose 2 (if you look in the PHB, aspear has a critical hit multiplier of 3but a trident is only 2)

    Category I havent quite figured this one out. Itappears to be related to theCategory definition in other tables

    (like spells.2da) where it defineswhat the item is used for. This isused for the AI engine to allow NPCsto properly use the item if equippedwith it.

    BaseCost Basic cost in gold pieces for a non-magical, standard item. For weaponsit maps back to the cost in the PHB.

    As soon as you start adding magical

    See ItemMultiplier for additionalinformation.

  • 8/22/2019 Custom Content v3_0.pdf

    32/208

    )-

    Column Description Values

    properties to weapons, the cost goesup accordingly. That is what the costline items in the item propertydefinition tables account for.

    Stacking Number of identical items that can bestacked together in your inventory(this is why you get 99 arrows in abundle, 10 potions, etc.)

    ItemMultiplier Multiplies the BaseCost to give theactual item cost.

    If you look at the BaseCost field for ashortsword, for example, it is set to10. The ItemMultiplier for shortswordis set to 2. The in-game cost forshortsword is 20.

    Set the ItemMultiplier to 3, and theshortsword costs 30 in-game. (testedby Zimero)

    Description String reference to dialog.tlk fora description of this item.

    Use 0 (this leaves the descriptionblank because there is no entry for atrident description in dialog.tlk). In thenext section I will show you how touse a blueprint to overcome thisproblem in a different manner.

    InvSoundType The sound made when clunkingitems around in your inventory.

    Refer to inventorysnds.2da fordetailed values.

    MaxPropsMinProps

    The maximum and minimum numberof spell properties that an item canhave. This can be seen in the itemproperties page where scrolls,

    wands, etc. can cast 1 spell andmost other items are able to hold upto 8. Other properties are notincluded in that max, only cast spells.

    For some items, the min/max valuesare 1/1, implying they must have oneproperty (like a scroll). For mostothers it ranges from 0 to 8.

    I don't know what would happen ifyou tried to set something to havemore than 8 since there is only roomfor that many around the radial menuwithout have sub-menus.

    PropColumn This column determines whatproperties can be assigned to agiven item.

    Refer to itemprops.2da. However,this is not an index to the row in thattable, it is an index to the column. Forexample, melee weapons at column0 can have almost any propertyassigned to them, but torches atcolumn 20 can only have light.

    StorePanel The panel of the merchant inventorythat this item shows up in.

    0 Armor and clothing1 Weapon2 Potions and Scrolls3 Wands and Magic items4 - Miscellaneous

    ReqFeat0 toReqFeat4

    The feats required to use thisweapon.

    44 Exotic45 Martial46 Simple

  • 8/22/2019 Custom Content v3_0.pdf

    33/208

    )-

    Column Description Values

    48 Druid49 Monk50 Rogue51 Wizard

    AC_Enchant The type of AC bonus this itemprovides. 0 Dodge1 Natural2 Armor3 Shield4 Deflection

    BaseAC The standard or base AC bonus thatthis item imparts.

    AC1 (e.g., Small Shield)AC2 (e.g., Large Shield)AC3 (e.g., Tower Shield)

    ArmorCheckPen The penalty to your skills thatequipping this item makes (refer toskills.2da; skills affected are thosewith a 1 in the columnArmorCheckPenalty).

    This is actually the penalty on a d20roll. E.g., a 1 is a 5% penalty. 2 is a10%, 10 is a 50%, etc.

    BaseItemStatRef String reference to dialog.tlk fora description of the statistics of thisitem (e.g., required feats, critical hits,etc.) in text form. This goes belowthe weapon in the inventory whenyou identify the item.

    I use 59 (this leaves the descriptionblank because there is no entry for atridents statistics in dialog.tlk). If weleft in the description for a spear wewould be close (but no cigar). In thenext section I will show you how touse a blueprint to overcome thisproblem in a different manner. Youcould also try 0 like we did for theDescription field but this causes aproblem in-game because the engineinterprets 0 in this field as an

    erroneous reference.ChargesStarting Starting # of charges 0 for most items. 50 for wands, etc.

    RotateOnGround An indicator that tells you how torotate the model so it lays flat on theground (e.g., you dont want a swordstanding on its edge when you lay itdown).

    0 Do not rotate (this is used for mostitems without models)1 Rotate 90 deg. about y axis (this isused for most weapons)2 Rotate 90 deg. about x axis (this isused for crossbows and potions)

    WeaponMatType Type of material the weapon is madeout of used to define the sound theweapon makes against differenttypes of armor.

    Refer to weaponsounds.2da fordetailed listings of the different items.

    AmmunitionType Type of ammunition the weaponuses.

    I think this should map toammunitiontypes.2da buteverything seems offset by +1.

    1 arrow (0 in ammunitiontypes.2da)2 bolt (1)3 bullet (2)4 dart (3)5 shuriken (4)

  • 8/22/2019 Custom Content v3_0.pdf

    34/208

    )-

    !

    Column Description Values

    6 throwing axe (5)

    QBBehaviour No idea.

    ArcaneSpellFailure Increased chance this item will causea spell failure.

    Only values are used for shields.

    TenthLBS Weight of the item in tenths ofpounds (take the weight from thePHB and multiple by 10).

    There is a bug with this field: 255 isthe maximum value for this field (aweight of 25.5 lbs). Anything overthat becomes mod 255 (i.e., resetsback to 0 at 256 and goes up again).It appears that this is only a one byteinteger value whose max value is FFhex = 255 decimal.

    An alternate solution, if you reallymust have a heavier item, is to addthe Base Item Weight Increaseproperty in the toolset (depending on

    the item you may have to open thisoption up by adding the flag initemprops.2da).

    %AnimSlashL

    %AnimSlashR

    %AnimSlashS

    % of the time that your character willuse this animation type whenwielding this weapon.

    Left, Right or Straight. For a piercingweapon, set L and R to zero. For aslashing or bludgeoning weapon, setS to zero. For a slashing/piercingweapon use a combination.

    StorePanelSort Not sure. Looks like sorting order forthe merchant panels.

    ILRStackSize No idea. It looks like a repeat of theStacking column. ILR typically refersto Item Level Restriction but I dontknow how this applies here.

    6. Back through the same routine. Save the .2da file, load it into your hakpak.

    7. Rename the WPlSs_t_051model to WPlTr_t_011 (WPlTr, remember, is the new ID for our

    trident) and change all the internal references.

    8. Wait, where are the rest of the WPlTr_x_nnz models and icons? Good point. We only have a

    model for the tridents head. That worked fine when we are attaching the trident head onto aspears body but now we are creating a new weapon and it needs all three components. Now,

    remember that the spear shaft and end worked fine for us? Copy the WPlSs_m_011 andWPlSs_b_011 files to make trident files as well (named WPlTr_m_011 and WPlTr_b_011

    respectively) and change those internal references as well. Now it is starting to look better.

    9. Do the same for your icon files.

    10. Load all of these into your hakpak. You should have, at a minimum, the following:

  • 8/22/2019 Custom Content v3_0.pdf

    35/208

    )-

    &

    -%#33

    11. Load up your module in the Aurora Toolset.

    12. Now you can create a new trident using the Item Wizard.

    13. If you follow these steps exactly, you dont get a lot of options for spear components to choosefrom. Duplicate some of the color versions as well (_012, _013, etc.) and/or the other shaft

    and end models so that you have a nice selection of components. You can make multiple

    copies of the trident head as well, with different colors or shapes, if you desire.

    For some weapons you wont find an entry in dialog.tlk. Chose another appropriatename (I used Custom #1 for some items). This is annoying in the Aurora Toolset becauseyou need to remember that Custom #1 in the Item Wizard is your new weapon. But thereis a workaround for this that avoids the problem in game. In the next section we will talkabout creating a Weapon Blueprint. Once you have a blueprint, you will not need toremember that Custom #1 is actually your new weapon because you can create newitems directly from the blueprint.

    In the early days of content creation, people felt compelled to update the dialog.tlk file to

    provide names for new objects (otherwise their item names had to re-use existing names soyou could not have a trident because there is no entry for Trident in dialog.tlk). As part oftheir resolution to this problem, Biowares latest fixes are starting to allow you to use **** in the.2da files for the dialog.tlk name references. When it sees ****, the game engine will use

    your custom label or another field instead of looking for the text in dialog.tlk. This now worksfor some objects. Unfortunately, they havent come through for the baseitems.2da file. MaybeBioware will get this fixed soon so stay tuned. Regardless, DONT USE dialog.tlk.

    Hint .2da files load in sequence. If you add

    new entries to a .2da file, add themafter the last entry you used. If you addthem before, it will mess with theinternal references to items in your

    modules.

    The same applies if you need to deletea reference. So, instead of physicallydeleting a reference, simply seteverything after the ID to 0s and ****s.

  • 8/22/2019 Custom Content v3_0.pdf

    36/208

    )-

    /:%)-+-

    The last thing you need to understand is how to create acustom blueprint. A blue print goes into a specific

    module. Take the spear we created earlier. Change itsname and tag on the General tab to Waveif you did notalready do so. Under the Properties tab, give Wavea +3bonus, and whatever other characteristics you think areappropriate. In this case, I will allow Waveto cast thespell Elemental Shield to simulate the Cube of Forceeffect it should have (maybe at some point I willincorporate the cube of force script Soliaswrote). I willgrant On Hit, Wounding as a special property tosimulate the dehydration property.

    &4$

    Add a description to be used when the item has not beenidentified and another when it has. Now save Waveby

    exporting it as an .erf file (Exported Resource File). It cannow be packaged together with your hakpak anddistributed to others to use (do not load it into your hakpak a .erf file is imported into the NWN Toolset separatelyusing File | Import)

    By setting the item description you will find another way toovercome that nasty dialog.tlk problem I mentioned earlier.When you create a blueprint like this, you can override theitem name and the default descriptions with appropriate

    Hint

    The toolset does not have acustomizable On Hit event forweapons. Without that ability, it will bedifficult to implement some of Wavesfeatures. All is not lost though. Sekhmethas come up with an elegant hak thatprovides OnHit events for weapons.You can find it on NWVault bysearching for OnHit in the Haks section.I may add information on it to a laterversion of this tutorial.

    Hint Be careful with blueprints. As long as

    people use your hakpak intact, .erf filesare a great way to create blueprintseasily using your weapons. However, ifyou mix and match 2da files, dontimport old .erf files into your modulesand expect them to work. The internalreferences get mixed up.

  • 8/22/2019 Custom Content v3_0.pdf

    37/208

    )-

    /

    fields for your weapon. This way, as long as module builders load in your .erf file, they wont haveto worry about what dialog.tlk thinks your file should be called because they can build right off theblueprint instead.

    You cannot override the BaseItemStatRef this way but you can do something just as good.Remember where we put 59 in the BaseItemStatRef of baseitems.2da? This blanks out the itemstatistics description a good first step. But now we are missing the stats. How do we get them

    in? Put them at the end of the regular Description in the blueprint at the very end. This works inthe game engine because it always displays the item description followed by its statistics. Nowthe inventory will look just like it does for any other weapon: a description, then the statistics, andthen any special items or properties. Youve tricked the game engine into looking the same as itdoes if you had a real BaseItemStatRef entry.

    2:-%

    When we created the resource declaration for our model, we separated our trident forevermorefrom thinking it was some sort of poor third cousin of a spear. Unfortunately, it loses something inthe translation. We need to add back in some of the specialeffects that a spear enjoys but are missing from our trident.Pictured below is the Frost effect:

    )

    There are seven magic effects that you need to account for:

    _fxacid Acid

    _fxelect Electric

    _fxfire Fire

    _fxfrost Frost

    _fxholy Holy

    _fxneg Negative

    _fxsonic Sonic

    Note Biowares DDS Compression Toolwill not uncompress a DDS file into a

    bitmap. It is one way only (.tga to .dds).To uncompress a bitmap, useDDSTools and then discard all but thehighest resolution bitmap.

    DDSTools flips your image verticallywhen creating the DDS from the bitmap(which will usually mess up how it mapsto your model although you may notnotice it if it is a random pattern). UseBiowares DDS Compression Toolinstead (which does not flip) ormanually flip your bitmap first. Also,DDSTools will not work with 32-bit .tgafiles (i.e., files with an alpha channel)although Biowares will.

    There. I will bet you were wonderingwhy I included both in therecommended toolset. Now you knowBiowares tool is better but is only one-way.

    DDS is a lossy compression algorithmbut does a good job in most cases andthe file sizes are much smaller and theyrun faster.

    If you absolutely must have one texture

    extremely high resolution, put just the.tga in your hakpak for that file.

  • 8/22/2019 Custom Content v3_0.pdf

    38/208

    )-

    2

    Each of these is a special emitter, generally placed somewhere along the blade of the weapon.To recreate these, the simplest approach is to load in an existing model of this type and thenmove the emitter to the appropriate spot for your models (remember, the positions of the differentcomponents of the weapon models should be the same for a given weapon). For our trident, wewill just copy the spear effects models. We can even leave the emitters in the same placebecause the tines of the spear are roughly in the same place as the head of the spear. If wewanted, we could duplicate the emitters, one for each tine, but I dont think this adds anything tothe effect so I chose not to do this.

    To test out the effect, create a weapon in the Aurora Toolset. Select the Properties tab and giveit a Damage Bonus, frost. Press Edit Property and then change the damage bonus to 5 (youneed to choose a damage value > 1 otherwise the toolset does not apply the effect). When youclose that pop-up, you will see the special effect from the emitter. If it is not in the right place youmay need to move the position of the emitter in the standard model. There is also a motion blurmodel (_mb). This shows the standard arc of the weapon when being wielded in the game. Again,because the spear is so similar to the trident we have built, I will not adjust the motion blur model.We will just copy the spear model and rename it.

    %4

    Let me start with a word about textures. If you includeno textures your model will take on a uniform chromedfinish. Textures are bitmaps (Targa bitmaps, 24-bit or32-bit, RGB Color, uncompressed) used to introducethings like the special gold and wood-grained models inthe game. The default weapon texture that almost all ofthe Bioware weapon models use is w_metal_tex.tga(it can be found in the data\templates.bif file using NWN viewer). This file is a matrix ofsquares with different textures on it. If you use this texture you can get a good selection of metals(plain, gold and bronze) plus wood, a few colors forgems, etc. You do not need to include this file in yourhakpak it is already available in the game.

    If you are going to include a custom texture, include a

    high resolution one (512 x 512 or at least 256 x 256)and pick up Biowares DDS Compression Tool orDDSTools to run against your .tga file. Include both the.dds and a lower resolution version of your .tga file intoyour hakpak (say, 64 x 64). Higher-performancegraphics cards will use the dds for high detailing. Oldermachines will use the .tga file with slower graphicscards. If you leave out the .tga file, machines with lowerend graphic cards will see your models in plain white.Not pretty.

    While you are at it, you may want to turn your 2D iconfiles into DDS files as well. Im not sure what this does,exactly, but you will find DDS files for all of the icons in

    the \texturepacks\GUI_32bit.erfdirectory, so it probablymakes sense to have them. My experience so far has been that the game works fine withoutthem but that may not be true for some hardware.

    Faces (3d model faces, not your characters face) in NWN are two-dimensional. If viewed fromthe backside (or inside), they have no existence and do not render. A normal is a unit vector thatis used to define which way a face is pointing. The direction in which the normal points indicates

    Untested Note (from Revinor) Try doubling the size of your .tga file

    before compressing it to avoidpixelization. You will convert every pixelto 2x2 pixels (smooth it if you like);THEN convert it to DDS - quality shouldbe better (and file size of course will bebigger).

    DDS compression works on 4x4 blocksof pixels. If you have more than 2distinct colors in the same 4x4 block,you will have some pixelization (every4x4 block is defined by 2 colors plustransitions between them). For mosttextures, it is really acceptable - youcan show smooth transitions (4 levelsof transition for 4 pixel space - ideal)and you can show hard edges.

    Notes If it is going to have transparency your

    texture will need an alpha channel andshould be saved as a 32-bit tga. Thereare some more rules to follow when itcomes to textures: no bump-mapping,no procedural textures, nothing butyour basic image channel and opacitymap (the alpha channel).

  • 8/22/2019 Custom Content v3_0.pdf

    39/208

    )-

    9

    the front of the face (more specifically, the normal points out from the front of the face). This is theside of the surface that is normally displayed with its texture in the game.

    This is important because you will sometimes find your polys dont render properly (some aresee-through, for example). You must manually flip or unify face normals to fix these types oferrors (they are typically caused by activities like mirroring objects). To do this, enable Face,Polygon or Element sub-object mode on your editable mesh, and then use the buttons on the

    Surface Properties rollout to change the directions in which normals point. Flip Normals willreverse the direction of a normal vector. Unify Normals makes all of the selected normals point ina consistent direction (if an object has normals that are inconsistent - some point outw