Standard console runs in its own environment and cannot access the inner state of the mod. That state can only be accessed by functions from within the mod. You can use loadstring inside the mod to execute an orbitrary command in the environment.
This file defines a simple interface to the above route.
To use it, simply put file in your mod and put `require "console" in control.lua
When ingame use following interface call:
Code: Select all
Remove the lib when releasing the mod. It is not sophisticated and not designed to avoid clashes in case it is present in multiple mods.