Page 10 of 12

DFU class info and actual examples

Posted: Tue Oct 15, 2019 5:54 pm
by Yagiza
Are there actual examples of mods for DFU. Those in the first messages of this topic are obsolete and mostly do not work with actual DFU.
Also, I wonder if any documentation of classes from DaggerfallWorkshop namespace exist. Docs from this page describe some aspects of DFU modding, but most classes are not described there.

Re: DFU class info and actual examples

Posted: Tue Oct 15, 2019 6:44 pm
by TheLacus
Yagiza wrote:
Tue Oct 15, 2019 5:54 pm
Are there actual examples of mods for DFU. Those in the first messages of this topic are obsolete and mostly do not work with actual DFU.
Are they? I'll check when I have some time but everything except example of ini settings should still be valid.
Yagiza wrote:
Tue Oct 15, 2019 5:54 pm
Also, I wonder if any documentation of classes from DaggerfallWorkshop namespace exist. Docs from this page describe some aspects of DFU modding, but most classes are not described there.
API documentation is typically written directly with xml code docs and exported to html. This is mostly useful for closed source projects; you can read xml docs directly with code for Daggerfall Unity.

I think exporting them for more readibility, for example to Github pages, could have value, but is an addition that would have to be maintained and updated regularly.

Re: DFU class info and actual examples

Posted: Tue Oct 15, 2019 8:08 pm
by Yagiza
TheLacus wrote:
Tue Oct 15, 2019 6:44 pm
API documentation is typically written directly with xml code docs and exported to html. This is mostly useful for closed source projects; you can read xml docs directly with code for Daggerfall Unity.
Sorry, I can't understand where these docs are and how can I read them directly with code for Daggerfall Unity. :shock: :?:

Re: Modding Tutorials

Posted: Tue Oct 15, 2019 8:08 pm
by Hazelnut
https://github.com/Interkarma/daggerfall-unity

download or clone the repo and look at the .cs files in Assets/Scripts & Assets/Game

Re: Modding Tutorials

Posted: Tue Oct 15, 2019 9:00 pm
by Yagiza
Hazelnut wrote:
Tue Oct 15, 2019 8:08 pm
https://github.com/Interkarma/daggerfall-unity

download or clone the repo and look at the .cs files in Assets/Scripts & Assets/Game
Yes, that's what I've done in the first place. But seeing the code, I can't figure oout, how I should use these classes in my mod.

Re: DFU class info and actual examples

Posted: Tue Oct 15, 2019 9:03 pm
by Yagiza
TheLacus wrote:
Tue Oct 15, 2019 6:44 pm
Yagiza wrote:
Tue Oct 15, 2019 5:54 pm
Are there actual examples of mods for DFU. Those in the first messages of this topic are obsolete and mostly do not work with actual DFU.
Are they? I'll check when I have some time but everything except example of ini settings should still be valid.
Example 3 also do not work for me. Maybe I did something wrong, but this code:

Code: Select all

if (audioSource == null)
    audioSource = this.GetComponent<AudioSource>();
Leaves audioSource = null.

Re: Modding Tutorials

Posted: Tue Oct 15, 2019 9:51 pm
by Hazelnut
Yagiza wrote:
Tue Oct 15, 2019 9:00 pm
Hazelnut wrote:
Tue Oct 15, 2019 8:08 pm
https://github.com/Interkarma/daggerfall-unity

download or clone the repo and look at the .cs files in Assets/Scripts & Assets/Game
Yes, that's what I've done in the first place. But seeing the code, I can't figure oout, how I should use these classes in my mod.
My suggestion is to grab a mod from github and get it working as a virtual mod in Unity, then dissect it to see how it works and what it does etc. Nystuls' mods really helped me get started, as I found figuring out what to do at first was quite hard. The mod documentation is much better now, but some of it is old and may be out of date. (check the posting dates)

Re: Modding Tutorials

Posted: Wed Oct 16, 2019 3:46 am
by Yagiza
Hazelnut wrote:
Tue Oct 15, 2019 9:51 pm
My suggestion is to grab a mod from github and get it working as a virtual mod in Unity, then dissect it to see how it works and what it does etc. Nystuls' mods really helped me get started, as I found figuring out what to do at first was quite hard. The mod documentation is much better now, but some of it is old and may be out of date. (check the posting dates)
Thanx, I'll try.

Re: Modding Tutorials

Posted: Sun Nov 03, 2019 10:51 pm
by septua77
I'm sorry, I'm kinda slow. I can't even figure out how to open the Mod Builder interface.

My Daggerfall Workshop folder does not have that and I can't figure out how to open that window inside the Unity editor.

I was also confused if I need to clone the whole DFU project or just the Daggerfall tools for Unity project, but tried both and still not sure how to even open Mod Builder. <-- Main thing I'm confused about. Thanks for any help.

Re: Modding Tutorials

Posted: Fri Nov 08, 2019 12:44 am
by IAmTheClayman
How would you go about making changes to an existing script in DFU? For example, right now HUDVitals.cs has the following code:

Code: Select all

public HUDVitals()
            :base()
{
	playerEntity = GameManager.Instance.PlayerEntity;
	LoadAssets();

	BackgroundColor = Color.clear;
	HorizontalAlignment = HorizontalAlignment.Left;
	VerticalAlignment = VerticalAlignment.Bottom;
	SetMargins(Margins.All, borderSize);
	...
I want to, as a test, have the vitals display horizontally centered. Would the way to do this as a distributable mod be to make the edits directly to HUDVitals.cs and include it in the list under Files in the Mod Builder window?