Scenario system: Difference between revisions
m (fixed link) |
(Just making things more up to date) |
||
Line 16: | Line 16: | ||
There are a few differences between a scenario, a save, and a mod. In a way, a scenario takes parts from both. | There are a few differences between a scenario, a save, and a mod. In a way, a scenario takes parts from both. | ||
* Scenarios, unlike mods, cannot add anything to the game. The only type of scripting allowed in a scenario is scripting that would occur in control. | * Scenarios, unlike mods, cannot add anything to the game. The only type of scripting allowed in a scenario is scripting that would occur in control.lua. | ||
* Scenarios | * Scenarios can have premade maps, such as the supply scenario, or can have maps made with the world generator, such as freeplay. | ||
* Scenarios do not need to be installed client side, unlike mods. This allows servers to implement small changes to gameplay on their end, such as displaying a MOTD to joining players. | * Scenarios do not need to be installed client side, unlike mods. This allows servers to implement small changes to gameplay on their end, such as displaying a MOTD to joining players. | ||
* Scenarios, unlike normal saves, are stored in a different folder. | * Scenarios, unlike normal saves, are stored in a different folder. | ||
* Scenarios can be used to create a bit of a story, as the campaign does. | * Scenarios can be used to create a bit of a story, as the campaign does. | ||
Revision as of 17:46, 13 October 2018
The scenario system allows save-based mods to be created, so that installing mods separately is not necessary. This allows for server side scripting, or to provide a separate objective than the vanilla freeplay (which is actually a scenario, just like the campaign).
Creation
Creation of a scenario starts in the world editor. The world editor allows an author to save a world that they have created as a scenario. This allows players to add special scripting to the scenario.
There are two ways to create a scenario:
- Running Factorio with the --map2scenario runtime flag, which allows specifying a save to transform into a scenario. It is possible to turn a scenario back into a normal save with the --scenario2map runtime flag.
- Via the Map editor.
Differences between scenarios, saves, and mods
There are a few differences between a scenario, a save, and a mod. In a way, a scenario takes parts from both.
- Scenarios, unlike mods, cannot add anything to the game. The only type of scripting allowed in a scenario is scripting that would occur in control.lua.
- Scenarios can have premade maps, such as the supply scenario, or can have maps made with the world generator, such as freeplay.
- Scenarios do not need to be installed client side, unlike mods. This allows servers to implement small changes to gameplay on their end, such as displaying a MOTD to joining players.
- Scenarios, unlike normal saves, are stored in a different folder.
- Scenarios can be used to create a bit of a story, as the campaign does.
Limitations of Scenarios
- Currently, scenarios cannot be uploaded to the official mod portal, they must be shared on other community websites.
- Scenarios cannot add anything to the game (Namely, they may not make calls to data:extend()).
- Scenarios count as mods for the purpose of isolating achievements.
Playing a scenario
There are several scenarios included into the game by default. To play a scenario, click Play->Scenarios, and choose either a user scenario, or a scenario from the base game. The Freeplay scenario is the same as the basic game, where the objective is to launch a rocket.
Upon choosing a scenario to play and saving the game, a normal save will be created that encompasses the map itself, and the control.Lua scripting that was provided by the scenario. This can be removed by deleting the script.dat and control.Lua files from the save, turning it into a normal save. Do this at your own risk, as it may break the save depending on how intertwined the scenario is with the save.
Installing scenarios
Scenarios made by other players can be installed into a folder called scenarios in the player's user data directory. It can then be played from the scenarios menu.