Modding Tutorials
-
- Posts: 833
- Joined: Mon Nov 30, 2015 6:32 pm
Re: Modding Tutorials
How do you load a multiple-choice value from a ModSettings object?
Previous experience tells me it's very easy to misunderstand the tone, intent, or meaning of what I've posted. If you have questions, ask.
- BadLuckBurt
- Posts: 948
- Joined: Sun Nov 05, 2017 8:30 pm
Re: Modding Tutorials
https://www.dfworkshop.net/projects/dag ... /features/Narf the Mouse wrote: ↑Sat Nov 09, 2019 12:39 pm How do you load a multiple-choice value from a ModSettings object?
Going by the example on that Features page, it should be something like:
Code: Select all
var settings = mod.GetSettings();
int number = settings.GetValue<int>("section", "multipleChoiceField");
DFU on UESP: https://en.uesp.net/w/index.php?title=T ... fall_Unity
DFU Nexus Mods: https://www.nexusmods.com/daggerfallunity
My github repositories with mostly DFU related stuff: https://github.com/BadLuckBurt
.
DFU Nexus Mods: https://www.nexusmods.com/daggerfallunity
My github repositories with mostly DFU related stuff: https://github.com/BadLuckBurt
.
-
- Posts: 833
- Joined: Mon Nov 30, 2015 6:32 pm
Re: Modding Tutorials
GetInt() crashes the Unity editor when I try.
...Or maybe it's something else. Something is crashing the Unity editor.
...Or maybe it's something else. Something is crashing the Unity editor.
Previous experience tells me it's very easy to misunderstand the tone, intent, or meaning of what I've posted. If you have questions, ask.
- BadLuckBurt
- Posts: 948
- Joined: Sun Nov 05, 2017 8:30 pm
Re: Modding Tutorials
It's .GetValue<int>, not GetInt(). Check Unity's log or post the lines of code and I may be able to figure it out.Narf the Mouse wrote: ↑Sat Nov 09, 2019 12:59 pm GetInt() crashes the Unity editor when I try.
...Or maybe it's something else. Something is crashing the Unity editor.
DFU on UESP: https://en.uesp.net/w/index.php?title=T ... fall_Unity
DFU Nexus Mods: https://www.nexusmods.com/daggerfallunity
My github repositories with mostly DFU related stuff: https://github.com/BadLuckBurt
.
DFU Nexus Mods: https://www.nexusmods.com/daggerfallunity
My github repositories with mostly DFU related stuff: https://github.com/BadLuckBurt
.
- TheLacus
- Posts: 1305
- Joined: Wed Sep 14, 2016 6:22 pm
Re: Modding Tutorials
Daggerfall Tools for Unity is what connects the game to classic data. You need to clone Daggerfall Unity to have all the modding tools inside the Unity Editor.septua77 wrote: ↑Sun Nov 03, 2019 10:51 pm 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.
This is not possible (because C# is a compiled language) and also not ideal because two mods that change the same file would be incompatible. See the tutorials on the first page of this topic for some examples of how to make a mod.IAmTheClayman wrote: ↑Fri Nov 08, 2019 12:44 am How would you go about making changes to an existing script in DFU? For example, right now HUDVitals.cs has the following code:
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?Code: Select all
public HUDVitals() :base() { playerEntity = GameManager.Instance.PlayerEntity; LoadAssets(); BackgroundColor = Color.clear; HorizontalAlignment = HorizontalAlignment.Left; VerticalAlignment = VerticalAlignment.Bottom; SetMargins(Margins.All, borderSize); ...
-
- Posts: 833
- Joined: Mon Nov 30, 2015 6:32 pm
Re: Modding Tutorials
Thanks.BadLuckBurt wrote: ↑Sat Nov 09, 2019 1:04 pmIt's .GetValue<int>, not GetInt(). Check Unity's log or post the lines of code and I may be able to figure it out.Narf the Mouse wrote: ↑Sat Nov 09, 2019 12:59 pm GetInt() crashes the Unity editor when I try.
...Or maybe it's something else. Something is crashing the Unity editor.
Right now, it's crashing on this:
Code: Select all
[Invoke(StateManager.StateTypes.Game, 0)]
public static void Init(InitParams initParams)
{
Debug.Log("magicka regeneration init");
mod = initParams.Mod;
mod.IsReady = true;
}
Previous experience tells me it's very easy to misunderstand the tone, intent, or meaning of what I've posted. If you have questions, ask.
- BadLuckBurt
- Posts: 948
- Joined: Sun Nov 05, 2017 8:30 pm
Re: Modding Tutorials
Are there any error messages in Unity's log or the console? I haven't made a mod myself but looking at the example code on the Mod Features page I linked, aren't you doingNarf the Mouse wrote: ↑Sat Nov 09, 2019 1:13 pm Thanks.
Right now, it's crashing on this:If you can solve that, I'd love to hear it.Code: Select all
[Invoke(StateManager.StateTypes.Game, 0)] public static void Init(InitParams initParams) { Debug.Log("magicka regeneration init"); mod = initParams.Mod; mod.IsReady = true; }
Code: Select all
mod.IsReady = true;
DFU on UESP: https://en.uesp.net/w/index.php?title=T ... fall_Unity
DFU Nexus Mods: https://www.nexusmods.com/daggerfallunity
My github repositories with mostly DFU related stuff: https://github.com/BadLuckBurt
.
DFU Nexus Mods: https://www.nexusmods.com/daggerfallunity
My github repositories with mostly DFU related stuff: https://github.com/BadLuckBurt
.
-
- Posts: 833
- Joined: Mon Nov 30, 2015 6:32 pm
Re: Modding Tutorials
There might be messages in the Unity console, but the editor crashes. As for Unity's log... This is the top of the crash dump:BadLuckBurt wrote: ↑Sat Nov 09, 2019 1:27 pmAre there any error messages in Unity's log or the console? I haven't made a mod myself but looking at the example code on the Mod Features page I linked, aren't you doingNarf the Mouse wrote: ↑Sat Nov 09, 2019 1:13 pm Thanks.
Right now, it's crashing on this:If you can solve that, I'd love to hear it.Code: Select all
[Invoke(StateManager.StateTypes.Game, 0)] public static void Init(InitParams initParams) { Debug.Log("magicka regeneration init"); mod = initParams.Mod; mod.IsReady = true; }
too early? In the example that's done in void Awake()Code: Select all
mod.IsReady = true;
0x00007FFC1C287985 (mono) [c:\buildslave\mono\build\mono\metadata\object.c:683] compute_class_bitmap
And this seems to be the source:
(Filename: Assets/Game/Addons/ModSupport/Mod.cs Line: 922)
As for too early, the position of mod.IsReady does not seem to have any effect.
Previous experience tells me it's very easy to misunderstand the tone, intent, or meaning of what I've posted. If you have questions, ask.
- BadLuckBurt
- Posts: 948
- Joined: Sun Nov 05, 2017 8:30 pm
Re: Modding Tutorials
Are you on Discord? It might be easier to have a quick back-and-forth there, otherwise this thread is gonna balloon out of control. If we figure out what the problem is, we can always post the solution here.Narf the Mouse wrote: ↑Sat Nov 09, 2019 1:44 pm There might be messages in the Unity console, but the editor crashes. As for Unity's log... This is the top of the crash dump:
0x00007FFC1C287985 (mono) [c:\buildslave\mono\build\mono\metadata\object.c:683] compute_class_bitmap
And this seems to be the source:
(Filename: Assets/Game/Addons/ModSupport/Mod.cs Line: 922)
As for too early, the position of mod.IsReady does not seem to have any effect.
I can't really say that much with the info so far. The code on that line is a simple return false; I have some stuff to do but should be back in 30 mins.
DFU on UESP: https://en.uesp.net/w/index.php?title=T ... fall_Unity
DFU Nexus Mods: https://www.nexusmods.com/daggerfallunity
My github repositories with mostly DFU related stuff: https://github.com/BadLuckBurt
.
DFU Nexus Mods: https://www.nexusmods.com/daggerfallunity
My github repositories with mostly DFU related stuff: https://github.com/BadLuckBurt
.
-
- Posts: 833
- Joined: Mon Nov 30, 2015 6:32 pm
Re: Modding Tutorials
Thanks for all your help. However, I did "git checkout ." to fix it. It really seemed borked, and I decided to just give up.BadLuckBurt wrote: ↑Sat Nov 09, 2019 1:50 pmAre you on Discord? It might be easier to have a quick back-and-forth there, otherwise this thread is gonna balloon out of control. If we figure out what the problem is, we can always post the solution here.Narf the Mouse wrote: ↑Sat Nov 09, 2019 1:44 pm There might be messages in the Unity console, but the editor crashes. As for Unity's log... This is the top of the crash dump:
0x00007FFC1C287985 (mono) [c:\buildslave\mono\build\mono\metadata\object.c:683] compute_class_bitmap
And this seems to be the source:
(Filename: Assets/Game/Addons/ModSupport/Mod.cs Line: 922)
As for too early, the position of mod.IsReady does not seem to have any effect.
I can't really say that much with the info so far. The code on that line is a simple return false; I have some stuff to do but should be back in 30 mins.
Edit: I should clarify. I haven't given up on the mod.
Previous experience tells me it's very easy to misunderstand the tone, intent, or meaning of what I've posted. If you have questions, ask.