-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[CORE] - Module Support #46
Comments
mod_info.json:
|
Load ordering
Core Mod'Core' is just defined as the content loaded by While overrides will function within the Core mod, it isn't recommend to use it heavily due to internal load ordering, it should also be generally preferable to modify the item directly. AbstractsAbstracts are handled by a multi-pass approach to loading data, where first a template version containing the ID, Type, and some metadata, is loaded into a dictionary against it's JObject data container. Once all available data has been loaded as generic templates into DataFactory, the templates are hydrated into actual instances and made available for use by other systems. Loading dependency chains of items (copy-from) is done by the responsible type factory, the general approach is to examine the item for a copy-from, and retrieve the item referred to, recursively until the root object is found, then they are loaded backwards to obtain the final object. OverridesOverrides are handled after all data for dependencies has been loaded, each mod gets an opportunity to override existing templates of the same ID/Type with it's own, so while Core can override its own definitions, it should be preferred to just modify the original definition directly. It's possible for a chain of mods to override the same item ID, the last mod (determined by dependencies) will be the winning override. While overriding is intended to be a direct replacement of template data, it happens at a point where entities have been hydrated, so the original entity can be mutated by the overriding entity like as in Mod AssembliesMod assemblies have access to nearly all the abilities that the core mod has:
ServicesServices are intended to provide things accessible through the World instance, such as the Implement a Service if you want to provide something to other mods, or need a globally referable object. All classes marked with this attribute loaded at world initialization, after all modules and data has been loaded. There are functions for registering manually. SystemsSystems are registered with a Priority, choice of priority affects how often the system will be invoked via it's interface, Systems are intended for when you need something that will run every turn/tick or at some arbitrary interval between turns. An example of core usage of a system is the Registering a system as a Per Tick priority indicates it should be invoked every turn, be careful that you aren't doing too much in that update. Handling Optional ModsWhere a mod dependency is marked as Optional, it's incumbent on the dependent mod to not assume the optional mod will be present, so override and copy-from should be avoided as they can't be guaranteed to be fulfilled. Optional mods is more intended for something like a version checking mod, the code can query |
Framework out how to load modules into the core, file formats and directory layouts.
The text was updated successfully, but these errors were encountered: