GameObjectSystem

System facilitating GameObject creation and scene management.

Summary
GameObjectSystemSystem facilitating GameObject creation and scene management.
Functions
NKCreateGameObjectCreate a game object locally on the system by name.
NKCreateNetworkedGameObjectCreate a game object over the network on the system by name (server side only).
NKFindObjectSchematicByNameRetrieve a GameObjectSchematic matching the given name.
NKGetPlaceableMaterialByIDReturns the GameObject representing the placeable material associated with the provided ID.
NKFindObjectSchematicByMatRetrieve a GameObjectSchematic that has a PlaceableMaterialSchematic that matches the given material ID.
NKCountGameObjectsInRadiusReturns the number of GameObjects intersecting a bounding sphere.
NKGetGameObjectSchematicsReturns a complete list of all GameObjectSchematic
NKGetGameObjectsInRadiusReturns the GameObjects intersecting a bounding sphere.
NKGetFilteredGameObjectsInRadiusReturns the GameObjects intersecting a bounding sphere pre-filtered by name.

Functions

NKCreateGameObject

Create a game object locally on the system by name.  This will NOT be referenced through the network system

Parameters

stringThe name of the object to create
booltrue if the memory should be managed for this object automatically (this should always be true!).  Setting this to false means the object will NOT be deleted when the world is deleted on leaving a game.

Returns

GameObjectReturns the game object that was created

NKCreateNetworkedGameObject

Create a game object over the network on the system by name (server side only).  This will obtain network IDs and start game object relevancy checks (see NetComponent)

Parameters

stringThe name of the object to create
booltrue if the memory should be managed for this object automatically (this should always be true!).  Setting this to false means the object will NOT be deleted when the world is deleted on leaving a game.
boolOptional, whether or not this object should be referenced automatically (see NKReference on the NetComponent for more information).  Defaults is true.
tableOptional, per instance properties that will be passed to the GameObject’s Constructor() call.  Default is nil.

Returns

GameObjectReturns the game object that was created

NKFindObjectSchematicByName

Retrieve a GameObjectSchematic matching the given name.

Parameters

stringThe name of the game object.

Returns

GameObjectSchematicThe game object schematic matching the given name.

NKGetPlaceableMaterialByID

Returns the GameObject representing the placeable material associated with the provided ID.

Parameters

intThe material id.

Returns

GameObjectThe GameObject representing the placeable material associated with the provided ID, or nil if none exists.

NKFindObjectSchematicByMat

Retrieve a GameObjectSchematic that has a PlaceableMaterialSchematic that matches the given material ID.

Parameters

intThe material ID.

Returns

GameObjectSchematicThe schematic containing the material that matches the given ID.

NKCountGameObjectsInRadius

Returns the number of GameObjects intersecting a bounding sphere.

Parameters

vec3The world position of the bounding sphere.
floatThe radius of the bounding sphere.

Returns

intThe number of GameObjects whose bounding box intersects the query.

NKGetGameObjectSchematics

Returns a complete list of all GameObjectSchematic

Returns

TableA lua table of GameObjectSchematic

NKGetGameObjectsInRadius

Returns the GameObjects intersecting a bounding sphere.

Parameters

vec3The world position of the bounding sphere.
floatThe radius of the bounding sphere.
stringThe category to match against.
boolFlag to ignore placeable objects in the query

Returns

tableThe array of intersecting GameObjects.

NKGetFilteredGameObjectsInRadius

Returns the GameObjects intersecting a bounding sphere pre-filtered by name.  Only game objects will be returned that match the filters

Parameters

vec3The world position of the bounding sphere.
floatThe radius of the bounding sphere.
tableA string list of game object names to filter against

Returns

tableThe array of filtered intersecting GameObjects.
Schematic containing data for constructing a GameObject as well as the schematics for its various components.
Close