This mod adds a toggle-able command prompt UI in-game, for developing and testing Lua mods.
This command prompt can be used to enter and execute direct Lua code, or premade console commands.
This mod should not be conflated or confused with any official developer console. Debug Console was written entirely by Offyerrocker, and contains no code from any official PAYDAY 2 developer tools.
This mod uses its own HUD workspace and should be compatible with all HUD mods. However, you may install other HUD mods along with this one at your own risk.
This mod will disable achievements! Works better with HoldTheKey! http://modwork.shop/22253 (No longer required) Requires [BeardLib!](https://github.com/simon-wh/PAYDAY-2-BeardLib/)
Although all code and commands run from this command prompt are encapsulated in a pcall ("protected call") to prevent crashes from syntax errors or other compilation problems, there is no access protection for illegal actions or code that may adversely affect your game's function outside of this pcall.
Additionally, pcalls in general provide no protection from runtime errors or faults on the engine-side; for example, illegal operations on Vector3 or Rotation data types, which will cause crashes.
This code will only execute on your client; remote code execution would be considered a security exploit, and is not a planned feature.
Direct "cheat" commands (such as /god or /kill, etc.) are not publicly available, in the interest of preventing cheaters or inexperienced script kiddies who would use this as a cheating tool. If you already know Lua then this mod won't prevent you from cheating anyway.
The console is activated with a keybind of your choice; I recommend the tilde key (`).
Features:
- On-the-fly Lua execution
- Direct code execution by customizable keybind
- Built-in debug command tools
- Tracker for HUD elements which update too quickly for the normal BLT log
- Chat is enabled in offline mode (to support chat command interpretation in the future)
- Optional: Output the contents of print() to the console window. This option is disabled by default, and can be configured further in mod options.
Known Bugs:
- Offline Chat conflicts with Restoration Mod
- Plenty more, I'm sure
Planned:
- More specific tool packages (eg. AI testing, map making and script element testing, unit info)
- Execute commands from in-game chat
For more information and documentation, including a complete command list, please visit the GitHub page Wiki.
https://github.com/offyerrocker/Console/wiki
This mod is in development.
GitHub Link: https://github.com/offyerrocker/Console
Please contact me on this modpage, or on Discord or Reddit if you need help, or if you would like to report a bug. Feedback is also welcome.
