|
|
|
Text Adventure Engine_
Technical specifications
Text Adventure Engine was developed in Java 1.5 using the Eclipse IDE. Development began in September 2005 with the creation of something unrecognizable in the current version. Development has been going on slowly ever since. A couple of current specifications for the Engine are:_
- Scripting Ability. Create Java Classes and call them from within the game
- Keeps a variable array of 255 strings for general-purpose usage (vars[])
- Many built-in functions for general use (evolving list. If you have suggestions, e-mail me):
- Checks for truth (sets vars[0] to returned value)
- Format:
Function Name; First Paramater; Second Parameter
hasItem; Name of Item; N/A
Searches for an item in the inventory. Returns true if found
globalItem; Name of Item; N/A
Searches for an item in the global items. Returns true if found
stateOfItem; Name of Item; State of Item
Attempts to find the item in the immediate area or any portal or location by the same name and return true if the state of the item is equal to the state input
portalIsBlocked; Name of Portal; N/A
Attempts to find given portal, returns true if blocked
locationIsHidden; Name of Location; N/A
Attempts to find given location, returns true if hidden
inArea; Name of Area; N/A
Returns true if the given area is the name of the current area
equal; First Value; Second Value
Returns true if First value is same as second value
or; First Value; Second Value
Returns logical OR of first Value and Second Value. "true" is boolean value true, anything else is false
and; First Value; Second Value
Returns logical AND of first Value and Second Value.
not; Boolean Value; N/A
Returns logical negation of Boolean Value.
setVar; X; VAL
Sets value of vars(X) to VAL. Returns true on success, false on failure. X must be between 0 and 255 inclusive.
true; N/A; N/A
false; N/A; N/A
- Action functions (Changes state of the game)
- Format:
Function Name; First Paramater; Second Parameter
giveItem; Name of item to give; N/A
puts item in inventory; checks current area, global items, and all items within all other items in current area recursively, if those sublocations within items are not hidden; removes from that place
copyItem; Name of item to give; name of copy
puts item in inventory; checks current area, global items, and all items within all other items in current area recursively, if those sublocations within items are not hidden; does not remove from that place
putItemInArea; Item to move; Location to relocate to
Moves an item to a different area. can use "Inventory" and "Global" as well as any location name
removeItem; Item to remove;
looks for item in Inventory, Global items and recursively through current area in non-hidden subLocations
setItemState; Item to set; new State for item XXXX
Case sensitive; Item includes portals and locations. Sets the current state of an item (i.e. set a torch to "burnong"). Searches for item recursively in current area, inventory, and global items; searches for ALL portals and locations.
getItemState; Item to get state of; x
sets vars[x] equal to item state
setVar; Variable integer to set (range 0 - 255); N\A
New value to set variable X to (X is an integer from 0 - 255)
setDestination; Portal to change; New destination
Changes the destination of the given portal
setLocation; Name of new location to be in; N\A
Changes the current location of the player
setPrompt; New prompt to be displayed for input; N\A
By Default, equals "\n]"
go; name of Portal in current location to go through; N\A
Moves through a portal to a new location
setBlocked; name of Portal to block or unblock; "true" or "false"
Blocks or unblocks the given portal. Searches for ALL portals
setHidden; name of subLocation to hide or unhide; "true" or "false"
Hides or shows a subLocation.
Searches for ALL subLocations
showVersionDescription; name of Location to show; version of description to show
viewLocation; name of Location to show (can use "Inventory"); N\A
showMessage; the Message to show; More of the message (optional)
- Simple mathematical expressions recognized for use on vars[] array to keep track of things like score.
- Uses regular expressions for recognition of input strings. For example:
- "l(ook (at (the )?)?)?
bush"
will recognize
- "l bush"
- "look bush"
- "look at bush"
- "look at the bush"
- Evaluation system for deciding what to do during the course of the game once an input string is recognized. For example (this will hopefully become much easier later):
"stateOfItem(bush):burning","setVar:1:vars(0)","hasItem:torch1","and:vars(0):vars(1)";"showmessage:You see that the bush is lit on fire by your torch. How biblical, or something.";
I may expand on this list later. Like, as I do some of the things on my Todo list._
|