level
The game-level library.
BSP: maps/{name}.bsp AI navigation: maps/{name}.ain Navigation Mesh: maps/{name}.nav
Modules
Fields
| Name | Type | Description |
|---|---|---|
name | string | The name of the current loaded level. |
Functions
level.change | It will end the current game, load the specified map and start a new game on it. |
level.exists | Checks if a map/level exists. |
level.getGravity | Returns the gravity of the current level. |
level.setGravity | Sets the gravity of the current level. |
#level.change
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
| Name | Type | Description |
|---|---|---|
name | string |
Returns
| Type | Name | Description |
|---|---|---|
boolean | isSuccessful |
#level.exists
function level.exists(name: string, gamePath?: string): boolean
Checks if a map/level exists.
Parameters
| Name | Type | Description |
|---|---|---|
name | string | The map/level name in maps/*.bsp folder. |
gamePathoptional | string | An optional argument specifying the search location, as an example for addon searches. |
Returns
| Type | Name | Description |
|---|---|---|
boolean |
#level.getGravity
function level.getGravity(): integer
Returns the gravity of the current level.
Returns
| Type | Name | Description |
|---|---|---|
integer | gravity | The gravity of the current level. |
#level.setGravity
function level.setGravity(value: integer)
Sets the gravity of the current level.
Parameters
| Name | Type | Description |
|---|---|---|
value | integer | The value to set. Default: 600 |