Kingdom Come: Deliverance
0 of 0

File information

Last updated

Original upload

Created by

AesmaDiv

Uploaded by

AesmaDiv

Virus scan

Safe to use

Tags for this mod

About this mod

Small mod + tool allowing to execute your Lua commands in game "on fly".
Could be interesting for modders.

Permissions and credits
Donations
This is a small mod + tool, that allows you to inject your custom Lua commands into the game.
NOTE! Uses modified Scripts\Entities\actor\player.lua, so be advice.

Install: Unpack to Mods folder.
Uninstall: Delete Mods\Aesma_Lua_Injector folder.

What it does:
On save game load it starts Timer with period of 1 sec. Timer reads aesma_cmd.txt file for any code. If file not exist or empty its continues to next iteration.
When code is present mod tries to execute it using pcall and assert(loadstring(your_code)), and prints result of a try to aesma_log.txt. After try (no matter if its succeed or not) file aesma_cmd.txt is cleared to pervent cycle execution.

You can use it two ways: Editing aesma_cmd.txt by yourself or use KCD Lua Injector.exe

My function:
Aesma.Log(text) - prints text to aesma_log.txt file;
Aesma.ReadCommand() - reads aesma_cmd.txt for code.
Aesma.ClearCommand() - clears aesma_cmd.txt.
Aesma:ExecuteCommand(command) - executes command loaded from aesma_cmd.txt.
Aesma:OnTimer() - timer function.
Aesma.TimerId - timer identificator.
Aesma.TimerState - boolean that disables timer function.