Interkarma has asked me to write a quick overview about the upcoming modding feature that will be in version 0.3 that I’ve been working on.
Currently mods need to be built into a Daggerfall Unity project to work, which is an obvious limitation. Interkarma has gone out of his way to support a bunch of different mods, even including them into Daggerfall Unity releases, but this takes up a lot of his time and has always been a temporary solution.
The new modding system takes advantage of Unity’s asset bundles, and allows mod creators to export the assets that make up their mods (textures, models, c# scripts, prefabs and so on) from Unity to a single file which is then loaded at runtime.
Exporting to a mod file is easy and done with a simple window inside the Unity editor:
The mod files are detected and loaded during the Startup Scene:
http://www.dfworkshop.net/wp-content/up ... odlist.png
This means that going forward, modders will no longer have to rely on their mods being part of Daggerfall Unity to work. Modders will be able to create, share, and release updates for their mods all on their own. And using mods will require little more than the player placing the mod file in a directory.
We’ll be providing more details on how it works, including examples and tutorials in the near future. Stay tuned!
Modding Support
- Nystul
- Posts: 1501
- Joined: Mon Mar 23, 2015 8:31 am
Re: Modding Support
I got some questions:
- is it possible for a mod to query for installed/activated (other) mods
- can script execution order of mods be specified/enforced (can a mod require/enforce its execution before or after certain other mods)
- can a mod hijack other mods resources?
- LypyL
- Posts: 512
- Joined: Sun Mar 22, 2015 3:48 am
Re: Modding Support
Yes, it is possible to query for installed mods...currently, this returns a Mod object, I'll add a method just to check if a Mod is loaded.is it possible for a mod to query for installed/activated (other) mods
Currently there is no way to force the load order, but I'm working on this. My plan is to have it work like it does in modern ES games - the UI at the startup screen will allow you to set the load order, and decide which mods are enabled / disabled. Eventually, these settings will be saved to a file so the settings will be remembered.can script execution order of mods be specified/enforced (can a mod require/enforce its execution before or after certain other mods)
I'm not sure I understand what you mean by "hijack" - a mod can pretty much do anything it can now, as modders can use c#.can a mod hijack other mods resources?
- Nystul
- Posts: 1501
- Joined: Mon Mar 23, 2015 8:31 am
Re: Modding Support
uh that's niceLypyL wrote:Yes, it is possible to query for installed mods...currently, this returns a Mod object, I'll add a method just to check if a Mod is loaded.is it possible for a mod to query for installed/activated (other) mods
cool this is how I would love to see it implementedLypyL wrote:Currently there is no way to force the load order, but I'm working on this. My plan is to have it work like it does in modern ES games - the UI at the startup screen will allow you to set the load order, and decide which mods are enabled / disabled. Eventually, these settings will be saved to a file so the settings will be remembered.can script execution order of mods be specified/enforced (can a mod require/enforce its execution before or after certain other mods)
I mean several things.LypyL wrote:I'm not sure I understand what you mean by "hijack" - a mod can pretty much do anything it can now, as modders can use c#.can a mod hijack other mods resources?
- Get instances to mod resources by script, e.g. GameObject.Find - as far as I understood your last comment this should work...
- create instances of classes defined in scripts of the mod, e.g. can I do a x = new OtherModNamespace.AClass(); in a different mod (create a instance of a class defined in the other mod and use its member variables, functions, etc.)
- inherit from classes defined in other mods
- get handles to public class members of other mods and change them or replace them completely by different objects of the correct type/class
- LypyL
- Posts: 512
- Joined: Sun Mar 22, 2015 3:48 am
Re: Modding Support
Yeah, you can still use GameObject.Find / GetComponent and so on. To clarify my comment above, I more meant you can accomplish the same things (though sometimes it might require a different approach).- Get instances to mod resources by script, e.g. GameObject.Find - as far as I understood your last comment this should work...
These are all be possible afaik. The key is that the mod with the classes you're trying to inherit from, be compiled first. That way when your mod is compiled, it will have a reference to its assembly.- create instances of classes defined in scripts of the mod, e.g. can I do a x = new OtherModNamespace.AClass(); in a different mod (create a instance of a class defined in the other mod and use its member variables, functions, etc.)
- inherit from classes defined in other mods
- get handles to public class members of other mods and change them or replace them completely by different objects of the correct type/class
- Arl
- Posts: 202
- Joined: Sun Mar 22, 2015 10:57 am
Re: Modding Support
This sounds very nice, will this allow texture replacements? or am I assuming further than things actually are?
My Deviantart page, I have some Daggerfall stuff in there.
- Interkarma
- Posts: 7249
- Joined: Sun Mar 22, 2015 1:51 am
Re: Modding Support
Lypyl's modding framework is about on par with the flexibility of Skyrim or Cities Skylines. It would allow for pretty much anything to be added externally, although some support will be needed in the core to open up "hooks" for mods to accomplish more.Phobos Anomaly wrote:This sounds very nice, will this allow texture replacements? or am I assuming further than things actually are?
I feel this is so important that I've decided to make it the key feature of release 0.3. It will allow a true modding community to start growing around Daggerfall Unity in the next few months.
My personal focus will remain on adding gameplay features as per mission statement, but it seems the enhancement stage is coming a little sooner than expected.
- LypyL
- Posts: 512
- Joined: Sun Mar 22, 2015 3:48 am
Re: Modding Support
I started in on the mod loader UI....it's coming along
- Arl
- Posts: 202
- Joined: Sun Mar 22, 2015 10:57 am
Re: Modding Support
This is so exciting for me, I think I should revisit some of my work.
Finally I will be able to see it in-game!, I can't be more thankful.
Finally I will be able to see it in-game!, I can't be more thankful.
My Deviantart page, I have some Daggerfall stuff in there.
- Uncanny_Valley
- Posts: 221
- Joined: Mon Mar 23, 2015 5:47 pm
Re: Modding Support
This is really cool! Great work!