Legacy:Built-In Struct

From Unreal Wiki, The Unreal Engine Documentation Site
Jump to navigation Jump to search

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.


A globally unique identifier.

<uscript> struct Guid { var int A, B, C, D; }; </uscript>


A point or direction vector in 3d space.

<uscript> struct Vector { var() config float X, Y, Z; }; </uscript>

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.

<uscript> struct Plane extends Vector { // inherited: normal vector X, Y, Z var() config float W; // distance from origin }; </uscript>

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.


An orthogonal rotation in 3d space. See Rotator.

<uscript> struct Rotator { var() config int Pitch, Yaw, Roll; }; </uscript>

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.


An arbitrary coordinate system in 3d space.

<uscript> struct Coords { var() config vector Origin, XAxis, YAxis, ZAxis; }; </uscript>


See Quaternion.

<uscript> struct Quat { var() config float X, Y, Z, W; }; </uscript>


Used to generate random values between Min and Max.

<uscript> struct Range { var() config float Min; var() config float Max; }; </uscript>

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.


Vector of Ranges.

<uscript> struct RangeVector { var() config range X; var() config range Y; var() config range Z; }; </uscript>


A scale and sheering.

<uscript> 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; }; </uscript>


An RGBA color.

<uscript> struct Color { var() config byte R, G, B; // red, green, blue color components var() config byte A; // alpha component }; </uscript>

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.


A bounding box. (Note the name change from UT: BoundingBox)

<uscript> struct Box { var vector Min, Max; var byte IsValid; }; </uscript>


<uscript> struct IntBox {

   var int X1, Y1, X2, Y2;

}; </uscript>


<uscript> struct FloatBox {

   var float X1, Y1, X2, Y2;

}; </uscript>

BoundingVolume (extends Box)

A bounding box sphere together.

<uscript> struct BoundingVolume extends Box { var plane Sphere; }; </uscript>


A 4x4 matrix.

<uscript> struct Matrix { var() Plane XPlane; var() Plane YPlane; var() Plane ZPlane; var() Plane WPlane; }; </uscript>


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.

<uscript> struct InterpCurvePoint { var() float InVal; var() float OutVal; }; </uscript>


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.

<uscript> struct InterpCurve { var() array<InterpCurvePoint> Points; }; </uscript>


<uscript> struct CompressedPosition { var vector Location; var rotator Rotation; var vector Velocity; }; </uscript>

Related Topics