mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-20 23:53:13 +09:00
Add create-scenario command to clusteriohost
Creates a scenario directory with the Clusterio modules patched into it so the modules can be used outside of Clusterio. The command reuses the save patching by zipping the scenario, running patch() on it and extracting the result. Defaults to the freeplay scenario from the Factorio install in the host config and all plugins enabled there. Module loading in Instance.prepareSave is moved to patch.loadModules so the command and the instance share it, and findVersion is exported from server.ts so the command can find the freeplay scenario. Zipped scenarios were tried as an output form but Factorio does not pick them up from the scenarios folder, so only directories are written. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
1 parent
7987a5d925
commit
c419f3e9b2
10 files changed
+349
-41
No files matched your search
@@ -78,6 +78,27 @@ See docs/configuration.md in the main repositiory for the available configuratio
|
||||
Shows the value for a single config entry.
|
||||
|
||||
|
||||
### `create-scenario <output>`
|
||||
|
||||
Create a scenario with the Clusterio modules patched into it and write it to the `output` directory.
|
||||
This is the same patching that is applied to saves when an instance starts, see docs/how-it-works.md in the main repository.
|
||||
The result can be used as a regular scenario outside of Clusterio by copying it to the `scenarios` folder of Factorio or into a mod.
|
||||
|
||||
By default the freeplay scenario from the latest Factorio install in `host.factorio_directory` is patched with the modules from all plugins that are enabled in the host config.
|
||||
|
||||
* `--scenario <path>` Scenario directory, zipped scenario or save to patch instead of freeplay.
|
||||
This has the same restrictions as save patching, the scenario must either use the event_handler library and have been seen by Clusterio before, or already have been patched by Clusterio.
|
||||
|
||||
* `--factorio-version <version>` Factorio version to take the freeplay scenario from.
|
||||
Defaults to `latest`.
|
||||
|
||||
* `--plugins <name>...` Only patch in modules from the given plugins.
|
||||
|
||||
For example, creating a scenario with only the inventory_sync module:
|
||||
|
||||
npx clusteriohost create-scenario ~/.factorio/scenarios/inventory_sync --plugins inventory_sync
|
||||
|
||||
|
||||
#### `config list`
|
||||
|
||||
Lists up all configuration entries with their currently configured values.
|
||||
|
||||
Reference in new issue
Block a user