WorldService

The service to the game world and the game environment

Summary
WorldServiceThe service to the game world and the game environment
Functions
NKGetMilitaryTimeReturns the current time in military time.
NKSetMilitaryTimeSets the current in game time to the given value.
NKSetTimeScaleSets how quickly time progresses, as a multiplier.
NKGetTimeScaleReturns the current time progression scalar.
NKSetViewDistanceSets the user’s view distance.
NKGetViewDistanceReturns the user’s current view distance setting.
NKSetMaxViewDistanceOnly usable by the server.
NKGetMaxViewDistanceReturns the maximum allowed view distance on the server.
NKIsLoadingReturns if the world service is loading or not
NKIsPlayingReturns if the world service is playing or not
NKSetMinCullRadiusDebugging Only: Used to change the culling properties for objects.
NKGetMinCullRadiusDebugging Only: Used to view the culling properties for objects.
NKSetMaxCullRadiusDebugging Only: Used to change the culling properties for objects.
NKGetMaxCullRadiusDebugging Only: Used to view the culling properties for objects.
NKSetMinCullDistDebugging Only: Used to change the culling properties for objects.
NKGetMinCullDistDebugging Only: Used to view the culling properties for objects.
NKSetMaxCullDistDebugging Only: Used to change the culling properties for objects.
NKGetMaxCullDistDebugging Only: Used to view the culling properties for objects.
NKGetKeybindsReturns the keybinds that are directly associated with the world state
NKGetGameObjectByNetIdFinds the game object and returns it based upon a given network ID
NKGetSkyManagerReturns the manager for sky data.
NKGetSecondsPerDayReturns the number of seconds in a TUG day.
NKGetTimeReturns the current world time.
NKGetAllWorldPlayersGet a table of all world players currently connected, including yourself (a client will only receive their own player)
NKGetRemoteWorldPlayersGet a table of all remote players currently connected (a client will only their receive connection to the server)
NKGetLocalWorldPlayerGet the local world player on this game instance (a server or client’s own world player)

Functions

NKGetMilitaryTime

Returns the current time in military time.

Returns

floatThe current time in military time.

NKSetMilitaryTime

Sets the current in game time to the given value.

Parameters

floatThe time to be set.

NKSetTimeScale

Sets how quickly time progresses, as a multiplier.  1 is the default.

Parameters

floatThe time scale.

NKGetTimeScale

Returns the current time progression scalar.

Returns

floatThe current time scale.

NKSetViewDistance

Sets the user’s view distance.  Note that in multiplayer, this number will be capped based on the server’s settings.

Parameters

unsigned intNumber of cells to generate outward from the player.

NKGetViewDistance

Returns the user’s current view distance setting.

Returns

unsigned intThe current view distance (number of cells to generate outward from the player).

NKSetMaxViewDistance

Only usable by the server.  Sets the server’s maximum allowed view distance for all connected clients.

Parameters

unsigned intNumber of cells to generate outward from each player.

NKGetMaxViewDistance

Returns the maximum allowed view distance on the server.

Returns

unsigned intThe maximum allowed view distance (number of cells to generate outward from a player) on the server.

NKIsLoading

Returns if the world service is loading or not

Returns

booltrue if loading, false if not loading

NKIsPlaying

Returns if the world service is playing or not

Returns

booltrue if playing, false if not playing

NKSetMinCullRadius

Debugging Only: Used to change the culling properties for objects.  This clamps an object’s radius for culling consideration to this minimum value

Parameters

floatthe minimum cull radius value

NKGetMinCullRadius

Debugging Only: Used to view the culling properties for objects.  This retrieves the minimum culling radius value.  See NKSetMinCullRadius

Returns

floatthe minimum cull radius value

NKSetMaxCullRadius

Debugging Only: Used to change the culling properties for objects.  An object’s radius that is greater than this value is never culled

Parameters

floatthe maximum cull radius value

NKGetMaxCullRadius

Debugging Only: Used to view the culling properties for objects.  This retrieves the maximum culling radius value.  See NKGetMinCullRadius

Returns

floatthe maximum cull radius value

NKSetMinCullDist

Debugging Only: Used to change the culling properties for objects.  Objects with a radius less than or equal to that of the minimum culling radius (see NKSetMinCullRadius) are viewable at this distance away in voxels

Parameters

floatthe minimum cull distance value

NKGetMinCullDist

Debugging Only: Used to view the culling properties for objects.  This retrieves the minimum culling distance value.  (See NKSetMinCullDist)

Returns

floatthe minimum cull distance value

NKSetMaxCullDist

Debugging Only: Used to change the culling properties for objects.  This is not hooked up (player’s view distance is what’s used, this is left for the NK devs to use in-house) Objects with a radius greater than or equal to that of the maximum culling radius (see NKSetMaxCullRadius) will be culled at this distance

Parameters

floatthe maximum cull distance value

NKGetMaxCullDist

Debugging Only: Used to view the culling properties for objects.  This is not hooked up (player’s view distance is what’s used, this is left for the NK devs to use in-house) This retrieves the maximum culling distance value.  (See NKSetMinCullDist)

Returns

floatthe maximum cull distance value

NKGetKeybinds

Returns the keybinds that are directly associated with the world state

Returns

<InputMappingContext>the mapping context

NKGetGameObjectByNetId

Finds the game object and returns it based upon a given network ID

Parameters

int64The game object ID to look up

Returns

GameObjectthe game object matching the network ID, or nil if none found

NKGetSkyManager

Returns the manager for sky data.

Returns

SkyDataThe manager for sky data.  This includes cloud layers and celestial objects, such as the sun and moon.

NKGetSecondsPerDay

Returns the number of seconds in a TUG day.

Returns

floatThe number of seconds in a TUG day.

NKGetTime

Returns the current world time.

Returns

floatThe current world time.

NKGetAllWorldPlayers

Get a table of all world players currently connected, including yourself (a client will only receive their own player)

Returns

Tablea table of all world players

NKGetRemoteWorldPlayers

Get a table of all remote players currently connected (a client will only their receive connection to the server)

Returns

Tablea table of all world players

NKGetLocalWorldPlayer

Get the local world player on this game instance (a server or client’s own world player)

Returns

WorldPlayerthe local world player for this game
Close