In other languages: Deutsch Русский Українська 简体中文

Modding: Difference between revisions

From Official Factorio Wiki
Jump to navigation Jump to search
No edit summary
(Categorize into modding)
 
(15 intermediate revisions by 6 users not shown)
Line 1: Line 1:
{{Languages}}
{{Languages}}
이 페이지는 모드를 어떻게 다운로드하고 설치하는 방법에 대해 알려주고, 또한 모드를 만들때 알아두어야할 사항들에 대한 내용들에 대하여 다루게 될것이다. 모드를 만드는 방법에 대한 더 자세한 방법은 [[모딩-튜토리얼 페이지|모딩:튜토리얼]]을 참고하면 될 것이다. 만약 모딩 API를 찾고 있다면 [http://lua-api.factorio.com/latest/ 공식 팩토리오 루아 API 문서] 사이트를 참고할 것. 만약 압축형식으로 모드를 설치하고 싶다면  [[Application_directory|application directory]] 페이지의 지시에 따르면 된다.
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 [[Tutorial:Modding_tutorial| modding tutorial page]]. If you are looking for the modding API, check out the [http://lua-api.factorio.com/latest/ 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|application directory]] page.


== 모드의 다운로드 & 설치 ==
== Downloading & installing mods ==
 
아래의 링크에서 모드를 다운받을 수 있다.


You can download the mods from the following places:
You can download the mods from the following places:


* Mod portal (in-game)
* [https://mods.factorio.com/ Mod portal (website)]
* [https://mods.factorio.com/ Mod portal (website)]
* Mod portal (in-game)
* [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 (in-game) ===


팩토리오의 개발자들은 [https://mods.factorio.com/ 모드포털 (웹사이트)] 을 사용자들에게 공유하기 위하여 만들어 놓았다. 웹사이트를 통하여 압축된 모드파일을 다운받을 수 있다. 모드 설치를 하려면 압축파일을 모드폴더 [[Application_directory#User_Data_directory|user data directory]] 위치에 다운받아 압축을 풀지 않은 상태에서 넣어놓으면 된다. 게임의 메인메뉴를 통하여 모드가 정상작동하는것인지 확인하고 검증할 수 있다.
The "Mods" section of the main menu is the best way to get mods. It combines downloading & installing, checking installed mods for updates, and enabling/disabling installed mods.


=== Mod portal (in-game) ===
=== Mod portal (website) ===


The mods displayed on the [https://mods.factorio.com/ mod portal (website)] should show in the in-game mod portal which you can access through the game's main menu. The differences in the in-game mod portal are that you can use it to both automatically download and install mods, and to enable or disable the mods.
The [https://mods.factorio.com/ mod portal (website)] is the center of mod hosting, where authors upload mods, and you can find previous versions, and discussions. Mods come as ZIP files, installed by copying (not unzipping) into the "mods" directory in the [[Application_directory#User_Data_directory|user data directory]]. Verify a successful installation by viewing the "Mods" list through the main menu, in-game.


=== Mod subforum ===
=== Mod subforum ===


Some mod creators upload their mods to the official [https://forums.factorio.com/viewforum.php?f=14&sid=68de6ef9ee46dcd7566653335917752b mod subforum] to showcase their work without submitting to the mod portal or to get feedbacks from the community on their mods before updating or sending them to the mod portal. An uploaded mod should show as an attachment.  Occasionally, a mod you download from the subforum comes in the form of a zipped file. You need to copy it into the mods directory located under the [[Application_directory#User_Data_directory|user data directory]] to install it — you do not have to unzip it. You can verify whether or not you installed it correctly by viewing the mods list which you can access through the game's main menu.
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 ===
Line 30: Line 28:
==== Required dependency ====
==== 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.
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 ====
==== Optional dependency ====
Line 36: Line 34:
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.
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.


==== Sidenote ====
==== Incompatibility ====


Currently, the in-game mod portal does not automatically download neither required nor optional dependencies; therefore, it is up to the user to find and install them. However, such process is expected to be made automatic in the future.
The dependencies can also be used to declare a mod to be incompatible with other mods, which prevents them from being loaded together.


== Creating mods ==
== Creating mods ==
: ''See also: [[Tutorial:Modding]]''
: ''See also: [[Tutorial:Modding tutorial|Modding tutorial]]''


=== API documentation ===
=== API documentation ===


* [[Prototype definitions|Prototype documentation]] — What prototypes can be added to the game, and what are their properties
* [https://lua-api.factorio.com/latest Modding API docs] - Overview page of the modding API documentation website
* [http://lua-api.Factorio.com/latest Documentation of the runtime API] — Hook into events and change the world around the player.
** [https://lua-api.factorio.com/latest/index-prototype.html Prototype documentation] — What prototypes can be added to the game, and what are their properties
* [https://github.com/wube/factorio-data Factorio data github repository] — Tracks changes of the lua prototype definitions in factorio in between releases.
** [https://lua-api.factorio.com/latest/index-runtime.html Documentation of the runtime API] — Hook into events and change the world around the player
* [[Tutorial:Mod structure|Mod structure]] — The basic structure of all mods
* [https://github.com/wube/factorio-data 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
* [[Data.raw]] — Lists the names and types of all built-in prototypes


=== Lua scripting ===
=== 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.
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 Visual Studio Code.


Useful resources for Lua:
Useful resources for Lua:
Line 60: Line 60:
* [https://repl.it/languages/lua Lua REPL] : A Lua read-eval-print-loop, essentially a sandbox.
* [https://repl.it/languages/lua Lua REPL] : A Lua read-eval-print-loop, essentially a sandbox.


=== Basic structure of a mod ===
=== Third-Party Tools ===
 
Factorio's mods are distributed in ZIP archives and contain several important files that Factorio looks for when loading mods. These files are listed below, and the required files are colored red.


* ExampleMod_0.0.1.zip
There is a wide variety of tools contributed by community members to help in mod development, such as plugins for IDEs to provide auto-completion, debuggers, as well as scripts to automate common tasks regarding translations or packaging.
** <span style="color:#FF5555">info.json</span>
** control.lua
** data.lua
** data-updates.lua
** data-final-fixes.lua


=== Licensing ===
* [https://forums.factorio.com/viewforum.php?f=135 Factorio sub-forum for mod development tools]
 
Every mod requires a license since Factorio '''v0.11'''. If a mod has no license, it is assumed to have a Creative Commons license — [http://creativecommons.org/licenses/by-nc/4.0 Attribution-Noncommercial 4.0 International (CC BY-NC 4.0)]. However, it is possible to purposely make the mod [https://choosealicense.com/licenses/unlicense/ unlicensed], to allow the code within it to be available to the public domain. The most popular distribution licenses for Factorio mods are the [https://choosealicense.com/licenses/mit/ MIT license] and the [https://choosealicense.com/licenses/gpl-3.0/ GPLv3] license.
 
Other useful legal links include:
 
* [http://www.factorioforums.com/forum/viewtopic.php?f=6&t=6202&p=48971#p48968 Forum post on allowed use of base-mod content]
* [http://www.factorio.com/terms-of-service Factorio terms of service]
* [https://choosealicense.com/licenses/ Choose a license]


== See also ==
== See also ==
* [[:Category:Technical]] — Documentation of technical formats and API's not related to modding
* [[:Category:Technical]] — Documentation of technical formats and API's not related to modding
{{C|Modding}}

Latest revision as of 19:31, 13 November 2023

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 (in-game)

The "Mods" section of the main menu is the best way to get mods. It combines downloading & installing, checking installed mods for updates, and enabling/disabling installed mods.

Mod portal (website)

The mod portal (website) is the center of mod hosting, where authors upload mods, and you can find previous versions, and discussions. Mods come as ZIP files, installed by copying (not unzipping) into the "mods" directory in the user data directory. Verify a successful installation by viewing the "Mods" list through the main menu, in-game.

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.

Incompatibility

The dependencies can also be used to declare a mod to be incompatible with other mods, which prevents them from being loaded together.

Creating mods

See also: Modding tutorial

API documentation

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 Visual Studio Code.

Useful resources for Lua:

Third-Party Tools

There is a wide variety of tools contributed by community members to help in mod development, such as plugins for IDEs to provide auto-completion, debuggers, as well as scripts to automate common tasks regarding translations or packaging.

See also

  • Category:Technical — Documentation of technical formats and API's not related to modding