You are here: Foswiki>WorldFoundry Web>OAD (08 Oct 2002, MrLin;)Edit Attach

Object Attribute Data (OAD) Documentation

The OAD system is designed to allow objects in the 3D editor to have programmer defined, user edited data associated with them. For example, an object can have an integer which indicates how many life points it starts with which is editable in the 3D level editor, and accessible from code within your game. This is accomplished by defining a data structure which is shared between the attribute editor and the game. From the game's point of view, the system allows the programmer to very quickly define C data structures in their game, and connect them up to a user interface in the level editor.

This data structure defines an array of what we call attributes (thinking of changing to properties) which can be edited on a particular object. Each attribute contains what type of data it is (int, fixed point, string, filename, color, etc.) as well as range limits, its name, help describing it's use, etc. Object Attributes are described in .oas files, which are edited by the programmer. The .oas file is processed into several different output files: the .oad, .iff, .def and the .ht files. The .oad file is a binary file containing an array of identical structures (defined in oad.h), which describes to attrib what the user interface looks like and what the final binary structure output is. This format is obsolete and only used by the 3D studio Max attribute editor (because I am too lazy to update it to use the new .iff format). The .iff file contains the same information as the .oad file, but instead of an array of fixed size structures it uses IFF chunks so is much easier to extend. The .iff files are used by attribedit, the command line attribute editor tool (which is also called from inside of Innonvation 3D). The .ht file contains a C structure definition which is included into the game, and used to access the attribute data attached to the object in the level file (created by attrib or attribedit). Each .oas file describes an object type. There can be multiple object types, each using its own .oas file. One .oas file can include other .oas files, allowing reuse of .oas definitions in a manner similar to the object-oriented concept of composition or inheritance. In the 3D level editor interface, the type of each object is selected using the object class selector in attrib/attribedit.

The .oas files are located in wfsource/source/oas. The master list of all .oas files which are made available to the game and to the attribute editor is in objects.mac.

Types:

OAD Name
IFF Name
Description
INT32
'I32'
32 bit Integer
FIXED32
'FX32'
1.15.16 fixed point number
STRING
'STR'
Fixed length string
BOOLEAN
'I32'
Boolean
COLOR
'I32'
32 bit color, 8 bits each(alpha, red, green, blue)
FILENAME
'FILE'
Same as string, with file requester
OBJECT REFERENCE
'STR'
Object index
CLASS REFERENCE
'STR'
Class index
(none)
'VEC3'
3D Vector (should we use a struct of FX32's instead?)
(none)
'QUAT'
Quaternion (should we use a struct of FX32's instead?)
(none)
'BOX3'
Used by collision box (should definitely use a struct of VEC3's for this)
PROPERTY_SHEET_HEADER
'STRU'
(none)

KevinSeghetti -- this is a work in progress, not finished yet


Type Entry macros, after each macro name is a table with each parameter name and a description (if a paramter name is followed by = then that indicates a default if no parameter given).

TYPEHEADER

Begins the class definition
1.
Display name
Name to display
2.
Class name=Display name
Internal name used to refer to this type

TYPEFOOTER

Closes the class definition (none)

PROPERTY_SHEET_HEADER

Begins a new property sheet definition (tabs in attribedit)
1.
Name of sheet
Name which is displayed on tab in attribedit)
2.
active=0
In the 3D studio Max version this flag indicates if the rollup starts opened or closed
3.
enableExpression="1"
Expression used to enable this tab (KevinSeghetti I don't think I support this in attribedit)
4.
size=0
Not used by attribedit, not sure in the Max version uses this
Closes a property sheet (none)

TYPEENTRYINT32

A 32 bit integer
1.
name
Internal name of this attribute
2.
displayName=name
Name which is displayed in the attribute editor
3.
min
Minimum value this integer is allowed to be set to
4.
max
Maximum value this integer is allowed to be set to
5.
def=min
default value, this is the value this integer will have if not overridden.
6.
buttons=""
String enumerating values, used for drop down comboboxes, there needs to be max-min entries, separated by vbar
7.
showas=SHOW_AS_NUMBER
How to display this integer in the attribute editor
8.
help=""
Help string for this attriubte, will pop up in a tool tip if mouse is hovered over
9.
szEnableExpression="1"
Expression which is evaulated by the attribute editor to deternmine if the user is currently allowed to chane this attribute (for example, if movemnt type is static, then user can't change most physics parameters)

10.
y=-1
y screen coordindate of this attribute (KevinSeghetti -- legacy, I don't think any of the current attribute editors use this)
11.
x=-1
x screen coordindate of this attribute (KevinSeghetti -- legacy, I don't think any of the current attribute editors use this)


TYPEENTRYFIXED32

A 32 bit fixed point # (1.15.16)
1.
name
Internal name of this attribute
2.
displayName=name
Name which is displayed in the attribute editor
3.
min
Minimum value this number is allowed to be set to
4.
max
Maximum value this number is allowed to be set to
5.
def=min
default value, this is the value this number will have if not overridden.
6.
showas=SHOW_AS_NUMBER
How to display this number in the attribute editor
7.
help=""
Help string for this attriubte, will pop up in a tool tip if mouse is hovered over
8.
szEnableExpression="1"
Expression which is evaulated by the attribute editor to deternmine if the user is currently allowed to chane this attribute (for example, if movemnt type is static, then user can't change most physics parameters)

9.
y=-1
y screen coordindate of this attribute (KevinSeghetti -- legacy, I don't think any of the current attribute editors use this)
10.
x=-1
x screen coordindate of this attribute (KevinSeghetti -- legacy, I don't think any of the current attribute editors use this)


TYPEENTRYVECTOR

Currently Unused.

TYPEENTRYSTRING

A variable lenght text string. Used for things like filenames and object names
1.
name
Internal name of this attribute
2.
displayName=name
Name which is displayed in the attribute editor
3.
help=""
Help string for this attriubte, will pop up in a tool tip if mouse is hovered over
4.
szEnableExpression="1"
Expression which is evaulated by the attribute editor to deternmine if the user is currently allowed to chane this attribute (for example, if movemnt type is static, then user can't change most physics parameters)

5.
y=-1
y screen coordindate of this attribute (KevinSeghetti -- legacy, I don't think any of the current attribute editors use this)
6.
x=-1
x screen coordindate of this attribute (KevinSeghetti -- legacy, I don't think any of the current attribute editors use this)
7.
showas=SHOW_AS_N_A
How this string is displayed


TYPEENTRYSTRING_ENUM

Currently Unused

TYPEENTRYSTRING_IGNORE

Only used by TYPEENTRY_XDATA_NOTES


TYPEENTRYBOOLEAN

A variable lenght text string. Used for things like filenames and object names
1.
name
Internal name of this attribute
2.
displayName=name
Name which is displayed in the attribute editor
3.
def
Default boolean value
4.
showas=SHOW_AS_CHECKBOX
How to display this attribute in the attribute editor. Options are
              1. CHECKBOX
              2. ???
5.
help=""
Help string for this attriubte, will pop up in a tool tip if mouse is hovered over
6.
szEnableExpression="1"
Expression which is evaulated by the attribute editor to deternmine if the user is currently allowed to chane this attribute (for example, if movemnt type is static, then user can't change most physics parameters)
7.
y=-1
y screen coordindate of this attribute (KevinSeghetti -- legacy, I don't think any of the current attribute editors use this)
8.
x=-1
x screen coordindate of this attribute (KevinSeghetti -- legacy, I don't think any of the current attribute editors use this)


TYPEENTRYBOOLEANTOGGLE

Same as boolean but uses 2 radio buttons for values
1.
name
Internal name of this attribute
2.
displayName=name
Name which is displayed in the attribute editor
3.
def
Default boolean value
4.
showas=SHOW_AS_RADIOBUTTONS
How to display this attribute in the attribute editor. Options are
              1. CHECKBOX
              2. ???
5.
buttons="FALSE TRUE"
names to put on radiobuttons
6.
help=""
Help string for this attriubte, will pop up in a tool tip if mouse is hovered over
7.
szEnableExpression="1"
Expression which is evaulated by the attribute editor to deternmine if the user is currently allowed to chane this attribute (for example, if movemnt type is static, then user can't change most physics parameters)
8.
y=-1
y screen coordindate of this attribute (KevinSeghetti -- legacy, I don't think any of the current attribute editors use this)
9.
x=-1
x screen coordindate of this attribute (KevinSeghetti -- legacy, I don't think any of the current attribute editors use this)


TYPEENTRYOBJREFERENCE

Object reference, used to refer to one object from another (like the camshot follow field)
1.
name
Internal name of this attribute
2.
displayName=name
Name which is displayed in the attribute editor
3.
help=""
Help string for this attriubte, will pop up in a tool tip if mouse is hovered over
4.
szEnableExpression="1"
Expression which is evaulated by the attribute editor to deternmine if the user is currently allowed to chane this attribute (for example, if movemnt type is static, then user can't change most physics parameters)
5.
y=-1
y screen coordindate of this attribute (KevinSeghetti -- legacy, I don't think any of the current attribute editors use this)
6.
x=-1
x screen coordindate of this attribute (KevinSeghetti -- legacy, I don't think any of the current attribute editors use this)
7.
def=""
default object name


TYPEENTRYFILENAME

File name, uses a file requestor

1.
name
Internal name of this attribute
2.
displayName=name
Name which is displayed in the attribute editor
3.
filespec="*.*"
Default file filter
4.
help=""
Help string for this attriubte, will pop up in a tool tip if mouse is hovered over
5.
szEnableExpression="1"
Expression which is evaulated by the attribute editor to deternmine if the user is currently allowed to chane this attribute (for example, if movemnt type is static, then user can't change most physics parameters)
6.
y=-1
y screen coordindate of this attribute (KevinSeghetti -- legacy, I don't think any of the current attribute editors use this)
7.
x=-1
x screen coordindate of this attribute (KevinSeghetti -- legacy, I don't think any of the current attribute editors use this)


TYPEENTRYXDATA_CONVERT

Used for things like external scripts, probably needs a better name

1.
name
Internal name of this attribute
2.
displayName=name
Name which is displayed in the attribute editor
3.
chunkname
Name of XData chunk to convert

4.
required
boolean indicating if this field is required to be filled out
5.
help=""
Help string for this attriubte, will pop up in a tool tip if mouse is hovered over
6.
szEnableExpression="1"
Expression which is evaulated by the attribute editor to deternmine if the user is currently allowed to chane this attribute (for example, if movemnt type is static, then user can't change most physics parameters)
7.
y=-1
y screen coordindate of this attribute (KevinSeghetti -- legacy, I don't think any of the current attribute editors use this)
8.
x=-1
x screen coordindate of this attribute (KevinSeghetti -- legacy, I don't think any of the current attribute editors use this)


TYPEENTRYCOLOR

Color picker
1.
name
Internal name of this attribute
2.
displayName=name
Name which is displayed in the attribute editor
3.
def
Default color
4.
help=""
Help string for this attriubte, will pop up in a tool tip if mouse is hovered over
5.
szEnableExpression="1"
Expression which is evaulated by the attribute editor to deternmine if the user is currently allowed to chane this attribute (for example, if movemnt type is static, then user can't change most physics parameters)
6.
y=-1
y screen coordindate of this attribute (KevinSeghetti -- legacy, I don't think any of the current attribute editors use this)
7.
x=-1
x screen coordindate of this attribute (KevinSeghetti -- legacy, I don't think any of the current attribute editors use this)


TYPEENTRYCAMERA

Special flag indicating camera data should be copied into here from 3D editor

TYPEENTRYWAVEFORM

Currently Unused

TYPEENTRYCLASSREFERENCE

Used to refer to class types, for example actbox activated by class.
1.
name
Internal name of this attribute
2.
displayName=name
Name which is displayed in the attribute editor
3.
help=""
Help string for this attriubte, will pop up in a tool tip if mouse is hovered over
4.
szEnableExpression="1"
Expression which is evaulated by the attribute editor to deternmine if the user is currently allowed to chane this attribute (for example, if movemnt type is static, then user can't change most physics parameters)
5.
y=-1
y screen coordindate of this attribute (KevinSeghetti -- legacy, I don't think any of the current attribute editors use this)
6.
x=-1
x screen coordindate of this attribute (KevinSeghetti -- legacy, I don't think any of the current attribute editors use this)


GROUP_START

Indicates the start of a group of attributes, this shows up as a box around the attributes in attribedit

1.
name
Internal name of this attribute
2.
width=0
Unused
3.
szEnableExpression="1"
Expression which is evaulated by the attribute editor to deternmine if the user is currently allowed to chane this group of attributes (for example, if movemnt type is static, then user can't change most physics parameters)
4.
y=-1
y screen coordindate of this attribute (KevinSeghetti -- legacy, I don't think any of the current attribute editors use this)
5.
x=-1
x screen coordindate of this attribute (KevinSeghetti -- legacy, I don't think any of the current attribute editors use this)


GROUP_STOP

Flags the end of a group

The OAD system file format: See "File Formats.doc"

Note: the binary .oad file has been replaced by an .iff file. The binary .oad file is currently only used by the 3D Studio Max tools (because I am too lazy to go back and update them to use the IFF format). Click on OADIFFFormat for the IFF format documentation
Topic revision: r1 - 08 Oct 2002, MrLin;
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding Foswiki? Send feedback