Built-In Struct
These structs are declared in Object and can be used everywhere in UT2003's UnrealScript. Many of these have operators defined for them.
See Built-in Structs (UT) for the UT built-in structs.
GUID
A globally unique identifier.
struct Guid { var int A, B, C, D; };
Vector
A point or direction vector in 3d space.
struct Vector { var() config float X, Y, Z; };
See also vector, and Useful Maths Functions for some useful vector assignment operators.
You can specify constant vectors in code by using vect(x,y,z)
, where x, y and z must be float literals, i.e. actual numbers.
Plane (extends Vector)
A plane definition in 3D space. See Plane.
struct Plane extends Vector { // inherited: normal vector X, Y, Z var() config float W; // distance from origin };
This could also be used to describe a sphere: X, Y, Z is the location of the sphere's center and W is the radius.
Rotator
An orthogonal rotation in 3d space. See Rotator.
struct Rotator { var() config int Pitch, Yaw, Roll; };
You can specify constant rotators in code by using rot(pitch,yaw,roll)
, where pitch yaw and roll must be integer literals, i.e. actual numbers.
KingMango Is there a reason Pitch, Yaw and Roll are out of order from where I always see them other places? Pitch, Roll, Yaw, which conveniently correspond alphabetically to X,Y and Z.
Coords
An arbitrary coordinate system in 3d space.
struct Coords { var() config vector Origin, XAxis, YAxis, ZAxis; };
Quaternion
See Quaternion.
struct Quat { var() config float X, Y, Z, W; };
Range
Used to generate random values between Min and Max.
struct Range { var() config float Min; var() config float Max; };
It seems you can specify constant ranges in code by using rng(min,max)
, where min and max must be float literals, i.e. actual numbers, but this causes a "Bad expr token 35" compiler crash in UT2003 v2225 and probably also earlier versions. It might be a feature in later engine versions.
RangeVector
Vector of Ranges.
struct RangeVector { var() config range X; var() config range Y; var() config range Z; };
Scale
A scale and sheering.
struct Scale { var() config vector Scale; var() config float SheerRate; var() config enum ESheerAxis { SHEER_None, SHEER_XY, SHEER_XZ, SHEER_YX, SHEER_YZ, SHEER_ZX, SHEER_ZY, } SheerAxis; };
Color
An RGBA color.
struct Color { var() config byte R, G, B; // red, green, blue color components var() config byte A; // alpha component };
See also the page on custom Color Operators.
Note that many functions and class variables don't use this struct for colours, eg ZoneInfo's ViewFog.
Box
A bounding box. (Note the name change from UT: BoundingBox)
struct Box { var vector Min, Max; var byte IsValid; };
IntBox
struct IntBox { var int X1, Y1, X2, Y2; };
FloatBox
struct FloatBox { var float X1, Y1, X2, Y2; };
BoundingVolume (extends Box)
A bounding box sphere together.
struct BoundingVolume extends Box { var plane Sphere; };
Matrix
A 4x4 matrix.
struct Matrix { var() Plane XPlane; var() Plane YPlane; var() Plane ZPlane; var() Plane WPlane; };
InterpCurvePoint
A single interpolation point used in the InterpCurve struct. It maps an input value to a particular output value. See InterpCurve below for more details.
struct InterpCurvePoint { var() float InVal; var() float OutVal; };
InterpCurve
A struct which holds output values for a set of input values. The array which is formed is used to query for an interpolated output value for any input value. See Global Functions InterpCurveEval, InterpCurveGetOutputRange, and InterpCurveGetInputDomain for more details.
struct InterpCurve { var() array<InterpCurvePoint> Points; };
CompressedPosition
struct CompressedPosition { var vector Location; var rotator Rotation; var vector Velocity; };
Related Topics
- Variable Type – covers how to define structs
- Object class
- Operators