I search for solutions in this order: Past Code, Unreal Source, Wiki, BUF, groups.yahoo, google, screaming at monitor. – RegularX
UE2:Object static native functions (UT2004)
Object (static native functions) |
- Object static native functions in other games:
- RTNP, U1, UT, U2, U2XMP, UE2Runtime, UT2003, UT3, UDK
- Other member categories for this class:
- operators, structs
Math functions[edit]
Int functions[edit]
Clamp[edit]
Limits V to the interval of [A, B]. Exactly speaking, A will be returned if V is smaller than A, B will be returned if V is larger than B, otherwise V is returned.
This also applies if A is larger than B. So if V is larger than B, but smaller than A, the value of A is returned even though V is actually between the two values.
Max[edit]
Returns the larger of the two values. Note that when passing float parameters to this function, they are automatically typecasted to type int. If you don't want this, use the FMax() function instead.
Min[edit]
Returns the smaller of the two values. Note that when passing float parameters to this function, they are automatically typecasted to type int. If you don't want this, use the FMin() function instead.
Float functions[edit]
Abs[edit]
Returns the absolute value of A. That means, if A is greater than or equal to zero, it is returned unchanged. Otherwise, if A is less than zero, -A is returned.
Acos[edit]
Calculates the arccos of A.
Asin[edit]
Calculates the arcsin of A.
Atan[edit]
Calculates atan2 for the arguments A and B.
Ceil[edit]
Returns the smallest integer number greater than or equal to A.
Cos[edit]
Calculates the cosine of A.
Exp[edit]
Calculates e to the power of A, the exponential function.
FClamp[edit]
Limits V to the interval of [A, B]. Exactly speaking, A will be returned if V is smaller than A, B will be returned if V is larger than B, otherwise V is returned.
FMax[edit]
Returns the larger of the two values.
FMin[edit]
Returns the smaller of the two values.
Loge[edit]
Calculates the logarithm of A to the base of e, the natural logarithm.
Round[edit]
Rounds A to the nearest integer number. If the decimal part of A is .5
or larger, the smallest integer number greater than A is returned, otherwise the largest integer number less than or equal too A is returned.
Sin[edit]
Calculates the sine of A.
Sqrt[edit]
Calculates the square root of A.
Square[edit]
Calculates A * A, i.e. A squared.
Tan[edit]
Calculates the tangent of A.
Vector and rotator functions[edit]
GetAxes[edit]
Determines the axis unit vectors of a coordinate system that is created by rotating the world coordinate system as specified by the rotator value. Note that the X value is identical to the rotator value typecasted to vector.
If you think of the rotator value as a camera view rotation, then X points in view direction, Y points to the right and Z points upwards.
GetUnAxes[edit]
Determines the axis unit vectors of a coordinate system that can be transformed into the world coordinate system as specified by rotating it according to the rotator value.
The outputs of GetAxes() and GetUnAxes() relate to each other as if one was the result of the other's output run through the Invert() function.
Invert[edit]
Inverts the coordinate system defined by the three vectors.
If the three vectors are the unit vectors of a Cartesian coordinate system, like those returned by GetAxes(), then the Inverse() function can also be described in the following way: The X, Y and Z vectors are viewed as a 3x3 matrix. The result of Invert() then is the transpose of that matrix.
MirrorVectorByNormal[edit]
"Reflects" the input vector Vect off a surface with the normal vector Normal and returns the result. The vector Normal doesn't actually have to be a unit vector.
Normal[edit]
Returns a vector with the same direction as the input value, but a length of 1. The zero vector is just passed through by this function.
Normalize[edit]
Normalizes the components of a rotator to the range [-32768, 32767] so the rotator still represents the same orientation.
OrthoRotation[edit]
Returns a rotator value that represents the coordinate system specified by the three vector values. This is basically the inverse function of GetAxes(). Note that you can also typecast a single vector value to a rotator value with the Roll component being zero.
VSize[edit]
Returns the length of the vector.
Quaternion functions[edit]
- Main article: Quaternions
QuatFindBetween[edit]
Finds the quaternion that describes the smallest rotation that transforms vector A into vector B. The parameters should be unit vectors for this function to return meaningful results.
QuatFromAxisAndAngle[edit]
Creates a quaternion that describes a rotation of the specified angle around the given axis vector. The axis vector doesn't need to be normalized.
QuatFromRotator[edit]
Converts a rotator to a quaternion so they describe the same rotation.
QuatInvert[edit]
Inverts the vector part of the quaternion, i.e. calculates the conjugate of the quaternion. This basically means the result represents a rotation of the same angle, but in the opposite direction.
QuatProduct[edit]
Calculates the Hamilton product of the two quaternions.
Note: QuatProduct(Q1, Q2) == -QuatProduct(Q2, Q1)
QuatRotateVector[edit]
Applies the rotation described by quaternion A to vector B.
QuatToRotator[edit]
Converts the quaternion into a rotator so they describe the same rotation.
Interpolation functions[edit]
InterpCurveEval[edit]
Determines the interpolation result for the specified InterpCurve data.
InterpCurveGetInputDomain[edit]
Determines and returns the input domain of the specified InterpCurve data.
InterpCurveGetOutputRange[edit]
Determines and returns the output range of the specified InterpCurve data.
Lerp[edit]
Performs linear interpolation between A and B. If bClampRange is specified as True, the result will be limited to values greater than A and less than B, otherwise Alpha values less than 0 or greater than 1 can result in values outside that range.
Note: bClampRange works by applying FClamp to the result and thus only works for A < B
.
QuatSlerp[edit]
Performs spherical linear interpolation between the quaternions A and B.
Smerp[edit]
Performs smooth interpolation between A and B.
Random numbers[edit]
FRand[edit]
Returns a random float value between 0 and 1.
Rand[edit]
Returns a random int value in the range 0 to Max-1. Note that the maximum effective value for Max is 0x7FFF or 32767.
RotRand[edit]
Returns a rotator value with random Pitch and Yaw components in the range 0 to 65535. If the parameter bRoll is True, the result's Roll component is also set to a random value in that range. Otherwise, the Roll component is set to zero.
VRand[edit]
Returns a unit vector with a random direction.
String functions[edit]
Asc[edit]
Returns the ASCII value of the first character in the specified string, or 0 if the empty string was specified.
Caps[edit]
Converts all letters in S to uppercase and returns the result.
Chr[edit]
Returns a string consisting only of the character with the specified ASCII value. Specifying 0 will result in an empty string.
Divide[edit]
Looks up the first occurrence of Divider in Src and outputs whatever comes before the divider as LeftPart and anything after the divider as RightPart. Returns True on success and False if the divider string could not be found.
Eval[edit]
Returns the second parameter if the condition evaluated to True or the third parameter if the condition evaluated to False. Note that regardless of the evaluation result of the condition expression, both string parameters are evaluated!
InStr[edit]
Returns the position of the first occurrence of S in T or -1 if T does not contain S. This function is case-sensitive. The position of the first character is 0.
Left[edit]
Returns the i left-most characters of S. If S has less than or equal to i characters, the entire value is returned.
Len[edit]
Returns the number of characters in S, i.e. the length of the string.
Localize[edit]
Reads a localized string from the specified section of a localization file. The name of the localization file is given as PackageName, its extension is determined through the Language setting in the [Core.System] section of UT2004.ini.
Locs[edit]
Converts all letters in S to lowercase and returns the result.
Mid[edit]
Returns up to j characters from string S, starting with the ith character. If j is omitted or greater than the number of characters after position i, all remaining characters are returned.
Repl[edit]
Replaces all occurrences of Match in Src with With and returns the result. Any occurrences created as a result of a replacement are ignored. By default Match is matched case-insensitively, unless bCaseSensitive is specified as True.
Right[edit]
Returns the i right-most characters of S. If S has less than or equal to i characters, the entire value is returned.
Split[edit]
Splits up Src at every occurrence of Divider and puts the result into the Parts array. Note that the array is not cleared before splitting the string, parts are appended to the end of the array. Returns the final number of elements in the array.
StrCmp[edit]
Compares the strings S and T,m optionally restricted to the first Count characters. Returns a negative value if S comes alphabetically before T, a positive value if S comes alphabetically after T or 0 if both strings are equal with respect to the character limit and case-sensitivity. If bCaseSensitive is omitted or False, the strings are compared case-insensitively.
Other static native functions[edit]
ClassIsChildOf[edit]
Returns whether TestClass is equal to or a subclass of ParentClass. Returns False if either parameter is None.
DynamicLoadObject[edit]
Attempts to load an object of the specified class and with the specified name and returns it on success or retruns None on failure. If MayFail is omitted or False, a warning is logged on failure.
FindObject[edit]
Attempts to find an existing object of the specified name and class and returns it on success. Returns None if no object with that name was found or the found object has an incompatible class.
GetEnum[edit]
Returns the name of the ith constant in the enum E. Enums should be specified as an object literal for the first parameter. The second parameter can be any numeric or enum value. The result of this function is a name value.
This function is useful to create better log output for enum variables, because a direct typecast of the enum value to string would only result in the string representation of the enum value's index.
GetPerObjectNames[edit]
Returns the names of PerObjectConfig sections for the given class in the specified INI file. You can use "System"
for the INIFile to use the main INI file specified on the startup commandline. If MaxResults is omitted, it defaults to 1024.
Log[edit]
Writes a line to the main log file. The Tag defaults to 'ScriptLog'
if omitted.
ResetConfig[edit]
If this class was declared to store its configuration in the System or User config file and the Default.ini or DefUser.ini respectively contain a section for this class, that section is used as new default. Otherwise this function behaves like StaticClearConfig(). If a property name is specified, only that property is reset to its default config value.
StaticClearConfig[edit]
Deletes the config file section of this class and reloads the default values of all configurable properties. If a property name was specified, only that property's value is deleted from the config file section.
StaticSaveConfig[edit]
Writes the default values of all configurable properties of this class into the corresponding config file section. Values of properties defined as globalconfig are written to the config section of the class that originally declared that property.
StopWatch[edit]
Starts or stops an internal script debug timer. There is only one such timer globally for everything that happens in UnrealScript. If you need multiple concurrently running stopwatch timers, you will have to get hold of an Actor reference and use its Clock() and Clock() methods.
StopWatch() calls should always be used in pairs in your code:
StopWatch(false); // code you want to time StopWatch(true);
Any Log() calls between the two StopWatch() calls will log a time index. The StopWatch(True) call additionally logs the entire time that passed since the StopWatch(false) call.
Warn[edit]
Writes a warning to the main log file. The warning text will have the tag "ScriptWarning" and include the object instance and function and/or state name of the Warn() call.