Mech Engineer

Mech Engineer

Not enough ratings
Basic modding instructions
By KiberKreker
Contains information about paths, file structure, abilities, tools and restrictions.
   
Award
Favorite
Favorited
Unfavorite
What you can do
  • Change game balance with balance.ini .
  • Change any sprite via functions in lua scripts.
  • Add code injections in certain places with lua scripts. Have access to some engine functions and all variables. Add new modules, change game rules.
  • Change language and font via functions in lua scripts. Change language global variable in language.lua will override regular language settings.
Apollo extension for external scripts support uses Lua 5.4. Manual[www.lua.org].
Structure
After subrscribing to a mod, when you starting a game it creates/updates a folder in mods folder with the mod name.
Game reads each folder as a separate mod inside:
C:\Users\_USERNAME_\AppData\Local\Mech_Engineer\mods
Unsubscribing from workshop mod does not delete its folder from mods. You have to do it yourself.

When you create a mod, you need to follow the file structure. You can find it inside the game's root directory, where it was installed.
For me it is:
X:\SteamLibrary\steamapps\common\Mech Engineer
There, the "example_mod" folder contains a structure example. It has all the scripts with functions and helpful stuff.

How it works:
  • battle (folder with scripts to handle map generations, mechs functions and monster spawners)
  • components (folder with scripts to allow production of new modules, mechs and reactors)
  • engineering (folder with scripts to handle starting equipment and probably sub menus)
  • hangar (folder with scripts to handle the global map and some battle rules)
  • research (folder with scripts to handle research nodes)
  • sprites (unnecessary folder for storing sprites)
  • balance.ini (auto rewrites all game balance if exists)
  • default_balance.ini (example of current game balance)
  • language.lua (first script to launch, useful to rewrite settings, like language or font files)
  • list_of_functions.txt (contains all exposed functions. Manual with descriptions link [manual.yoyogames.com].
  • list_of_sprites.txt (contains names of all sprites, usefull if you want to change them)
  • MechEngineerGame.ttf (default font, as an example)
  • mod_mech_grid_help.png (16px grid that may help with arranging module slots for your reactors and mechs)
  • mod_stats.ini (example of where you can store your mods settings)
  • obj_button_*.lua (scripts that activate different menus)
  • obj_database.lua (best place to declare variables and components)
  • obj_FUI_render.lua (draw layer with the lowest depth. Helpful to draw things on top of everything)
Mod example
https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=3048208621

Tools:
Aceprite for sprite editing – github[github.com], store
Notepad++ for scripts – link[notepad-plus-plus.org]