Kivo Spawn Configuration
Kivo Spawn has these editable files:
config.luashared/framework/framework.luashared/spawnfunctions/demo.lua
General options
Section titled “General options”| Option | Default | Description |
|---|---|---|
Config.debug |
false |
true prints debug messages to the console. |
Config.lastSpawnThread |
true |
Records the character’s position while they play, so the Last Location card has data. Set to false to stop recording. |
Config.lastSpawnThreadDelay |
1000 |
Milliseconds between position updates when recording is on. A higher value sends fewer updates. |
Selector text and image
Section titled “Selector text and image”| Option | Default | Description |
|---|---|---|
Config.ui.title |
'Spawn Selector' |
Heading of the selector panel. |
Config.ui.subtitle |
'Choose where to begin your journey.' |
Text under the heading. |
Config.ui.defaultImg |
'images/default.png' |
Image used for a location whose img is empty. The path is relative to the html folder. |
Config.ui.openDelay |
1000 |
Present in the file, but not read by the current version. Changing it has no effect. |
Behaviour and camera
Section titled “Behaviour and camera”| Option | Default | Description |
|---|---|---|
Config.spawnbehavior.allowLastSpawnLocation |
true |
Shows the Last Location card for returning characters. |
Config.spawnbehavior.cameraHoverDelay |
150 |
Milliseconds the selector waits after the player hovers a card before the camera moves to that location. |
Config.spawnbehavior.cameraFadeDistance |
1000.0 |
Camera transition tuning value. Leave it unchanged unless you have a reason. |
Config.spawnbehavior.hub.coords |
vector3(-269.0, -955.0, 750.0) |
Position of the hub camera, the overhead view shown when the selector opens. |
Config.spawnbehavior.hub.rot |
vector3(-90.0, 0.0, 0.0) |
Rotation of the hub camera. -90.0 pitch looks straight down. |
Config.newCharSkipSelector |
false |
true: a brand-new character skips the selector and is placed at Config.defaultSpawn. false: a new character sees the selector, without the Last Location card. |
Config.defaultSpawn |
vector4(-269.4, -955.3, 31.2, 205.0) |
The spawn used when the selector is skipped. x, y, z, heading. |
The hub is both the first view and the template for every location view. When the camera moves to a location, it keeps the hub’s altitude and rotation and only changes its map position. To change how high the camera sits, change the z value of hub.coords.
Spawn locations
Section titled “Spawn locations”Config.spawnlocations is a list. Each entry is one card in the selector, in the order you write them.
Config.spawnlocations = { { id = '1', coords = vector4(-1411.5907, -1241.6539, 4.4002, 12.2884), img = '', name = 'Vespucci Beach', description = 'Relax by the shore.', temperature = '32C', wind = 'Light', weather = 'sunny', spawnfunction = 'default', },}| Field | Type | If left out | Description |
|---|---|---|---|
id |
string | none | Required. Unique id of the location. Use text such as '1', 'beach'. Do not use 'last', which the Last Location card uses. |
coords |
vector4 |
none | Required. x, y, z, heading where the player appears. An entry without coords is ignored. |
img |
string | '' |
Image path relative to the html folder, for example images/beach.png. Empty uses Config.ui.defaultImg. |
name |
string | 'Spawn Location' |
Title on the card. |
description |
string | '' |
Text on the card. |
temperature |
string | '' |
Text shown as Temperature on the card. Free text. |
wind |
string | '' |
Text shown as Wind on the card. Free text. |
weather |
string | '' |
Text shown as Weather on the card. Free text. |
spawnfunction |
string | 'default' |
Name of a function in SpawnFunctions. See below. |
Put your own location images in html/images/ and reference them as images/<file name>.
The shipped file contains three example locations (Vespucci Beach, Vespucci not beach, Junk Yard). Replace or edit them.
Spawn functions
Section titled “Spawn functions”shared/spawnfunctions/demo.lua defines the table SpawnFunctions. A location’s spawnfunction field names one of its functions. The function runs on the server when the player confirms the location, and it returns the spawn that is applied.
| Name | What it does |
|---|---|
SpawnFunctions.default |
Normalises the location data and returns it unchanged. Used when spawnfunction is empty or unknown. |
SpawnFunctions.lastLocation |
Same as default. Used for the Last Location entry. |
Normalising fills in the defaults from the table above ('Spawn Location' for the name, empty text for the rest, heading 0.0 when none is given). The spawn it returns holds coords as { x, y, z, w }.
A function value written straight into the config is treated as the name custom. Always use the function name as text. See Exports and integration for how to write your own.
The same file also defines the global function resolveSpawnFunction(name), which returns the function for a name and falls back to SpawnFunctions.default for an unknown name.
Framework detection
Section titled “Framework detection”shared/framework/framework.lua finds your framework when the resource starts.
| Order | Resource checked | Framework.Name |
|---|---|---|
| 1 | qbx_core started |
'QBX' |
| 2 | es_extended started (and its shared object is available) |
'ESX' |
| 3 | qb-core started (and its core object is available) |
'QBCore' |
| none | nothing above | nil |
Start the framework before Kivo Spawn. If it was not started yet when Kivo Spawn loaded, Kivo Spawn detects it again the first time it looks up a player. The file also gives the rest of the resource three helpers: Framework.GetPlayer(source), Framework.GetIdentifier(source) and Framework.GetPlayerName(source). To support another framework, see Exports and integration.
