| |
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
Doors
Technically speaking a "door" is any of the openings through which a player passes (clicks on) to transition to a new area. I make this distinction because some tiles like the cave in the rural tileset has a blue-panel that the player clicks on that is exactly like the blue panel that he must click on when he opens a....door. In fact, these doors show up in the left-hand pane of the toolkit in the "doors" section of your area.
However, for our discussion, we will largely concentrate on what we think of as a door: The hinged affair with the knob. (or something similar).
In order to use a door, you click the door icon in the palette then select the door you want to install. There are two main options:
- Tileset Specific are rumored to be doors that are specially designed to fit with the theme of the tileset. I assume this means that doors in the snowy iceland might have icicles on them, or perhaps be made of ice. No other tileset has a door with this look. Personally, I have never found a door that looked any different than other tileset specifi doors. <shrug>
- Universal doors are not tileset specific. They look the same on every tileset.
Furthermore, under Universal are three sub-groupings
- Metal - a selection of metal doors. Handily they all play appropriate "metal door" sounds when used.
- Stone - a selection of stone doors that play "stone door" sounds
- Wood - a selection of wooden doors that play "wooden door" sounds.
To place a physical door on the map, there must be a doorway for the door to fit into. Fortunately all doorways (of this type, anyway) are exactly the same size. When you choose your door and move the mouse to the map, you will see the door attached to the mouse and the door will be spinning wildly. When the door is over a doorway that can hold it, a ghostly door will appear in the doorway. If it's the one you want, click the mouse and the door will solidify there.
Door Properties
Doors have a number of properties on their properties sheet under the various tabs
- Basic. Here you can change the name of the door, the tag, the visual look of the door. Furthermore you can set whether the door is "plot" meaning it cannot be destroyed or, if not plot, set the attributes for the door to determine how well it stands up to the players' attempts to break it down.
- Lock. Here you can set whether the door is locked or unlocked. If it's possible for a player to relock the door. You can specify if a key is required to unlock the door and what the tag of the key that is allowed to do so. You can specify if the key is removed from the player's inventory. If you have thief-characters, you can set how difficult it will be for the player to pick the lock or to relock the door.
- Trap. Is the door trapped, what sort of trap? Can it be detected or disarmed?
- Area Transition. This is where you set up the linkage between areas. We'll look at transitions more closely in a moment. Here you set the destination tag of the door or waypoint that the player will be teleported to, whether the transition works both ways (meaning you won't have to set up the return trip data on the other door). Most handy of all is a Setup Area Transition button that launches a little wizard that fills all this information in for you!
- Scripts - All the events the door listens for and the scripts to run in response.
- Advanced - Here you'll find the resref for the door. And you'll see the door's faction. Why is the door "hostile"? Well, I think that's so the player can attack the door if he chooses to. The game won't let you attack creatures / objects that are friendly to you so the only way to make it possible to bash the door is to make it hostile...although the door won't attack the player if the player comes too close. (Interesting game idea, though.) If the door is to start a conversation, here's where you set up the conversation. Typically the conversation window shows a small portrait of the NPC holding the conversation so you can specifty a portrait by clicking on the black Portrait box and choosing an option from the selections that appear. And there are some default starting variables.
- Description is text that the players see if they "examine" the door.
- Comments are notes to yourself.
How To Set Up An Area Transition
In order to set up a transition between areas (using a door or blue door panel) here's the steps you will take:
- Create the two areas! (That makes it considerably easier.)
- Put both doors in place.
- Give both doors a unique tag.
- Notice that when dealing with doors it's the tag that appears in the left-hand pane, not the display name.
- I find it useful to tag the door with the identities of both areas with an underscore between the names. The first name is the name of the area that the player is leaving, and the second is the name of the area that the player is going to. So, the gate that leaves the city and goes to the zoo would have the tag city_zoo and the one that comes back would be zoo_city.
- Go to one of the doors, open the properties sheet, and go to the Area Transition tab.
- Click the Setup Area Transition button.
- Here you use the drop down to select the destination area.
- Then you select whether you're teleporting the player to a door, a waypoint, or a trigger in the destination area. When you make your choice, you will see all the tags of that type of object in the destination zone. Click the one you want the player to teleport to.
- You can also set whether the transition is a two-way trip.
- Note that since players cannot see waypoints, they can't click on them, which means that you can't really set up a two-way transition between a door and a waypoint.
- Once you're done, click the OK button and your transition between areas is set up and works automatically.
- If you've set up a two-way door-to-door transition, you do not have to go fiddle with the other door. NWN does the work for you.
How To Have a Doorless Door
There may be instances where you want to have a door transition but don't want an actual door graphic. In other words, you only want the clickable blue panel. Sadly, there is not a blue-panel object, so you have to "fake" it...and it's really not that hard.
- As above, set up your door transition using a door with a graphic.
- Make sure the door you want to disappear has a unique tag. Let us suppose the tag of your door is closet_door.
- Edit the onModuleLoad script and add this line: DestroyObject(GetObjectByTag("closet_door"));
Now, when the module starts the script runs and it will find the door and destroy it. However, it only destroys the metal/stone/wood graphic representation--the blue-panel will remain clickable.
How To Make a Door Close Itself After It Has Been Opened
This is always a fun thing because it provides another moment of interactivity between the player and your game. It's wierd, I know, but it works. The idea is that the player clicks the door to open it, and after a few seconds the door closes. Let us suppose you want the door to close after 6 seconds.
- Use the script editor to create a script called something like "closethisdoor".
- Make the script read as follows:
void main( )
{
DelayCommand(6.0,ActionCloseDoor(OBJECT_SELF));
}
Note: In the first line, I have a space between the ( and the ), but that's just to make it legible here. You don't need a space when you create the script for real. In fact, the script editor will actually provide this line for you and you don't need to change it. Everything needs to be typed in exactly as shown. Upper- and lower-case, parentheses, curly braces, and semi-colons. It all has to be "just so." The DelayCommand( ) command requires a number telling the computer how long to wait; that's why we put a 6 there. However, it expects a "floating point" number so you have to include the decimal place and the trailing zero... 6.0 .
How to Have an Area Transition Without Any Sort of Door
Yes this can be done. You can set up an "trigger" on the ground and write a script for its onEnter event to move the entering creature to a new area. You can create set a Placeable and set its onUsed event to send the person to a new area. In fact once you get the hang of scripting you'll learn the command to move a person and can then program an area transition to happen for almost any reason you can imagine! But it does involve...scripting. |