Modding Support

Discuss Daggerfall Workshop news articles.
Post Reply
User avatar
LypyL
Posts: 512
Joined: Sun Mar 22, 2015 3:48 am

Modding Support

Post by LypyL »

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:

Image

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!

User avatar
Nystul
Posts: 1501
Joined: Mon Mar 23, 2015 8:31 am

Re: Modding Support

Post by Nystul »

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?

User avatar
LypyL
Posts: 512
Joined: Sun Mar 22, 2015 3:48 am

Re: Modding Support

Post by LypyL »

is it possible for a mod to query for installed/activated (other) mods
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.
can script execution order of mods be specified/enforced (can a mod require/enforce its execution before or after certain 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 a mod hijack other mods resources?
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#.

User avatar
Nystul
Posts: 1501
Joined: Mon Mar 23, 2015 8:31 am

Re: Modding Support

Post by Nystul »

LypyL wrote:
is it possible for a mod to query for installed/activated (other) mods
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.
uh that's nice
LypyL wrote:
can script execution order of mods be specified/enforced (can a mod require/enforce its execution before or after certain 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.
cool this is how I would love to see it implemented
LypyL wrote:
can a mod hijack other mods resources?
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#.
I mean several things.
- 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

User avatar
LypyL
Posts: 512
Joined: Sun Mar 22, 2015 3:48 am

Re: Modding Support

Post by LypyL »

- Get instances to mod resources by script, e.g. GameObject.Find - as far as I understood your last comment this should work...
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).
- 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
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.

User avatar
Arl
Posts: 202
Joined: Sun Mar 22, 2015 10:57 am

Re: Modding Support

Post by Arl »

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.

User avatar
Interkarma
Posts: 7236
Joined: Sun Mar 22, 2015 1:51 am

Re: Modding Support

Post by Interkarma »

Phobos Anomaly wrote:This sounds very nice, will this allow texture replacements? or am I assuming further than things actually are?
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.

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. :)

User avatar
LypyL
Posts: 512
Joined: Sun Mar 22, 2015 3:48 am

Re: Modding Support

Post by LypyL »

Image

I started in on the mod loader UI....it's coming along :)

User avatar
Arl
Posts: 202
Joined: Sun Mar 22, 2015 10:57 am

Re: Modding Support

Post by Arl »

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.
My Deviantart page, I have some Daggerfall stuff in there.

User avatar
Uncanny_Valley
Posts: 221
Joined: Mon Mar 23, 2015 5:47 pm

Re: Modding Support

Post by Uncanny_Valley »

This is really cool! :D Great work!

Post Reply