Thursday, September 15, 2011

Making It Work

The things that make the module “work” are the scripts; and scripting is probably the hardest (and least understood) of all the activities that go into creating a module.  There are some very, very good tutorials out there and Lilac Soul has created an amazing “Scripting Tool” that will actually allow a builder to create a working script by simply selecting options from a menu and filling in a few simple blanks – it is really that simple.  You won’t be able to create complex scripts with it, but you will be able to create just about anything you NEED to make your module work.

I don’t use that tool, as I am one who likes to get under the hood and get my hands dirty – I like to understand what everything is doing and how it all works; but that is just me.

I’ve already discussed some of the scripts that have been created for Adventure; but there are few others that I would like to mention.  One of the neat things about scripts is that in addition to the hundreds of functions that Bioware has provided as part of the Aurora Toolset, you can create your own functions and use them in other scripts.  This is done by using “includes”, which simply is a one line method of attaching one script to another.  By placing any functions that are used by several different scripts into one script (called “cc_inc_routines” for example); I can “include” that script with any others that make use of those functions.

I currently have two functions in cc_inc_routines.  The first is ccTeleportToObject, which is used to jump the Player from one location to another.  This function gets used a lot and including it as an “include” makes things a lot easier.

The other function is ccCheckChat.  This routine is used for the few places where the Player can “say” something and have something happen.  Presently it is only used for the ‘magic’ word “XYZZY”; which teleports the Player between two areas.  The original game had another word as well: “PLUGH”; however, I decided to do that one a bit differently as you may see later.

Then there is a whole slew of “housekeeping” chores such as the stripping the Player of everything including experience when they enter.  I also need to keep track of how many turns a Player has used (a “turn” being a movement from one area to another); and how many turns the Player has used his lantern (it won’t burn forever).  These are all handled by the area OnEnter script.

I think that is enough for now ….

No comments:

Post a Comment