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


Waypoints

Waypoints really only have one job and that's to invisibly mark locations on the map. They do it really well, however, and as your building prowess grows, you'll find that waypoints are probably the most often used object from the palettes. (Because waypoints are shaped like flags, I may slip and refer to them as "flags.")

There are a number of waypoints in the palette and although they don't do anything, they can affect the way that creatures around them behave. For instance (and I may get this wrong as this is new to me)....

Suppose you have an orc with the tag GruntBurpbelly. Bioware has pre-coded him to look for a waypoint whose tag is his name followed by "_HOME". So, if you create a waypoint and give it the tag GruntBurpbelly_HOME and put it in his messy lair, then at night the game will automatically make him walk from where-ever he is to the location of that waypoint.

Now that's not 100% accurate, but you get the idea. Depending on what tag you give the waypoint may influence any or all of the NPC's in the area.

Waypoint Properties

There's not a lot of properties here, but here we go.

Basic:

Name and Tag. Our old buddies.

Appearance: This is just for us, but you can change how the flag looks on the editor map. It's handy to visually mark "this flag is for spawning monsters, and this flag is for guard pathing" and so forth.

Advanced:

Waypoint Contains a Map Note: The player can press M to bring up a map of the area. If you have areas of particular interest, you can put a waypoint at that area and then use this check box to mark it as an "area of interest." It'll show up as a little star on the map.

Map Note Text: When they put their mouse on the star, the text that you put in the Map Note Text field will show up.

Map Note Enabled: Let me explain this in a backward fashion. It may be that you don't want them to see the text until after they've "discovered" the area. If so, do not check this box, then use scripting (perhaps on a trigger) to "turn the flag on" so the text will show. However, if you want them to see the text right away (without having to discover it first), do check this box.

Description: Seems a bit silly.

Comments: More notes for us, but in the waypoints, you'll find notes to us from Bioware about how to use a particular waypoint!

Waypoint Directions

You may notice when you put a waypoint on the map that the base has a pointy end. That's the...hm...facing direction of the waypoint. If you set a creature to spawn at that waypoint's location, the creature will turn so that it's face is looking off in the direction that the pointy bit is....pointing. If you tell a creature to go to location of a waypoint, the creature will walk to that waypoint...then turn. (This is because this compass orientation information is part of the location variable. Or so I understand it.)

Uses for Waypoints

As you've probably picked up already, there's a number of uses for waypoints.

  • Map pins.
  • Locations for where you want an NPC to move to.
  • The location where you want to have a creature to spawn if you're adding creatures through scripting.
  • The location where you want a placeable to spawn if you're adding placeables through scripting.
  • Setting up a guard patrol (see below)
  • Locations for where you are going to teleport a player when the destination doesn't have a door.

Scripting Preview

Because you'll use waypoints for so much work, it's vitally important that each one have a unique tag. There's nothing worse than teleporting a player to a waypoint and have him appear "somewhere else" because you've got two waypoints with the same tag. It has been my experience (for what it's worth) that I'm always tempted to tell an NPC to teleport to a waypoint, but he never does (even though that command exists). Instead, I have to get the location of the waypoint then teleport the player to that location.

So, let's suppose I had a trigger that teleports the player to a waypoint in another area. The script on the trigger's onEnter event might look like this:

void main( )
{
   object oCreature = GetEntering Object( );
   object oWaypoint = GetWaypointByTag("forest entrance");

   location lWaypoint = GetLocation(oWaypoint);

   if(
GetIsPC(oCreature) == TRUE)
   {
      AssignCommand(oCreature,ActionJumpToLocation(lWaypoint));
   }
}

How to Set Up a Patrol Route

So let's say you've got a guard that you want to "walk the beat." It used to be a bit tricky, but in one of the early updates, they made the process more user-friendly. Here's how you make it happen using waypoints.

  1. Create your creature and give it a unique tag.
  2. Place the creature on the map. where you want it to walk its route.
  3. Left-click the creature once to select it.
  4. Now right-click on the area of the map that you want the creature to walk to, and select Create Waypoint.
  5. A waypoint will appear there and a white line will be drawn to show you the route he will take to make his journey.
  6. You can click and drag the waypoint to a new location if necessary.
  7. Notice that in the left-hand asset-panel, a waypoint with the tag WP_<creaturetag>_01 has been created.
  8. Right-click on the map to set the next point of the route and select Create Waypoint.
  9. A second waypoint has been added and numbered _02.
  10. Continue this until your route is set up.
  11. Make sure that in the monster's onSpawn script that you have not removed the command WalkWayPoints( );

This setup makes the monster walk to waypoint #1, turn and face, pause, then walk to waypoint #2, turn and face, pause...and so on. Viola! An easy patrol route.

NOTE: (And a frustrating note it is). When the creature reaches the last waypoint, he does not path directly to waypoint #1. Instead he works his way along the route backwards. So he'll go 1 > 2 > 3 > 4 > 3 > 2 > 1 > 2 ..and so on.

Once you realize that the keys to the process is:

  1. The tags of the waypoints begin with WP_, contain the tag of the monster, and end with _##
  2. The monster needs to be told to WalkWayPoints( ) in his scripts somewhere

...you can then set up the waypoints, but spawn the monster in using code so that he's not taking up processor time in an empty zone.

You can also set up a patrol that crosses into other areas through door and transition triggers, but there's another couple of steps necessary to make that happen. The .pdf file explains how if you're interested.