dreamworkAPI
Ctrl K
GitHub
libraryDocs / level

level

librarysharedmenusource

The game-level library.

BSP: maps/{name}.bsp AI navigation: maps/{name}.ain Navigation Mesh: maps/{name}.nav

Modules

Fields

NameTypeDescription
namestringThe name of the current loaded level.

Functions

level.changeIt will end the current game, load the specified map and start a new game on it.
level.existsChecks if a map/level exists.
level.getGravityReturns the gravity of the current level.
level.setGravitySets the gravity of the current level.

#level.change

sharedmenusource
function level.change(name: string): boolean

It will end the current game, load the specified map and start a new game on it. Players are not kicked from the server.

Parameters
NameTypeDescription
namestring
Returns
TypeNameDescription
booleanisSuccessful

#level.exists

sharedmenunodiscardsource
function level.exists(name: string, gamePath?: string): boolean

Checks if a map/level exists.

Parameters
NameTypeDescription
namestringThe map/level name in maps/*.bsp folder.
gamePathoptionalstringAn optional argument specifying the search location, as an example for addon searches.
Returns
TypeNameDescription
boolean

#level.getGravity

sharedmenunodiscardsource
function level.getGravity(): integer

Returns the gravity of the current level.

Returns
TypeNameDescription
integergravityThe gravity of the current level.

#level.setGravity

sharedmenusource
function level.setGravity(value: integer)

Sets the gravity of the current level.

Parameters
NameTypeDescription
valueintegerThe value to set. Default: 600
Generated from the dreamwork meta branch.