Description:
Energy Instruments: Developer is a quality-of-life mod for modders that works properly alongside Energy Instruments, Straightforward Dev Controls and World Explorer.
An improved type of visualizing in-game tables, along with the posibility to save lots of tables to well-formed Lua information, opens up a brand new approach of understanding the FS object mannequin!
# FEATURES:
– New console instructions to restart the sport (see beneath for particulars)
– Console command to print Lua desk contents to both the console/log or a separate file
– Console command to clear the log file
# CONSOLE COMMANDS:
– dtRestart (or ‘r’): Restarts the present savegame utilizing a mushy restart (barely sooner than a tough reset)
– dtRestartHard (or ‘rr’): Performs a tough reset (it will guarantee everyhing is unloaded from reminiscence)
– dtTable: Prints the contents of a Lua desk to the console/log
– dtSaveTable: Save the contents of a Lua desk to a file (3-4x occasions sooner than printing a desk to the log)
– dtVisualizeTable [beta]: An improved approach of printing tables to the log, each sooner, extra reminiscence environment friendly and visually improved.
– dtClearLog (or ‘cls’): Clears the log.txt file to get a contemporary log (particularly helpful when utilizing the restart command)
# CAUTION!
The console instructions to restart the sport will do that -without- asking you to save lots of your progress first. I.e. you danger loosing progress if you’re not cautious!
# SAVING TABLES
The ‘dtSaveTable’ lets you shortly dump a Lua desk to disk in a properly formatted Lua file, which means you’ll be able to load this file as a supply file within the Lua interpeter or in-game. This has a number of makes use of circumstances, particularly to grasp the FS object mannequin.
Optionally you’ll be able to select the depth of the output, particularly vital when saving prime stage tables (e.g. g_currentMission) which will include many youngster tabled and/or giant tables. Because of a properly optimized code it’s nonetheless attainable to save lots of g_currentMission with some 5-6 ranges of depth earlier than the Lua engine begins to leak reminiscence and turns into unstable (the default depth is about to 2).
Instance:
To dump the g_currentMission desk to a file you possibly can use the command ‘dtSaveTable g_currentMission currentMission.lua 1’. This is able to export the g_currentMission desk to a file named ‘currentMission.lua’ and solely together with the direct descendants of g_currentMission.
Be aware: on account of safety restrictions, the generated .lua file will likely be saved in your ‘My GamesFarmingSimulator2022modSettingsFS22_000_DevTools’ folder.
# PRINTING TABLES
Just like ‘dtSaveTable’, the command ‘dtTable’ can be utilized to output a desk to the log. It takes the desk title as necessary parameter and the maxDepth as an non-compulsory parameter (with a default worth of two).
Necessary! Because of the nature how FS prints to the log it is just beneficial to pretty small tables and/or shallow buildings (depth mustn’t exceed 2-3). E.g. printing g_currentMission to the console with a depth of 4 will make FS devour some 10-15GB of system ram after which crash in a out-of-memory error.
If you have to print a deeper construction it is strongly recommended to make use of ‘dtSaveTable’.
Credit:
w33zl