Difference between revisions of "Modding internals"
(→Project Types) |
(→Overriding existing items) |
||
Line 18: | Line 18: | ||
<p>Everything has a unique identifier. Levels have unique names, items have unique ID numbers (GUIDs),... All data is stored under its unique ID. During loading, the system checks if an ID already exists or not. If the same ID was loaded before, the data currently loaded overrides the old data associated with that ID. Remember that you can use dependencies to view and edit data from other projects and those edits are stored separately in your project under the same ID. This way, it is possible to create a project that contains the same ID multiple times, which will cause one to override the other.</p> | <p>Everything has a unique identifier. Levels have unique names, items have unique ID numbers (GUIDs),... All data is stored under its unique ID. During loading, the system checks if an ID already exists or not. If the same ID was loaded before, the data currently loaded overrides the old data associated with that ID. Remember that you can use dependencies to view and edit data from other projects and those edits are stored separately in your project under the same ID. This way, it is possible to create a project that contains the same ID multiple times, which will cause one to override the other.</p> | ||
+ | <br /> | ||
[[File:Overriding.png]] | [[File:Overriding.png]] | ||
Revision as of 15:40, 1 August 2017
Contents
General
When talking about "Modding", we refer to editing existing content as well as creating your own. This pack of custom content is called a "mod". This page explains how these edits to existing content are handled by the system. (New content is simply loaded and added to the other content.)
In the editor, you work with projects. When publishing a project in the editor, it puts itself online for others to download and enable in their game. "Project" is simply what we call a mod in the editor for ease of use. So, when people talk about "modding", "creating mods",... they are talking about creating/publishing/downloading projects other people made in the editor.
Dependencies
To be able to edit existing content, you need to be able to load that content. That's what dependencies are for. A project can be dependent on any number of other projects. While in the editor, these can be defined in the Project settings window. On top of its own data, a project loads all data (levels, resources, root templates, scripts,...) from its dependent projects. Via dependencies, you are thus able to load and view/edit existing content in your own projects. Anything you edit is stored in your own project under the same folder structure and ID as in the dependent project.
Hence, to edit existing content, you do the following:
- Create a project, dependent on the project containing the items you which to edit
- Open those items and change what you want to change
- Save your project
Overriding existing items
Everything has a unique identifier. Levels have unique names, items have unique ID numbers (GUIDs),... All data is stored under its unique ID. During loading, the system checks if an ID already exists or not. If the same ID was loaded before, the data currently loaded overrides the old data associated with that ID. Remember that you can use dependencies to view and edit data from other projects and those edits are stored separately in your project under the same ID. This way, it is possible to create a project that contains the same ID multiple times, which will cause one to override the other.
Load Order
To ensure that your item overrides the original one, it needs to be loaded after the original one. This "load order" is defined naturally by the concept of dependencies. First, dependencies are loaded, then your own project.
When working with multiple dependencies, you need to be aware of their load order because two or more dependent projects might also have the same item defined. To make sure that dependencies load in the correct order, the dependency load order can be defined in the Project settings window
Project Types
There is an extra restriction on projects: the project type. The two available types are: Adventure and Add-on. Adventures are full campaigns, like the main story. When creating your own adventure, you are expected to create your own story, or edit an dependent one, and do the necessary scripting. Add-ons are (smaller) projects that can be toggled on/off while playing an Adventure. An example would be an add-on that adds 2 new swords to the game.
This separation exists because