Lua Console

From PioneerWiki
Revision as of 09:48, 29 December 2014 by Impaktor (talk | contribs) (added useful commands)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Lua console allows you to manipulate the game universe by injecting lua code directly into the game engine.

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:

  • Add said amount of money to player:
import("Game").player:AddMoney(100000)
  • Set said amount of money to player:
import("Game").player:SetMoney(100000)
  • Set the player ship to the one specified:
import("Game").player:SetShipType("shipname")

"shipname" is the filename of the ship's .json in the data/ships/ directory (without extension). Eg: ...SetShipType("amphiesma")

  • Set reputation of player:
import("Character").persistent.player.reputation = 42
  • Set kills of player:
import("Character").persistent.player.killcount = 5
  • Add the specified amount of equipment or cargo to the players ship
import("Game").player:AddEquip("equip", amount)

Amount can be omitted, and cargo capacity applies. Available equipment and cargo.