-
Notifications
You must be signed in to change notification settings - Fork 7
ModdingSupport
In special cases, the engine that is used may have to provide special modding support in order to allow the created mods to be run properly.
Resource files (*.res
) contain resources, such as images, sounds, texts, and other things. While the editor shows these resources always as self-contained things, in the file they might be put into a list.
An example are texts: There are texts, such as Trap messages
and Papers
. Although both are text resources, they are stored slightly different in the file: All trap messages are stored as a list in one resource, whereas each paper text is stored in its own resource as a list of lines. i.e.:
- Trap Messages: Message 0 | Message 1 | Message 2 | ...
- Paper 0: Line 1 | Line 2 | Line 3
- Paper 1: Line 1 | Line 2
A similar example are the level textures: All the small ones are stored in a big resource, whereas the medium and large ones are all stored in a dedicated resource each.
The editor, when working on a mod, only stores the new (or modified) information.
For example, when Paper 0
is to be modified (in the default language), the written file cybstrng.res
will contain only the one resource storing this one paper. If Trap message 2
is modified, the file cybstrng.res
contains the resource list for trap messages, and this list will have all the entries be empty, with the exception of the entry for trap message 2.
This is done to avoid copying all other data from the static data:
- Copying all of the vanilla data may copy more than the mod requires
- Another mod might want to change specific entries (such as particular textures, or typos in commonly used texts such as the cyborg conversion switches).
The editor distinguishes between "single" resources, and "list" resources, and an engine needs to perform the same rules as the editor.
"single" resources take precedence as a whole. A mod that modifies Paper 0
(with only two lines) must hide Paper 0
from the vanilla resources, even if it contains five lines (lines 3-5 must not be shown after the first two of the mod).
"list" resources take precedence per block (= list entry). If the mod only modifies Trap message 2
, the messages 0, 1, and all from 3 onward must be taken from the vanilla resources. The editor saves blocks 0 and 1 with zero length each, and, assuming only entry 2 is set, the entire resource will contain only three entries.
For the most part, resources are "single" resources, and "list" resources are the exception. Refer to the editor source for a description which is which.
For now, this is encoded in the list here: https://github.com/inkyblackness/hacked/blob/master/ss1/world/ids/Info.go -- Property
List
indicates which resource is considered to be a list.
As an engine developer, you need to implement these rules, otherwise a mod with extensions will "hide" vanilla resources it actually wants.
As a modder, if you want to stay compatible with engines without this mod-support, you may need to be careful which resources you touch. In essence, engines without mod-support won't support more than one mod at a time.
- If you let all entries of all lists bleed through, you'll end up with extra lines from papers for instance (lines 3-5 from the example above, although only 1-2 should be visible from the mod) - and other cases
- If you hide all entries of a "lower" resource, you lose reusability of vanilla resources (the editor would have to copy all data from a file) and you probably won't be able to combine resource mods.
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.