LavishScript:Data Sequences

From Lavish Software Wiki
Revision as of 01:56, 11 May 2005 by Lax (talk | contribs)
Jump to navigation Jump to search

Overview

There are two basic operations for any kind of data: read and write. In LavishScript, reading is always done via data sequences, which are then converted to a string for output or use in a Command. For example, "${Time}" will get converted to something like "12:45:00". Writing to data can be done with special Commands or with data sequences.

Objects

In LavishScript, anything that stores data is considered an "object". Most objects are also associated with other objects. For example, your arm is associated with your body, your hand, your shoulder, and so on. Your arm also has certain properties -- the color of your skin, the size of your muscles, etc. Each of these data are considered objects in LavishScript. Some objects are only relevant when a "parent" object is given -- in other words, if I were to ask how big an arm is, you might say "whos arm?", because there's all kinds of arms and that's just too generic. In LavishScript, you would literally ask something more along the lines of "Me, get me Right Arm. Right Arm, get me Length", and each of those is specific enough to refer to a single object. Here is what it might look like as a LavishScript data sequence: ${Me.RightArm.Length}.

Viewing Objects

Objects have a clearly defined list of properties, and this list will be exactly the same for all objects of a certain type. For example, colors can be described by hue, saturation and brightness. A combination of these three values can describe any given color, but the values for different colors are not necessarily the same. Because of this, we can "view" each color the same way. Likewise, objects in games can be viewed the same way as other objects. A player is a player and a piece of equipment is a piece of equipment, but not every two players or pieces of equipment will have the same values. This makes it very easy to work with objects, because we can work with types of objects in a uniform way, rather than each individual object having its own list of properties. The type of object, combined with a list of properties and a list of potential ways to manipulate this type of object, forms what we call a "Data Type".

Additionally, each type of object has a specific way of "answering your question", so to speak. The question "What is the length of my right arm?" will be some number. This number may have some unit of measurement (e.g. inches or centimeters), but it will always be the same unit of measurement for the length of an arm. Sometimes the object doesn't define an answer. The question "What is my right arm?" might be met with a dumbfounded look, or a sarcastic answer. Or in LavishScript's case, it may be NULL, meaning it simply does not have an answer for you. The name for this is called the "return value", or "To String". This can be misleading, though, because there is also a type of object called "string" -- it's not giving you an object, this is simply the name for what happens when you move away from the data sequence, and into the real world.

Members

Methods

Available Objects

Top-Level Objects

Variables

See Also