Repository navigation
Scripting World
Checks whether there's any active world in the game right now that the client may interact with in any way. This includes playing in singleplayer, hosting a server, playing on a server, observing on a server, playing back a recorded demo etc.
Return value: bool
Returns context-independent time of the current world simulation tick for gameplay logic purposes. If no world is currently running, returns
0.0.
Tip
If you need context-dependent time of the current tick, use Timer.CurrentTick() instead.
Return value: float
Returns context-independent time of the current world simulation frame (i.e. current time between simulation ticks) for rendering/frame-accurate purposes. If no world is currently running, returns
0.0.
Tip
If you need context-dependent time of the current frame, use Timer.GetLerpedCurrentTick() instead.
Return value: float
Returns context-independent factor between the current and the next ticks of the current world simulation for rendering/frame-accurate purposes. If no world is currently running, returns
0.0.
Tip
If you need context-dependent factor between ticks, use Timer.GetLerpFactor() instead.
Return value: float
Returns secondary context-independent factor between the current and the next ticks of the current world simulation for rendering/frame-accurate purposes. If no world is currently running, returns
0.0.
Tip
If you need context-dependent secondary factor between ticks, use Timer.GetLerpFactor2() instead.
Return value: float
Returns background color of the current world. Equivalent to the engine's
CWorld::GetBackgroundColor().
Throws a runtime error if no world is currently running.
Return value: integer
Returns current background viewer of the current world (may be none). Equivalent to the engine's
CWorld::GetBackgroundViewer().
Throws a runtime error if no world is currently running.
Return value: CEntityPointer
Returns current
WorldSettingsControllerentity of the current world, if supported (may be none).
Throws a runtime error if no world is currently running.
Return value: CEntityPointer
Returns path to the file of the current world. Equivalent to the engine's
CWorld::wo_fnmFileName. Throws a runtime error if no world is currently running.
Return value: string
Returns description of the current world. Equivalent to the engine's
CWorld::GetDescription(). Throws a runtime error if no world is currently running.
Return value: string
Returns display name of the current world. Equivalent to the engine's
CWorld::GetName(). Throws a runtime error if no world is currently running.
Return value: string
Returns spawn flags of the current world. Equivalent to the engine's
CWorld::GetSpawnFlags(). Throws a runtime error if no world is currently running.
Return value: integer
Throws a runtime error if no world is currently running.
Arguments:
-
predictors- Flag for whether to include predictor entities in the array.
Return value: Array of CEntityPointer with all the entities in the current world.
Retrieves an entity under the specified ID in the current world (may be none).
Throws a runtime error if no world is currently running.
Arguments:
-
id- ID of the entity in the world to retrieve a pointer to.
Return value: CEntityPointer
Throws a runtime error if no world is currently running.
Arguments:
-
class_name- Class name of entities to find, e.g."Enemy Base"for all classes derived fromCEnemyBaseor"ModelHolder2"forCModelHolder2classes.
Return value: Array of CEntityPointer with all the entities of a specific class in the current world.
Throws a runtime error if no world is currently running.
Arguments:
-
class_id- Class ID of entities to find, e.g.4for all classes derived fromCPlayerEntityor303forCHeadmanclasses.
Return value: Array of CEntityPointer with all the entities of a specific class in the current world.
Checks whether there are any entities of local players in the current world. Returns
trueonly if the client calling it is able to control any of the players on their screen. For demos and observers the return value is alwaysfalse.
Throws a runtime error if no world is currently running.
Return value: bool
Returns an array of player entities only if the client calling it is able to control any of them on their screen. For demos and observers the return value is always an empty array.
Throws a runtime error if no world is currently running.
Return value: Array of CEntityPointer with all the entities of local players in the current world.
Returns maximum amount of player entities that may exist in the world. Equivalent to the engine's
CEntity::GetMaxPlayers().
Throws a runtime error if no world is currently running.
Return value: integer
Returns player entity under the specified player index from
0toWorld.GetMaxPlayers() - 1(may be none). Equivalent to the engine'sCEntity::GetPlayerEntity().
Throws a runtime error if no world is currently running.
Arguments:
-
player- Index of the player entity to retrieve a pointer to.
Return value: CEntityPointer
Designed and developed by Dreamy Cecil since 2022