Page 9 of 10

Re: Modding Tutorials

Posted: Sat Mar 09, 2019 12:27 am
by mikeprichard
UserOfThisSite wrote:
Sat Mar 09, 2019 12:11 am
It's very easy, someone simply need to change those values to public, it's few seconds work. For example I can do that for my own Daggerfall, but then it won't be a mod any longer, but a hack. If DFU devs change those values to public on some newer version, then I'll update my mod.
Ah, in that case, I hope they do. (hint hint) Thanks again for this - when you think it's ready, would be great to see this in the "Released Mods" forum.

Re: Modding Tutorials

Posted: Tue Mar 12, 2019 7:27 pm
by Hazelnut
Generally if something is not exposed to mods and someone needs it for something, I or one of the other devs have done the work to expose it. That's how the formula can be overridden - it was requested and I implemented it.

I don't think I'd want to simply make it public in this case, but the bonusPool calculation could easily be moved into a formula that can be overridden by a mod. Unless anyone has objections to it...?

i think we're quite offtopic for this pinned thread so please post a request in work requests forum. :)

Re: Modding Tutorials

Posted: Tue Mar 12, 2019 8:01 pm
by mikeprichard
Thanks, Hazelnut! I just created a new topic for this in the Work Requests forum.

Re: Modding Tutorials

Posted: Thu Mar 14, 2019 10:39 pm
by mikeprichard
Looks like the Work Requests forum's been removed - my separate topic on this is now in the General forum (viewtopic.php?f=4&t=1893).

Re: Modding Tutorials

Posted: Sat Jun 15, 2019 4:18 am
by CHAPPJO
Edit: looks like this formula just wasn't implemented in the build I was testing with, it seems to work with the new one, I'll try releasing this soon.


Recently I wanted to have a go at modding something, and since no one seems to had made even a partial replacement mod for dfskills, I though I would have a go at it. Unfortunately I know very very little C#, and probably even less Unity. I basically "adapted" (copied) most of it from UserOfThisSite's 'consistent HP at level up' scripts he posted here. This is what I have so far, and it's not working.

Code: Select all

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using DaggerfallWorkshop.Game.Utility.ModSupport; // Do I need this?
using DaggerfallWorkshop.Game.Formulas; // I do need this right?

public class UpTo200Attributes : MonoBehaviour
{
    void Start()
    {
        FormulaHelper.formula_noparams.Add("MaxStatValue", () => // No idea how this part works, or how a dictionary works or whatever else...
           {
               return 200; // AFAIK this should return back into the del, which will then return as the max attribute value.
           });
    }
}
The script is call "UpTo200Attributes.cs". It tries to overwrite(?) the method in the "FormulaHelper.cs" file called "MaxStatValue" which looks like this:

Code: Select all

        public static int MaxStatValue()
        {
            Formula_NoParams del;
            if (formula_noparams.TryGetValue("MaxStatValue", out del))
                return del();
            else
                return 100;
        }
Both scripts are in the same folder.

One last thing; I was wondering if the bottom bit in UserOfThisSite's code, or something similar is required, I tried adding it in (with some changes), and it did nothing. However I probably messed something up, because I don't really know what any of it means. The code looks like this:

Code: Select all

[Invoke (StateManager.StateTypes.Game, 0)]
	public static void Init (InitParams initParams)
	{
		GameObject GO = new GameObject ("MaxHPperLevel");
		MaxHPperLevel go = GO.AddComponent<MaxHPperLevel> ();
		ModManager.Instance.GetMod (initParams.ModTitle).IsReady = true;
	}
Any help would be appreciated,

Re: Modding Tutorials

Posted: Fri Sep 13, 2019 7:01 pm
by Asesino
Hi,
I wanted to play around with Modding on Daggerfall Unity. I was able to create simple mod to increase my carry capacity.
Scripting works for me but adding assets does not.
To try to get a grasp of adding assets, I thought i would try to create a dfmod from Kamer's excellent mod: warm ashes.

Following the readme in Game/Mods, I did the following:

I created a folder in Assets/Game/Mods called WarmAshes. In WarmAshes, I created a folder called Assets, and then a folder in Assets called QuestPacks. Here I dropped the Kamer folder.
I then created my mod, and then clicked on each subfolder in Kamer, selected all and clicked "Add Selected Asset(s).

It created the dfmod correctly (i.e., no errors) but it doesn't work in game. What am I missing?

thanks in advance for any advice or help,
A

Re: Modding Tutorials

Posted: Fri Sep 13, 2019 8:20 pm
by TheLacus
Quests can only be automatically imported from loose files; you can manually register a quest pack with QuestListsManager.RegisterQuestList instead.

Re: Modding Tutorials

Posted: Fri Sep 13, 2019 8:46 pm
by Hazelnut
Have a read of viewtopic.php?f=22&t=901

Also, I suggest looking at the code of existing mods and figuring out how they work, experiment etc.

Re: Modding Tutorials

Posted: Fri Sep 13, 2019 9:17 pm
by Jay_H
There are some loose file mods that you could package up for practice. Mine is one I'd give permission to be zipped up into a dfmod: https://www.nexusmods.com/daggerfallunity/mods/3

Re: Modding Tutorials

Posted: Sat Sep 14, 2019 4:58 am
by Asesino
Thank you so much everyone. I was able to package other objects like textures. I truly appreciate all the quick responses.

Thanks all,
A