SIEGE UNIVERSITY 1 |
||||||||||||||||||||||
Siege University II Tutorials Modding FAQ 095: Upgrading DSII 100: The Basics of Siege Editor 201: Compass Map Radar 202: Conversations 203: Journal 204: Quest Indicator Icons 205: Start Positions 206: Teleporters 207: Town Portal Restrictions 208: Weapon Effects 209: Flick 210: Tuning Grids 211: Setting Up Good Map Lighting 212: Setting Up Simple Node Fading 215: Building Data Tables Siege University I Tutorials 200: Concepts and Terminology 201: Templates 203: Triggers 204: Moods 205: Fades 206: Elevators 211: Naming Key 213: Dungeon Siege Resource System 301: Introduction to Dungeon Siege Architecture Third Party Tutorials A Simple Mod Part One - Armor Textures A Simple Mod Part Two - A New Armor Beginners Guide to Stitching Regions How to Open and Create Tanks Making Chants Work in a New Map Ornaments Understanding the NKK Useful Links Siegetheday.org Dungeon Siege Outpost Dungeon Raider Kdawg.org - List of useful Links MCarp DS Nodes Dungeon Siege 2 at Gamefront Broken World at Gamefront |
Naming
Key ·
What
You Need For This Tutorial ·
What
This Tutorial Assumes You Have Already Learned ·
What
This Tutorial Will Teach You Dissecting A Naming Key "Name" Practical Exercise: Extending The
Naming Key Introduction Dungeon
Siege stores all of its resource data internally in one of two
databases: the
GAS Database and the Content Database. The GAS Database contains the
definitions of all of the objects that are used in Dungeon Siege while
the
Content Database contains the actual data referenced by definitions in
the GAS
Database. What
You Need For This Tutorial ·
Dungeon
Siege 1.1 or later ·
Dungeon
Siege Tool Kit ·
gmax What
This Tutorial Assumes You Have
Already Learned ·
Siege U: 100 - The Basics of the Siege
Editor ·
Siege U: 200 - Concepts and Terminology
What
This Tutorial Will Teach You ·
How
the Naming Key is read, used, and created Warning The
entire Naming Key system relies on correctly formatted and spelled
Names. The
importance of naming your content properly can't be understated. If a
Name is
not valid, the Naming Key lookup will fail, files will appear to go
missing,
tools will not behave as designed, and eventually bugs will get
reported that
aren't really bugs at all. Dissecting
A Naming Key "Name" Let's
examine some samples of valid Names taken from the Dungeon Siege
Content
Database: m_w_misc_flamethrower By
convention, all Names start with a single character followed by an
underscore
("_"). This first character determines the main type of the file that
the Name represents. The main type character conveys additional meaning
to the
Naming Key and describes the information that it contains. Because the
type is
explicitly encoded in the Name, Names do not require any particular
extension
(i.e., no .BMP, .PSD, .SNO, nor .ASP). Omitting the extension from the
Name
allows you to alter the format that the data is stored in (converting a
bitmap
from a BMP to a PSD, for example) without forcing you to rename all of
the
instances where the Name has been used.
b_i_glb_placeholder generate:
\Art\Bitmaps\Items\b_i_glb_placeholder The
Naming Key Layout At
this point a key question remains: How is the information needed to
match and
expand a Name into a Content Database location stored in the NNK files?
Information is stored in the Naming Key in a hierarchical structure,
i.e. all
the information is arranged in a 'tree' similar to a directory 'tree'
on your
hard drive. TREE
= <complete branch prefix> , <the branch
directory>,
"<branch description>" Here
are three sample definitions taken from NNK files that illustrate what
an
actual tree definition looks like:
MyWorkInProgress.NNK In
the long run, keeping the Naming Key definitions separated across
multiple NNK
files will make it easier for end-users to pick and choose the mod
content they
want to access and avoid the sort of naming conflicts that arise when
two
people both define objects that use the same Name. Practical
Exercise: Extending The Naming
Key The
following 7-step tutorial will walk you through an example of extending
the
Naming Key with a new NNK file called "MyStuff.NNK". It illustrates a
feature in Siege Max that will let you automatically generate an NNK
stub file
and place it in the correct directory on your hard drive (so that other
programs that use the Naming Key for content lookup can access it) Step
One Launch
Siege Max Step
Two With
Siege Max running, open the MAXScript Listener console by selecting it
on the
main menu. Figure
1 - Launching the Listener
Step
Three Enter
the Maxscript command dsExtendNamingKey "MyStuff" into the MAXScript
Listener console. Figure
2 - Entering the command (note
cursor at end of line)
Step
Four Leave
the cursor at the end of the line of text you have typed (as shown in
Figure 2
above) and then press the ENTER key on the NUMERIC KEYPAD (not
the
regular Enter key!). Pressing Numpad-Enter executes the command on the
line
that the cursor is on. Executing this command will create a new file
called
MyStuff.NNK (Fig. 3), and then automatically open the new file using
"Notepad" to allow you to edit it (Fig. 4). You may want to make a
note of the directory on your system in which the new file is created.
This is
the default location in your "Bits" directory for any extra NNK
files. Figure
3 - Result of dsExtendNamingKey
command
Figure
4 - The generated NNK file
(before any edits)
Step
Five Use
the Notepad editor to make a copy the first TREE definition in the
generated
NNK file and paste it at the end of the file and remove the leading
comment (#)
marker (Fig. 5). Figure
5 - The generated NNK file (with
additional line at bottom)
Step
Six Switch
back to the Listener console, enter the command dsLoadNamingKey(),
then
press Numpad-Enter to execute it. This command causes the Naming Key to
be
reloaded (Fig. 6). Additional information is reported to you regarding
the NNK
files that are accessed by the loading process. You should see an entry
for the
EXTRA file "mystuff.nnk" that you just created Figure
6 - Loading the Naming Key
Step
Seven You
can test your new entry to be sure that everything is working properly
with
another Listener command. Experiment by entering the following
commands: dsBuildContentLocation
"m_i_bid_my-first-model" returns:
"Art\Meshes\Items\Biddle\m_i_bid_my-first-model" and
dsBuildContentLocation
"garbage" returns:
"undefined" because
the "garbage" is still not recognized as a valid Name. Figure
7 - Testing the new entry
|