The critical file in this mod is devices/device_a. The change of location is why prefixing filenames with the path variable is so important - more below. The original folder name is changed to a number, but everything else is the same. This is an example of where a Workshop mod ends up after you upload it and someone subscribes to it. Once you are subscribed, navigate to your Steam library and then steamapps\workshop\content\410900\1293804859.
Critical ops mod menu script how to#
We created the Large Sandbags mod as a comprehensive example of how to add a new device to Forts. If you need to revert a change you can right click on Forts in Steam, then properties, then local files. Doing so will change your experience, make the game unstable, and cause desyncs in multiplayer and when watching older replays. Warning: never make changes to the base game files or included mod folders. We make balancing changes from time to time, and an absolute change may be off the mark afterwards.
If you are changing a variable it is often better to multiply it by a factor, or add or subtract, instead of setting an absolute value. They can add completely new items, disable existing items, or remove them altogether. They can also change images, projectiles, and effects. So each mod can change the variables and tables of the base game.
Critical ops mod menu script mods#
The way mods work in Forts is that the base Lua file is loaded first, and then for each of the mods that are active, the game looks for the same Lua file in the mod's directory and loads that on top of what's been loaded already. If you browse some of these mods (such as weapon_pack) you'll see some folders and Lua files that are the same as in the base data directory. If you browse that you'll see subdirectories. In the data directory you'll see a folder called 'mods'. Understanding the game configuration is essential for modding the game correctly. There is quite a lot, but everything is named well and you can ask us if something doesn't make sense. You can browse this material, device, weapon and projectile data to see what parameters, texture files and effects are needed to make up the game. Materials have all of their configuration data in building_a, and their appearance is in the Sprites table, including damage levels. Devices are similar to weapons but don't need parameters relating to firing.
This value references the SaveName of an entry in the Projectiles table of the projectile_a file, and so specifies which projectile to create when the weapon fires. It sets the effects used while firing, reloading, being destroyed etc.
This points to a Lua file with detailed data about the appearance and behavior of the weapon. The game looks through this table to find the weapons to be used for this battle, what they are called internally (SaveName), how much they cost, build duration, etc.Įach weapon entry has a value called FileName. If you open weapon_a, you'll see a table called Weapons. The scripts most important to modding include:ĭuring the loading of a battle, the game will read these files and look for certain tables and variables within them. The game looks for specific plain text Lua files in order to get the parameters and asset filenames it needs to load and run the game. You can browse these folders to learn about how the game is set up. For example there is a directory for devices, weapons and materials. The data is divided into subdirectories according to their purpose. You can find it by right clicking on Forts in Steam, then properties, then local files. Forts' data can be browsed as ordinary files.