xray16/lib
Enumerations
| Enumeration | Description |
|---|---|
| EConfigClassId | Enumeration of class identifiers used in LTX configurations linking. |
| EGameDifficulty | Enum with number representation of game difficulties. |
| EGameObjectClass | C++ declared class identifiers from client side. Matches class names in C++ counterpart. |
| EGameType | Possible game types supported by engine. |
| EScriptClassId | Script class IDs for linking of serve-client side implementation. Later can be got from game object. |
Functions
| Function | Description |
|---|---|
| abort | Print the current stack and raise a formatted Lua error. |
| addVectors | Add two vectors. |
| angleDiff | Calculate the absolute angle difference between two vectors. |
| angleToDirection | Convert an angle vector to a normalized direction vector. |
| areSame2dVectors | Check whether two 2D vectors have exactly equal coordinates. |
| areSameVectors | Check whether two 3D vectors have exactly equal coordinates. |
| areSameVectorsByPrecision | Check whether two 3D vectors are equal within a tolerance. |
| assert | Assertion function to ensure provided condition is truthy. Raises a formatted error when the condition is falsy. |
| assertDefined | Assertion function to ensure provided value is not nil. |
| assertNonEmptyString | Assertion function to ensure provided value is a non-empty string. |
| between | Get math random between provided boundaries. Works with floating point numbers in contrast to default math.random lua library. |
| callstack | Print callstack for debugging purposes. |
| chance | Get math random based chance to happen by base of provided parameter. By default, calculates 'rate' of 100. |
| clamp | Clamp a number to inclusive bounds. |
| containsSubstring | Check whether a string contains a case-insensitive Lua pattern. |
| copyVector | Copy a vector. |
| create2dVector | Create a 2D vector. |
| createArtefactClassIds | - |
| createClassIds | Create and synchronize list of class identifiers in game engine. Used to synchronize dynamic identifiers lists for further checks against game objects. |
| createEmpty2dVector | Create a 2D vector with all coordinates set to zero. |
| createEmptyVector | Create a 3D vector with all coordinates set to zero. |
| createMonsterClassIds | - |
| createStalkerClassIds | - |
| createTime | Create and initialize an X-Ray CTime value. |
| createVector | Create a 3D vector. |
| createWeaponClassIds | - |
| decamelize | Convert camelCase or PascalCase text to separated lowercase text. |
| degreeToRadian | Convert degrees to radians. |
| deserializeTime | - |
| distanceBetween2d | Calculate distance between two vectors on the XZ plane. |
| executeConsoleCommand | Execute console command and concatenate provided parameters for propagation. |
| extern | Declare a global variable and extern it for game engine usage. Declared values can be found in _G / global Lua scope. |
| gameTimeToString | - |
| getConsoleFloatCommand | Execute command to get floating point number value. |
| getDistanceBetween | Get distance for objects based on game vectors. |
| getDistanceBetweenSqr | Get squared distance for objects based on game vectors. |
| getExtern | Get a Lua global / externed value. |
| getObjectPositioning | - |
| getPatrolFlag | - |
| globalTimeToString | - |
| graphDistance | Get graph distance between two vertices. |
| graphDistanceSqr | Get squared graph distance between two vertices. |
| hoursToWeatherPeriod | Transform hour to weather period section label. |
| isDistanceBetweenObjectsGreaterOrEqual | Check distance between objects. |
| isDistanceBetweenObjectsLessOrEqual | Check distance between objects. |
| isGameVertexFromLevel | Check whether a game vertex belongs to a level. |
| isInTimeInterval | Check whether current time interval is between desired values. |
| isObjectAtTerminalWaypoint | Check if object standing on terminal patrol waypoint. Verifies that object is on one of terminal waypoints. |
| isObjectAtWaypoint | - |
| isObjectInZone | Check whether object is inside another zone object. |
| isValidAccessibleVertex | Check whether an object can access a game vertex. |
| isWideScreen | Check whether the game is in wide-screen mode right now. |
| pickRandom | Pick one of parameters. |
| radianToDegree | Convert radians to degrees. |
| range | Create a numeric range. |
| readTimeFromPacket | Read time object from net packet. |
| round | Round a number to the nearest integer. |
| roundWithPrecision | Round a number to a decimal precision. |
| serializeTime | - |
| setCurrentTime | Set current time in level. Creates idle state with multiplied time factor. |
| setObjectLookAtAnotherObject | Point one object's sight direction at another object's current position. |
| subVectors | Subtract one vector from another. |
| toLogValue | - |
| toTimeDigit | Add part of time digit to a data string. |
| updateClassIds | Synchronize and update current class identifiers list. |
| vectorCross | Calculate the cross product of two vectors. |
| vectorRotateY | Rotate a vector around the Y axis. |
| vectorToString | Convert a vector to the engine debug string format. |
| wait | Lock script execution based on real time. |
| waitGame | Lock script execution based on game time. |
| writeTimeToPacket | Save time object into net packet. |
| yaw | Calculate the yaw angle between two vectors on the XZ plane. |
| yawDegree | Calculate the yaw angle between two vectors on the XZ plane. |
| yawDegree3d | Calculate the angle between two vectors in 3D space. |
Interfaces
| Interface | Description |
|---|---|
| IClassIdsGrouped | Definition of grouped class IDs used in the xray engine for object checks / comparison. |
| IConstructor | Constructor signature for a value of type T. |
Type Aliases
| Type Alias | Description |
|---|---|
| AnyArgs | Any list of arguments. |
| AnyCallable | Any callable without a this context. |
| AnyCallablesModule | Module of callables keyed by name. |
| AnyContextualCallable | Any callable with a bound this context. |
| AnyObject | Any object from JS record variant. |
| LuaArray | Lua array table indexed by number. |
| Nillable | Possible nil value in lua, both null and undefined in TS. |
| Nullable | Possible null value. |
| PartialRecord | Record partial to support enum implementations with subsets of available keys. |
| StringNillable | Type-casted option that extends type with "nil" values. |
| TCoordinate | Coordinate value. |
| TCount | Count of items. |
| TDirection | Direction value. |
| TDistance | Distance value. |
| TDuration | Duration in milliseconds. |
| TGameClassId | Type definition of possible game class ID string. |
| TGameDifficulties | Definition of all difficulties' config. |
| TGameDifficulty | Possible game difficulty type definition. |
| TIndex | Collection index. |
| TLabel | Human-readable label / caption. |
| TName | Named entity, section or key. |
| TNotCastedBoolean | Engine-style boolean expressed as 0 / 1. |
| TNumberId | Numeric identifier. |
| TPath | Filesystem or resource path. |
| TProbability | Probability value. |
| TRate | Rate / ratio value. |
| TSection | Configuration section name. |
| TSize | Size value. |
| TStringId | String-based identifier. |
| TStringifiedBoolean | Boolean serialized to a string. |
| TStringifiedNil | nil serialized to a string. |
| TTimestamp | Unix-like timestamp. |
Variables
| Variable | Description |
|---|---|
| ACTOR | Constant string for actor. |
| ACTOR_ID | Constant representing actor ID. |
| DEFAULT | Constant string for configuration default. |
| DEFAULT_SQUAD | Constant string for squad configuration default. |
| EMPTY_LUA_ARRAY | - |
| EMPTY_LUA_TABLE | - |
| FALSE | Lua false string representation. |
| gameClassId | List of possible game type class IDs. |
| gameDifficulties | List of possible game difficulties. |
| gameDifficultiesByNumber | Mapping game difficulties with number-string pairs. |
| gameTypes | List of available game modes based on bit masks. |
| MAX_ALIFE_ID | Maximal alife object ID. Hardcoded to u16 max. |
| MAX_ALIFE_RANK | Maximal alife object rank. Hardcoded to u16 max. |
| MAX_I16 | Maximum signed 16-bit integer. |
| MAX_I32 | Maximum signed 32-bit integer. |
| MAX_I8 | Maximum signed 8-bit integer. |
| MAX_LEVEL_VERTEX_ID | Maximal level vertex ID. Hardcoded to u16 max. |
| MAX_U16 | Maximum unsigned 16-bit integer. |
| MAX_U32 | Maximum unsigned 32-bit integer. |
| MAX_U8 | Maximum unsigned 8-bit integer. |
| MIN_I32 | Minimum signed 32-bit integer. |
| MIN_I8 | Minimum signed 8-bit integer. |
| MX_VECTOR | - |
| MY_VECTOR | - |
| MZ_VECTOR | - |
| NEVER | Null stringified by lua. |
| NIL | Lua nil string representation. |
| OFF | Constant string for options / configurations. |
| ON | Constant string for options / configurations. |
| ONE_VECTOR | - |
| PI_DEGREE | Radians in one degree (PI / 180). |
| RADIAN | Degrees in one radian (180 / PI). |
| TRUE | Lua true string representation. |
| X_VECTOR | - |
| Y_VECTOR | - |
| Z_VECTOR | - |
| ZERO_VECTOR | Shared immutable direction/axis vectors. |