Lua Console
There are two main ways of reaching in under the hood of the game when it's running. The Lua console, which is the old way, and the Debug window. In the Lua console, you type in commands in lua directly.
Debug window
The new way of poking the game is the Debug window. You will launch it either via the button at the bottom of the first tab (Video) of the Settings window or more directly by Ctrl + I.
Lua console allows you to manipulate the game universe by injecting lua code directly into the game engine. You can open the console in-game by pressing '`' (default key, you can change it in the keybinding options).
Useful for restoring save
Due to the evolving code of pioneer, we still sometimes need to change the save format, making all previous saves useless. In this case, you can give your player character back what he had, by manually cheating:
Note: Since the 2020-12-22 Release candidate, how you input these has changed a bit: instead of import("Game").player: you need to write require "Game".player: or require "PlayerState", the latter especially if you're touching the players finances or legal status. PlayerState
- Add said amount of money to player:
require "PlayerState".AddMoney(100000)
- Set said amount of money to player:
require "PlayerState".SetMoney(100000)
- Set the amount of propellant in the tank:
require "Game".player:SetFuelPercent(100)
- Set the player ship to the one specified:
require "Game".player:SetShipType("shipname")
"shipname" is the filename of the ship's .json in the data/ships/ directory (without extension). Eg: ...SetShipType("xylophis")
- Set reputation of player:
require "Character".persistent.player.reputation = 42
- Set kills of player:
require "Character".persistent.player.killcount = 5
