| |
Main Menu
Site Home Page
Glossary of Terms
Current Class Mod Package

Help! My mod is corrupted!

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
- Create the Object
- Deciding on a Tag
- Spawning in the Object
- Doing Things to the Object after Creation
-
-
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

Week of June 7th, 2009
Topics:
-
Items
- Properties
- Building your own items
- How to make an item have a conversation.
-
-
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
-
Homework:

Week of June 1st, 2009
Topics:
-
Areas
- Area Properties
- Module 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:

May 27, 2009
Topics
Homework
|
|
GAME CONCEPT AND DESIGN
COSC 320.101_SU09
SUMMER 2009
Placeables
We know that a placeable is one of the scenery objects from the right-hand palette. Click on the placeable you want to use, then move the mouse to the map and you'll see a ghost version of the placeable attached to the cursor. Click again to drop a copy onto the map. Use the red-curly arrows below the map to rotate the placeable until it's facing the direction you want.
If you plan to drop more than one copy, you can hold down the SHIFT key as you click and each click will drop another copy of the object.
The blue arrow you see is where the player character will usually stand to interact with the placeable.
Placeable Properties
Opening up the properties sheet shows you the familiar properties options with a few new, interesting tidbits.
Basic: Here is the name and tag fields for this placeable. You'll also find an Appearance Type dropdown which lets you change the way the object looks in the world; if you put down a sign and change it to look like a barrel, it will. Although it'll still tell the player it's a sign. (So why not just put down a barrel?) Like doors, you can also set statistics on how difficult the door is to destroy, or set it to Plot if you don't want it to be destroyed at all. There are also a few more check boxes that will enable or disable themselves depending on the status of other checkboxes.
- Plot: This means that the object cannot be destroyed by players. They're a wierd group and will destroy things if given a chance. (Think Zelda and the 1000's of barrels and boxes that are demolished by players.) This will keep it from being destroyed.
- Static: It seems that most Placeables are set to Static by default. Static means it will be treated as if it's just scenery. None of the scripts will run if the object is set to be Static. If Useable is checked, then Static will be turned off.
- Useable: If Useable is checked, then the player can interact with the placeable. Clicking on the item will cause the object's onUsed event to fire and run whatever script is there.
- Has Inventory: If Useable is checked, then Has Inventory will be available. Clicking this will indicate that the placeable has an inventory space in which you can place items for the player to find. Essentially, the item becomes a treasure chest.
- Inventory... If an item is set to have inventory, the Inventory button under the picture becomes available. Clicking this opens a window with two panes. The right is a list of things you've put into the inventory, and the left is a duplicate of the items palette. Scroll through the items and double-click or drag to add items to the left-hand pane. Now, when the player opens the item (the first time, at least) he will find these items inside. To remove items from the left-pane, drag them down to the trashcan below.
Lock: This contains the same options as the Lock options for doors.
Trap: The same options for trapping a door.
Scripts: Here are the familiar assortment of scripts. I see that they've added an onClick event that was not there in the past. I'm not sure how that's different than the onUsed event.
Advanced: These options should look familiar. Notice the resref field! Also take note of the following:
- Conversation: If you want the object to run a conversation when clicked...and you know what conversation you want it to run...indicate the conversation here. There's another step or two you have to take to actually kick off a conversation but when it starts, this will be the default conversation that is displayed.
- Initial State: Some placeables have different "states" that can be displayed. For instance, torches can be lit or unlit; a lever can be in the "activated" or "not activated" state. You can set the way you want it to look when it's first put on the map using this box. (Be wary of detroyed...I had bad luck with it in the past, and I'm not sure if it's been fixed.)
- Treasure Model: If the object is set to be Useable, is not set to Plot, and does have Inventory...then when the player bashes the object to death the treasure contained within is put on the map in another sort of container. Here you can decide if you want that container to look like a bag, a pile of bones, a dead body, and so forth.
Description: Is what the player sees if he inspects the item.
Comments: Are comments just for you to see when in the toolkit.
Spawning Placeables
As I pointed out, there is a resref field, which means that placeables have a blueprint. If you're making mental connections, then you've hopefully realized that this means that you can use scripting to dynamically spawn in placeables just as if you were spawning in a monster! And it has a tag which means you can give it a unique name, which means you can manipulate it with scripting...typically to destroy it and remove it from the map.
How to Stack Placeables
This has changed since I originally wrote this and while doing some testing I have found the information here to be almost-but-not-quite-entirely-only-partially true. I'm leaving it because most of it still works. But will add NOTEs to things that seem to have changed.
According to the original official documentation, NWN does not support a Z-axis. You could not stack things on top of other things.
....BUT....
It turns out there was a handy little bug in the program that--once found--was deemed too handy to fix, so they didn't fix it. Instead it has been deemed "a feature"! Here's how to stack things. (I don't know how high you can stack, by the way..) I will talk you through how to put a crystal ball on top of a short pedestal, but the process works for nearly everything.
- Place the pedestal on the map and position it where you want it to be. Spend a bit of time to be precise because in a bit you won't really be able to adjust it. (You can, but you won't want to.)
- Maneuver the editing camera so that the camera is directly above the pedestal. Zoom in so you're nice and close. (Doesn't really have to be, but it's easier to visualize this way.)
- Now click on the crystal ball placeable in the palette.
- Move the mouse pointer so that the crystal ball "ghost" follows the mouse. When you get the pointer over the pedestal, the ball will probably seem to vanish and you'll just see the pointer. That's ok because the "ghost" is currently "inside" the pedestal.
- Position the brush as best you can and then click. The ball will appear on the pedestal.
- Now here's the warning!! Once the item is stacked you cannot click it with the mouse! You cannot! If you click it, the toolkit will suddently realize what's going on and the ball will drop to the ground. Use the red-curly arrows to rotate it if you need to.
- If it's not positioned where you like it, you'll have to delete the ball and try to position a new one. (NOTE: They've added a new option called "Adjust Location." Read about it below.)
- If you need to adjust the crystal ball's properties, go to the left-hand pane where your assets are displayed. Right-click on the crystal ball's name and you can open properties from there.
- Do not click the stacked item in the map window! (You will..you'll forget. When you do, you'll think of me at the front of the class saying, "You'll forget...you'll click it....")
To expand on the bug, you can also--usually--do this:
- Move or delete the supporting item so that the stacked item now seems to be floating in the air.
- Warning! Do not press F5 to update the screen! If you do, the object will fall to the ground. (NOTE: This does not seem to be true any more. When I pressed F5 my items now seem to stay where I stacked them.)
NEW! NEW! NEW!
While testing to make sure I'm not telling lies, I discovered that now you can right click a Placeable and there's an option called Adjust Location. This brings up a box that lets you fine tune the X, Y, and Z location of items. VERY NICE!
However, I also found that if you create something that's floating in the air and press F5 to refresh the screen then Gravity glances sharply at the object and it will fall to land on top of the item beneath it.
Also, confusingly, if you use the Adjust Position to put an object on top of something else...then accidentally click the object it will fall through and land on the ground. But pressing F5 will pop it back into place. Good luck managing the mental gymnastics created if you have somethings floating and some things stacked and have to press F5 at some point....
How to Have a Placeable Hold a Conversation
You might want a placeable to run a conversation for a number of reasons:
- Perhaps the placeable is a sign with lots of information you want to display to the character.
- The placeable may be something that gives the player some options. "You stand before the altar. Do you make a sacrifice?" with the player responses of "Yes" and "No."
- Maybe in your story the placeable is an enchanted object...like the Wicked Queen's Mirror in Snow White.
I mentioned that you can indicate which conversation you want to have the object run, but that there are a few more steps. Here's the process.
- Put the placeable on the map.
- Check the Useable box to allow the player to click on the object.
- Indicate which conversation is going to be run.
- Create the conversation making sure that the name of the conversation file matches the name you've put in the field.
- Write a script called chattyobject that contains the following lines of code:
void main ( )
{
object oPlayer = GetLastUsedBy( );
AssignCommand(OBJECT_SELF,ActionStartConversation(oPlayer));
}
- Again, make sure the upper- and lower-case, punctuation, and parentheses are all exactly as shown.
- Now go to the object's Script tab and set its onUsed handler to run the script chattyobject.
Viola! When the player clicks the object the script will cause the conversation to run.
|