Main Menu

Site Home Page

Glossary of Terms

Current Class Mod Package

Divider

Help! My mod is corrupted!

Divider

Week of June 15th, 2009

Topics:

  • Getting Help
    • The "Assistance" windows
    • The Lexicon
    • The Forums
  • Variables
    • Type-casting and the types
    • Conventions
    • Constants
  • Who Dun' It?
    • Who Spoke?
    • Who Used the Placeable?
    • Who Activated the Item?
    • Who Crossed the Trigger? Who Entered the Area?
    • Was it a Player? a DM?
  • Creating Objects
    • Preparing the Object
      • The Resref
      • The Object Type
    • At a Waypoint
      • Find the Waypoint
      • Find the Location
    • Where the player is
      • Find the Location
    • Create the Object
      • Deciding on a Tag
      • Spawning in the Object
      • Doing Things to the Object after Creation
  • Tracking Variables
    • Local Variables
    • Persistent Variables
  • Some Useful Scripts
    • Making Changes to the Avatar When It Enters the Game
    • Fiddling with the Avatar's Inventory
    • Destroying the Inventory Items
    • Destroying "Non-Destroyable" Items
    • Taking Gold From the Player
    • Giving Gold To the Player
    • Giving General Inventory Items to the Player
    • Giving Equipable Items and Forcing an Equip Action
    • Random Walk

Homework: Dungeon and Quest

Divider

Week of June 7th, 2009

Topics:

  • Items
    • Properties
    • Building your own items
    • How to make an item have a conversation.
  • Creatures
    • Properties
    • Building your own
  • Triggers
    • Choosing the right one
    • Drawing a trigger
    • Trigger Properties
    • Trigger Events and Scripting Preview
    • Examples of Trigger Use
  • Waypoints
    • Waypoint Properties
    • Waypoint Directions
    • Uses for Waypoints
    • Scripting Preview
    • How to Set Up a Patrol Route
  • Conversations
    • How they're used
    • The basic tree.
    • Branching
    • Links (or "Loop backs")
    • Tokens: Built-in and Custom
    • Colorizing the Text
    • Including Other Speakers
    • "Actions Taken" and other events
    • Conditional Nodes
  • The Journal
    • Categories
    • Entries
    • Updating the Journal through Conversations
    • Updating the Journal through Scripting
  • How to Test Your Mod
    • The Build Module Option.
    • The Real Way
    • The Test Module Option

Homework:


Divider

Week of June 1st, 2009

Topics:

  • Areas
    • Area Properties
    • Module Properties
  • Tiles
    • Tile Properties
  • Names
    • Blueprint / Resref
    • Tag
    • Display Name
  • Doors
    • Door Properties
    • Transitions between doors
    • How to make a door close itself
    • How to have a transition without a door
  • Placeables
    • Placeable properties
    • Spawning placeables.
    • How to stack placeables
    • How to have a placeable hold a conversation

Homework:

Divider

May 27, 2009

Topics

Homework

 

 

GAME CONCEPT AND DESIGN
COSC 320.101_SU09
SUMMER 2009


Names

Now is the time to chat about the concept of names and how you're almost guaranteed to be confused...unless you read through and understand the information I'm about to impart to you. =*)

As you may have noticed, many objects in NWN have three names. There's a name, a tag, and a blueprint resref. (This last term may be referred to as "blueprint resref", "blueprint", or "resref".) The different names really affect us, the designers and programmers, more than they impact the player.

  • Name. This is the name of the item as it appears in the left- and right-window panes of the toolkit, and what the player sees when his mouse rests on the object. In the toolkit's right-pane, you may see a placeable with the name "Bones." If you drag it onto the map and edit the name field to "Yorik's Remains," you will then see "Yorik's Remains" on the left-hand pane. When in the game, if the player's mouse pointer rests on the bones, the player will see "Yorik's Remains" light up above the object.
  • Tag. You can think of this as a sort of nickname for the object. The tag is really just for us, and really just for use in scripting. If you pull an orc from the palette, put it on the map, then look at its properties, you may see that its tag is listed as "NW_ORCA". If you pull 5 more out and look at them, they'll all have "NW_ORCA" as their tags. That's ok. However...

...suppose there was a switch nearby that, when pulled, would cause one of those orcs to fall down dead. You could give that particular orc a new tag, say "GONNA_DIE," and when the player pulls the switch, the switch's onUsed script looks for the orc with the tag "GONNA_DIE" and kills that orc; the other 5 are unaffected. Yet to the player, they are all named "Orc".

  • Resref. This is perhaps the most confusing one. The resref is the blueprint that the game uses to create the objects. When it puts an orc on the map, it's not really putting an orc. It's putting the object that is defined by the blueprint "nw_orca". Each time you put one of those items on the map, it'll use the same blueprint to create the object and every one will look exactly the same---because they're all from the same blueprint.

With me so far? You can find the resref for most objects by opening their property sheets and clicking the Advanced tab. Notice, however, that you cannot change the resref. Can't do it.

If you want to create a new version that looks different, behaves differently, or has different equipment or stats, you must

  • select it from the palette and put it on the map
  • open the properties sheet and make your changes
  • close the properties sheet
  • right-click on the creature (on the map) and select Add to Palette
  • the properties sheet will once again open however...
  • you will now be able to specify the resref name you want to use as the blueprint name for your object.
  • when you're done, your new object will appear in the Custom tab of the palette

Resref use becomes particularly handy when you're using scripting to create your objects dynamically. You use the CreateObject( )command, but must also tell the computer what resref to use as a blueprint. (You have to provide quite a bit of information to the script, but we'll look at that when we get to scripting.)

Other Name Notes

When writing scripts, one of the things you must do frequently is gather or alter information about the objects that the script is going to interact with. The scripting tool has a lot of commands that allow you to "look at" or "set" this information, including the names.

  • GetName( ) is used to get the display name of an object.
  • SetName( ) is used to set the display name of the object (what lights up when the player mouses over it)
  • GetPCPlayerName( ) gets the name of the player character's avatar
  • GetTag( ) tells you the tag of the object
  • GetObjectByTag( ) lets you look for an object with a particular tag
  • GetResRef( ) lets you find out the blueprint reference of an object, thus allowing you to spawn in more of them!

Plus..

  • CreateObject( ) asks for the resref of the object you want create and then allows you to give the new object a unique tag.