Modding: Difference between revisions
(→Creating mods: removed outdated Mod structure section, added link to Tutorial:Mod structure) |
(→Downloading & installing mods: recommend in-game mod downloader before website, and rephrase sections so it fits) |
||
Line 10: | Line 10: | ||
* [https://forums.factorio.com/viewforum.php?f=14&sid=68de6ef9ee46dcd7566653335917752b Mod subforum] | * [https://forums.factorio.com/viewforum.php?f=14&sid=68de6ef9ee46dcd7566653335917752b Mod subforum] | ||
=== Mod portal ( | === Mod portal (in-game) === | ||
The "Mods" section of the main menu is the best way to get mods. It combines the ability to download & install, with checking installed mods for updates, and enabling/disabling installed mods. | |||
=== Mod portal ( | === Mod portal (website) === | ||
Mods can be browsed and downloaded from [https://mods.factorio.com/ mod portal (website)] as well. Mods come in the form of ZIP files, installed by copying (not unzipping) them into the "mods" directory within the [[Application_directory#User_Data_directory|user data directory]]. Verify a successful installation by viewing the "Mods" list through the game's main menu. | |||
=== Mod subforum === | === Mod subforum === | ||
Mod authors maintain threads in the official [https://forums.factorio.com/viewforum.php?f=14&sid=68de6ef9ee46dcd7566653335917752b mod subforum] to support their work. There may be experimental mods or updates here that aren't available on the main portal. They will be downloaded as ZIP files, either as forum "attachments", or with a link to a hosting site. These are installed the same way as mods downloaded from the portal. | |||
=== Dependencies === | === Dependencies === |
Revision as of 18:07, 15 December 2019
This page tells you how to download and install mods, and gives a quick overview of what you should keep in mind when creating a mod. For more detailed instructions on creating mods, you may view the modding tutorial page. If you are looking for the modding API, check out the official Factorio Lua API documentation website. If you wish to know where to install a mod which is in a zipped format, please read the instructions on the application directory page.
Downloading & installing mods
You can download the mods from the following places:
- Mod portal (website)
- Mod portal (in-game)
- Mod subforum
Mod portal (in-game)
The "Mods" section of the main menu is the best way to get mods. It combines the ability to download & install, with checking installed mods for updates, and enabling/disabling installed mods.
Mod portal (website)
Mods can be browsed and downloaded from mod portal (website) as well. Mods come in the form of ZIP files, installed by copying (not unzipping) them into the "mods" directory within the user data directory. Verify a successful installation by viewing the "Mods" list through the game's main menu.
Mod subforum
Mod authors maintain threads in the official mod subforum to support their work. There may be experimental mods or updates here that aren't available on the main portal. They will be downloaded as ZIP files, either as forum "attachments", or with a link to a hosting site. These are installed the same way as mods downloaded from the portal.
Dependencies
Many mods use Factorio's base mod as their only dependency which you do not have to install separately. However, some mods may require you to install other mods for them to work and can also make suggestions for you to install other mods for them to extend their functionality.
Required dependency
When a mod you installed requires you to install another mod for it to work, the other mod, in this case, is a required dependency. The in-game mod portal automatically downloads required dependencies when downloading any mod.
Optional dependency
When a mod makes a suggestion to install another mod, but if it does not need that other mod for it to work, the other mod, in this case, is an optional dependency. You can install the optional dependencies which extend the functionality of a mod to enhance your gaming experience with the mod.
Creating mods
- See also: Tutorial:Modding
API documentation
- Prototype documentation — What prototypes can be added to the game, and what are their properties
- Documentation of the runtime API — Hook into events and change the world around the player.
- Mod structure — The basic structure of all mods
- Factorio data github repository — Tracks changes of the Lua prototype definitions in Factorio between releases.
- Data.raw — Lists the names and types of all built-in prototypes
Lua scripting
You need to use the Lua programming language (version 5.2.1) to create any mods in Factorio. The game's mod system injects your code into the startup and to the data construction stage of the game. You can use any text editor to write the code for your mod. Well-known text editors that offer syntax highlighting for Lua are Notepad++ and Sublime Text.
Useful resources for Lua:
- Lua tutorial
- Lua reference manual
- Lua REPL : A Lua read-eval-print-loop, essentially a sandbox.
Licensing
Every mod requires a license since Factorio v0.11. If a mod has no license, it is assumed to have a Creative Commons license — Attribution-Noncommercial 4.0 International (CC BY-NC 4.0). However, it is possible to purposely make the mod unlicensed, to allow the code within it to be available to the public domain. The most popular distribution licenses for Factorio mods are the MIT license and the GPLv3 license.
Other useful legal links include:
See also
- Category:Technical — Documentation of technical formats and API's not related to modding