Globals

All functions within this class are global functions, and not actually a part of any namespace or class.

Summary
GlobalsAll functions within this class are global functions, and not actually a part of any namespace or class.
Functions
includeIncludes functionality from a given script inside the script it is used in.
NKPrintPrints a string to the console.
NKErrorPops up a dialog box with an error message and prints to the console.
NKWarnPrints a lua warning string to the console.
NKInfoPrints a lua info string to the console.
NKParseFileParses a .txt file and returns a formatted lua table containing the parsed data.
NKCreateParserParses a .txt file and returns the root ParseSection
NKGetGeneratorListReturns a table of generator names
NKTerrainGetMaterialIDGets the material ID from a material name
NKSetActiveCameraSet the camera the renderer will use.
NKSwitchGameStateToPlayingSwitch to the playing state.
NKSwitchGameStateToMenuSwitch to the menu state.
NKProduceDropsFromSchematicCreates object drops for a given game object schematic.
NKGetMaterialSchematicObjectRepReturns the GameObjectRep for this placeable material
NKToggleChatWindowShows/Hides the chat window
NKToggleEngineOverlayToggles the engine overlay
NKReloadKeybindsClears current keybinds and reloads keybinds from the config files
NKLoadStaticModelLoad Static Model from txt file

Functions

include

Includes functionality from a given script inside the script it is used in.  To use, just type include(“filepath/starting/at/script/folder.lua”) at the top of the .lua file.  Note that the .lua extension is mandatory.

NKPrint

int NKPrint(lua_State *vm)

Prints a string to the console.

Parameters

stringThe string to print.
boolTrue to add a newline, false to not add a newline (optional parameter, defaults to true).

NKError

int NKError(lua_State *vm)

Pops up a dialog box with an error message and prints to the console.

Parameters

stringThe message to display.
boolTrue to add a newline, false to not add a newline (optional parameter, defaults to true).

NKWarn

int NKWarn(lua_State *vm)

Prints a lua warning string to the console.

Parameters

stringThe message.
boolTrue to add a newline, false to not add a newline (optional parameter, defaults to true).

NKInfo

int NKInfo(lua_State *vm)

Prints a lua info string to the console.

Parameters

stringThe message.
boolTrue to add a newline, false to not add a newline (optional parameter, defaults to true).

NKParseFile

int NKParseFile(lua_State *vm)

Parses a .txt file and returns a formatted lua table containing the parsed data.

Parameters

stringThe name of the file to be parsed.

Returns

tableThe table containing the parsed data.

NKCreateParser

int NKCreateParser(lua_State *vm)

Parses a .txt file and returns the root ParseSection

Parameters

stringThe name of the file to be parsed.

Returns

<ParseSection>root section of the .txt file

NKGetGeneratorList

int staticNKGetGeneratorList(lua_State *vm)

Returns a table of generator names

Returns

tableThe table containing the names of the generators

NKTerrainGetMaterialID

int NKTerrainGetMaterialID(lua_State *vm)

Gets the material ID from a material name

Parameters

stringthe name of the material
intThe material ID for the supplied name

NKSetActiveCamera

int NKSetActiveCamera(lua_State *vm)

Set the camera the renderer will use.

Parameters

BaseCamerathe camera to make active

NKSwitchGameStateToPlaying

int NKSwitchGameStateToPlaying(lua_State *vm)

Switch to the playing state.

NKSwitchGameStateToMenu

int NKSwitchGameStateToMenu(lua_State *vm)

Switch to the menu state.

NKProduceDropsFromSchematic

int NKProduceDropsFromSchematic(lua_State *l)

Creates object drops for a given game object schematic.

Parameters

PlaceableSchematicThe object producing the drops.
vec3The location to place the drops.

NKGetMaterialSchematicObjectRep

int NKGetMaterialSchematicObjectRep(lua_State *l)

Returns the GameObjectRep for this placeable material

Parameters

GameObjectSchematicThe object we want the object rep for.

Returns

StringThe name of the Object Rep

NKToggleChatWindow

int NKToggleChatWindow(lua_State *l)

Shows/Hides the chat window

Parameters

boolWhether or not you want to open the chat window.

NKToggleEngineOverlay

int NKToggleEngineOverlay(lua_State *l)

Toggles the engine overlay

NKReloadKeybinds

int NKReloadKeybinds(lua_State *l)

Clears current keybinds and reloads keybinds from the config files

NKLoadStaticModel

int NKLoadStaticModel(lua_State *l)

Load Static Model from txt file

Example file

StaticGraphics
{
    model = "path/to/model.obj"

    Diffuse
    {
        0 = "path/to/texture.tga"
        ...
    }
    Normal
    {
        ...
    }
    ...
}

Parameters

Stringrelative filepath

Returns

StaticGraphicsComponentgraphics component loaded from the file
int NKPrint(lua_State *vm)
Prints a string to the console.
int NKError(lua_State *vm)
Pops up a dialog box with an error message and prints to the console.
int NKWarn(lua_State *vm)
Prints a lua warning string to the console.
int NKInfo(lua_State *vm)
Prints a lua info string to the console.
int NKParseFile(lua_State *vm)
Parses a .txt file and returns a formatted lua table containing the parsed data.
int NKCreateParser(lua_State *vm)
Parses a .txt file and returns the root ParseSection
Section of a .txt file
int staticNKGetGeneratorList(lua_State *vm)
Returns a table of generator names
int NKTerrainGetMaterialID(lua_State *vm)
Gets the material ID from a material name
int NKSetActiveCamera(lua_State *vm)
Set the camera the renderer will use.
int NKSwitchGameStateToPlaying(lua_State *vm)
Switch to the playing state.
int NKSwitchGameStateToMenu(lua_State *vm)
Switch to the menu state.
int NKProduceDropsFromSchematic(lua_State *l)
Creates object drops for a given game object schematic.
int NKGetMaterialSchematicObjectRep(lua_State *l)
Returns the GameObjectRep for this placeable material
int NKToggleChatWindow(lua_State *l)
Shows/Hides the chat window
int NKToggleEngineOverlay(lua_State *l)
Toggles the engine overlay
int NKReloadKeybinds(lua_State *l)
Clears current keybinds and reloads keybinds from the config files
int NKLoadStaticModel(lua_State *l)
Load Static Model from txt file
Close