KOAR Lua Console
This mod adds a simple Lua console to the game. Working in the game's Lua environment, it has full access to the scripting engine and can be utilized for various needs.
Description
This mod adds a simple Lua console to the game. Working in the game's Lua environment, it has full access to the scripting engine and can be utilized for various needs.
This mod is experimental and relies on a lot of hacks. Playtesting and bug reports are appreciated
Overview
First of all, I should say that this game uses Havok Script as it's scripting engine. It's not a standard Lua and it's really hard to find any documentation on in, but it is Lua 5.1-compatible, so any code written for this version of Lua should work in KoAR.
To open the console, press F1 at any point after loading the game world. Press Esc or type q as a command to close.
Now, let's talk about what this console allows you to do. Here's a list of commands:
Installation
Unpack the contents of the archive into the game.
Additional information
A table that lists every simtype in the game can be found in optional downloads. It only contains ids and names, so it can be hard to tell which simtype name is required to spawn a specific item or actor. Besides, some simtypes may break the game if spawned. Hopefully I'll be able to compile a more informative list in the future.
weaaddar compiled a more informative list with all equipment items in the game: Для просмотра ссылки Зарегистрируйтесь
Для просмотра ссылки Зарегистрируйтесь
Description
This mod adds a simple Lua console to the game. Working in the game's Lua environment, it has full access to the scripting engine and can be utilized for various needs.
This mod is experimental and relies on a lot of hacks. Playtesting and bug reports are appreciated
Overview
First of all, I should say that this game uses Havok Script as it's scripting engine. It's not a standard Lua and it's really hard to find any documentation on in, but it is Lua 5.1-compatible, so any code written for this version of Lua should work in KoAR.
To open the console, press F1 at any point after loading the game world. Press Esc or type q as a command to close.
Now, let's talk about what this console allows you to do. Here's a list of commands:
Спойлер (раскрыть)
help - displays a list of available commands with short descriptions.
cheatmenu - opens a cheat menu with a lot of features. This menu was left in the game by the developers. Some of the options don't seem to work, but most of them do. (For people who had used cheatmenu before: I patched the function that opens cheatmenu to open the console instead. Cheatmenu can still be accessed via the console and it no longer requires developer mode.)
additem [simtype] [count=1] - gives player an item by its simtype name. Count is optional and defaults to 1.
Example: additem wpn_staff_ofruin
spawn [simtype] [distance=500] - spawns an actor in front of the player by its simtype name. Distance is optional and defaults to 500 (about a distance of a dodge roll).
Example: spawn obj_clowncar
lua [code] - executes everything entered after the command as Lua code.
Example: lua PLAYER.set_player_name("Custom name")
run [script_name] [arguments] - executes a Lua script from the "_scripts/console" folder with a name [script_name].lua. Everything after the script name is passed as arguments to the script.
Example: run addgold 10000
messagebox [code] - shows message box with specified text. Everything after the command is interpreted as a Lua expression and should return a string or another printable type.
Example: messagebox SIMTYPE_ID("sword1h_unique18a")
clear - clears the output area of the console.
q - closes the console.
cheatmenu - opens a cheat menu with a lot of features. This menu was left in the game by the developers. Some of the options don't seem to work, but most of them do. (For people who had used cheatmenu before: I patched the function that opens cheatmenu to open the console instead. Cheatmenu can still be accessed via the console and it no longer requires developer mode.)
additem [simtype] [count=1] - gives player an item by its simtype name. Count is optional and defaults to 1.
Example: additem wpn_staff_ofruin
spawn [simtype] [distance=500] - spawns an actor in front of the player by its simtype name. Distance is optional and defaults to 500 (about a distance of a dodge roll).
Example: spawn obj_clowncar
lua [code] - executes everything entered after the command as Lua code.
Example: lua PLAYER.set_player_name("Custom name")
run [script_name] [arguments] - executes a Lua script from the "_scripts/console" folder with a name [script_name].lua. Everything after the script name is passed as arguments to the script.
Example: run addgold 10000
messagebox [code] - shows message box with specified text. Everything after the command is interpreted as a Lua expression and should return a string or another printable type.
Example: messagebox SIMTYPE_ID("sword1h_unique18a")
clear - clears the output area of the console.
q - closes the console.
Installation
Unpack the contents of the archive into the game.
Additional information
A table that lists every simtype in the game can be found in optional downloads. It only contains ids and names, so it can be hard to tell which simtype name is required to spawn a specific item or actor. Besides, some simtypes may break the game if spawned. Hopefully I'll be able to compile a more informative list in the future.
weaaddar compiled a more informative list with all equipment items in the game: Для просмотра ссылки Зарегистрируйтесь
Для просмотра ссылки Зарегистрируйтесь