GameMod

Mod class

Summary
GameModMod class
Functions
NKGetNameReturns name of the mod.
NKGetPathReturns relative path of the mod, defined in mods.txt
NKSaveTableSaves lua table.
NKRestoreTableRestores lua table.
NKRegisterScriptEventInternal function, creates new event type.
NKRaiseScriptEventSend a network event between server and clients.
NKParseFileParses a .txt file (from the mod folder) and returns a formatted lua table containing the parsed data.
NKCreateParserParses a .txt file (from the mod folder) and returns the root ParseSection
NKGetModdedPathReturns modded path to the file

Functions

NKGetName

Returns name of the mod.

Returns

stringname

NKGetPath

Returns relative path of the mod, defined in mods.txt

Returns

stringname

NKSaveTable

Saves lua table.

Parameters

stringname
Tabletable containing data to be saved

Returns

booltrue if successful

NKRestoreTable

Restores lua table.

Parameters

stringname

Returns

Tabletable restored containing
booltrue if successful

NKRegisterScriptEvent

Internal function, creates new event type.  Use the wrapper function Class.RegisterScriptEvent(name, table) or Mixin.RegisterScriptEvent(name, table) instead.

Parameters

stringThe unique name of this event.
tableTable defining the event.

NKRaiseScriptEvent

Send a network event between server and clients.

Parameters

NetComponent::EventType typeeither NetComponent.SERVER_TO_CLIENT, NetComponent.CLIENT_TO_SERVER or NetComponent.SERVER_TO_ALL
string nameName of the event
table dataTable of data for that event
table receipients (opt.)A list of WorldPlayer to receive this event (for SERVER_TO_* events only)

NKParseFile

Parses a .txt file (from the mod folder) and returns a formatted lua table containing the parsed data.

Parameters

stringThe name of the file to be parsed, the path has to be relative to the root of the mod

Returns

tableThe table containing the parsed data.

NKCreateParser

Parses a .txt file (from the mod folder) and returns the root ParseSection

Parameters

stringThe name of the file to be parsed.

Returns

<ParseSection>root section of the .txt file

NKGetModdedPath

Returns modded path to the file

Parameters

Stringrelative path

Returns

Stringabsolute path (if file/directory exists)
Section of a .txt file
A player in the game.
Close