Module main🔗
Basic definitions for all APIs
global function _(string): string global _rootData: any global function addModifier<T>(string, T): T global function debugPrint(any)global function getBuildVersion(): string global function getCurrentModId(): string global function getOwningModId(): string global function getStringForPlatform(playstation : string, xbox : string, desktop : string): string global function nGetText(singularId : string, pluralId : string, n : integer): string global function npGetText(context : string, singularId : string, pluralId : string, n : integer): string global function pGetText(context : string, id : string): string global function resolve(relativePath : string): string global function ug_require(string): any
Category: globals🔗
_🔗
global function _(string): string
Used to mark strings localized string (eg. _("Some text to localize"))
string
string
_rootData🔗
global _rootData: any
addModifier🔗
global function addModifier<T>(string, T): T
Type Parameters
T
stringT
T
debugPrint🔗
global function debugPrint(any)
Prints text to the console/log file
Parametersany
game🔗
game.Res🔗
game.Res.script🔗
game.Res.script: {<any type> : <any type>}
game.res🔗
game.res: Res
game.$meta.__index🔗
metamethod game.$meta.__index(game, string): gameParameters
gamestring
game
getBuildVersion🔗
global function getBuildVersion(): string
Returns the build version
Returnsstring
getCurrentModId🔗
global function getCurrentModId(): string
Returns the mod id of the current mod scope
This is the outermost mod in the require hierarchy (i.e. the current file might belong to a different mod)
string— modId string
getOwningModId🔗
global function getOwningModId(): string
Returns the mod id of the mod owning the current file
Note: This means you can not delegate calls to this function into helper files!
string— modId string
getStringForPlatform🔗
global function getStringForPlatform(playstation : string, xbox : string, desktop : string): string
Returns the appropriate string based on the current platform
Parametersplaystation:string— the string for playstationxbox:string— the string for xboxdesktop:string— the string for desktop
string
nGetText🔗
global function nGetText(singularId : string, pluralId : string, n : integer): string
Returns a localized string, with plural handling
ParameterssingularId:string— singular text (or id)pluralId:string— plural text (or id)n:integer— number of object referred to in the plural text (for plural)
string— localized string
npGetText🔗
global function npGetText(context : string, singularId : string, pluralId : string, n : integer): string
Returns a localized string associated with a context, with plural handling
Parameterscontext:string— localization contextsingularId:string— singular text (or id)pluralId:string— plural text (or id)n:integer— number of object referred to in the plural text (for plural)
string— localized string
pGetText🔗
global function pGetText(context : string, id : string): string
Returns a localized string associated with a context
Parameterscontext:string— localization contextid:string— the string (or id) to localize
string— localized string
resolve🔗
global function resolve(relativePath : string): string
Resolves a file paths relative to the current file
ParametersrelativePath:string— a relative path
string— the full filepath
ug_require🔗
global function ug_require(string): any
Used instead of the regular lua require to include game related script
string
any