Modding Tutorials

Discuss modding questions and implementation details.
Post Reply
User avatar
mikeprichard
Posts: 737
Joined: Sun Feb 19, 2017 6:49 pm

Re: Modding Tutorials

Post by mikeprichard » Sat Mar 09, 2019 12:27 am

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.

User avatar
Hazelnut
Posts: 1709
Joined: Sat Aug 26, 2017 2:46 pm
Contact:

Re: Modding Tutorials

Post by Hazelnut » Tue Mar 12, 2019 7:27 pm

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

User avatar
mikeprichard
Posts: 737
Joined: Sun Feb 19, 2017 6:49 pm

Re: Modding Tutorials

Post by mikeprichard » Tue Mar 12, 2019 8:01 pm

Thanks, Hazelnut! I just created a new topic for this in the Work Requests forum.

User avatar
mikeprichard
Posts: 737
Joined: Sun Feb 19, 2017 6:49 pm

Re: Modding Tutorials

Post by mikeprichard » Thu Mar 14, 2019 10:39 pm

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

CHAPPJO
Posts: 38
Joined: Fri Sep 22, 2017 12:54 am

Re: Modding Tutorials

Post by CHAPPJO » Sat Jun 15, 2019 4:18 am

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,

Asesino
Posts: 11
Joined: Fri Aug 16, 2019 3:14 am

Re: Modding Tutorials

Post by Asesino » Fri Sep 13, 2019 7:01 pm

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

User avatar
TheLacus
Posts: 983
Joined: Wed Sep 14, 2016 6:22 pm
Contact:

Re: Modding Tutorials

Post by TheLacus » Fri Sep 13, 2019 8:20 pm

Quests can only be automatically imported from loose files; you can manually register a quest pack with QuestListsManager.RegisterQuestList instead.
Mod System documentation - Learn how to create mods for Daggerfall Unity.
Modder Discussion - General help and discussion for the mod system.
Github Issues - Submit a bug report for the game, including the mod system.

User avatar
Hazelnut
Posts: 1709
Joined: Sat Aug 26, 2017 2:46 pm
Contact:

Re: Modding Tutorials

Post by Hazelnut » Fri Sep 13, 2019 8:46 pm

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.

User avatar
Jay_H
Posts: 2909
Joined: Tue Aug 25, 2015 1:54 am

Re: Modding Tutorials

Post by Jay_H » Fri Sep 13, 2019 9:17 pm

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

Asesino
Posts: 11
Joined: Fri Aug 16, 2019 3:14 am

Re: Modding Tutorials

Post by Asesino » Sat Sep 14, 2019 4:58 am

Thank you so much everyone. I was able to package other objects like textures. I truly appreciate all the quick responses.

Thanks all,
A

Post Reply