Can We Use Struct class?

Discuss modding questions and implementation details.
User avatar
XJDHDR
Posts: 258
Joined: Thu Jan 10, 2019 5:15 pm
Location: New Zealand
Contact:

Re: Can We Use Struct class?

Post by XJDHDR »

DunnyOfPenwick wrote: Thu May 20, 2021 3:08 pm Speaking of versions, what is the technical reason that we have to use Unity 2019.4.10?
As an experiment, I tried upgrading DFU to a 2020 version of Unity. For reasons I wasn't able to figure out, mods didn't work with this version. The game knew where the modded files were but when it tried to load them, the game claimed that the files didn't exist, even though they did.

Besides this, I think the reason is just because Interkarma wants to keep this project stable.

l3lessed
Posts: 1399
Joined: Mon Aug 12, 2019 4:32 pm
Contact:

Re: Can We Use Struct class?

Post by l3lessed »

Good luck. I was just trying to say all I thought was needed was to check the pre-compile option on mod builder screen.. but I guess there's something more for what you're doing. Looking forward to trying this out. :)
That would be nice, but it isn't. You need to create the dll compilers completely separately in a stand alone VS 2019 project, so any c# class having issue within the DF mod compiler can be compiled separately into its own DLL and loaded that way bypassing the mod compilers and any issues it has with certain c# classes.
My Daggerfall Mod Github: l3lessed DFU Mod Github

My Beth Mods: l3lessed Nexus Page

Daggerfall Unity mods: Combat Overhaul Mod

Enjoy the free work I'm doing? Consider lending your support.

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

Re: Can We Use Struct class?

Post by Hazelnut »

l3lessed wrote: Thu May 20, 2021 5:58 pm
Good luck. I was just trying to say all I thought was needed was to check the pre-compile option on mod builder screen.. but I guess there's something more for what you're doing. Looking forward to trying this out. :)
That would be nice, but it isn't. You need to create the dll compilers completely separately in a stand alone VS 2019 project, so any c# class having issue within the DF mod compiler can be compiled separately into its own DLL and loaded that way bypassing the mod compilers and any issues it has with certain c# classes.
Are you absolutely sure about that? I mean I may have misunderstood, but when TheLacus added the pre-compile option to the mod builder it was precicely to avoid the DF mod compiler (MCS) and all the issues that came with it. I helped test it. The final push to do this was that some mods simply had too much token logic for the internal buffers of the mcs compiler.

TheLacus is the expert and added that option which is still marked experimental but I know of several mods that use this to have a DLL created and bypassing the MCS compiler issues. Maybe there really is something in your mod which wont work, but I just want to be sure I am clear about what it is I am referring to just in case it saves you time and heartburn, because it feels like you don't know this option I am referring to and what it does.
See my mod code for examples of how to change various aspects of DFU: https://github.com/ajrb/dfunity-mods

l3lessed
Posts: 1399
Joined: Mon Aug 12, 2019 4:32 pm
Contact:

Re: Can We Use Struct class?

Post by l3lessed »

Maybe I'm missing where the dll is being compiled like a totally idiot, and just wasted a whole day.

When I compile, I do not see a dll being output anywhere.
My Daggerfall Mod Github: l3lessed DFU Mod Github

My Beth Mods: l3lessed Nexus Page

Daggerfall Unity mods: Combat Overhaul Mod

Enjoy the free work I'm doing? Consider lending your support.

l3lessed
Posts: 1399
Joined: Mon Aug 12, 2019 4:32 pm
Contact:

Re: Can We Use Struct class?

Post by l3lessed »

I think I was being an idiot and overlooking something. I don't know what to be honest. My last issue is I can't seem to import a straight material using getasset.

Does a material need attached to a prefabbed object for getasset to grab it through the prefab.
My Daggerfall Mod Github: l3lessed DFU Mod Github

My Beth Mods: l3lessed Nexus Page

Daggerfall Unity mods: Combat Overhaul Mod

Enjoy the free work I'm doing? Consider lending your support.

l3lessed
Posts: 1399
Joined: Mon Aug 12, 2019 4:32 pm
Contact:

Re: Can We Use Struct class?

Post by l3lessed »

Well, I give up. Time to move my enum over to a int array.

When I compile using precompile, I get these errors because my mod is requiring these script files as depencies.

error CS2001: Source file 'F:\Games\daggerfall-unity-master Newest\Assets\s\com.unity.ugui\Runtime\UI\Core\Layout\CanvasScaler.cs' could not be found.
error CS2001: Source file 'F:\Games\daggerfall-unity-master Newest\Assets\s\com.unity.ugui\Runtime\UI\Core\Mask.cs' could not be found.
error CS2001: Source file 'F:\Games\daggerfall-unity-master Newest\Assets\s\com.unity.ugui\Runtime\UI\Core\RawImage.cs' could not be found.
error CS2001: Source file 'F:\Games\daggerfall-unity-master Newest\Assets\s\com.unity.ugui\Runtime\UI\Core\GraphicRaycaster.cs' could not be found.

I think this my be causing the material load issue? I loaded a game object with my attached materials and pulled it from the prefabbed object to ensure getasset wasn't having issues. Still, it says it can't find/load my material.

Yeah. this is a bigger problem than I thought. I'm using dependencies I don't think I should. I'm getting this error now about an enum I haven't even contrsucted.
Failed to seek mod loader on Minimap: Field 'm_UiScaleMode' is an enum type with a bad underlying type
My Daggerfall Mod Github: l3lessed DFU Mod Github

My Beth Mods: l3lessed Nexus Page

Daggerfall Unity mods: Combat Overhaul Mod

Enjoy the free work I'm doing? Consider lending your support.

l3lessed
Posts: 1399
Joined: Mon Aug 12, 2019 4:32 pm
Contact:

Re: Can We Use Struct class?

Post by l3lessed »

Found the prefabbed object requiring this;
error CS2001: Source file 'F:\Games\daggerfall-unity-master Newest\Assets\s\com.unity.ugui\Runtime\UI\Core\Layout\CanvasScaler.cs' could not be found.
error CS2001: Source file 'F:\Games\daggerfall-unity-master Newest\Assets\s\com.unity.ugui\Runtime\UI\Core\Mask.cs' could not be found.
error CS2001: Source file 'F:\Games\daggerfall-unity-master Newest\Assets\s\com.unity.ugui\Runtime\UI\Core\RawImage.cs' could not be found.
error CS2001: Source file 'F:\Games\daggerfall-unity-master Newest\Assets\s\com.unity.ugui\Runtime\UI\Core\GraphicRaycaster.cs' could not be found.
It is the canvas object that holds all the mask layers. I'll have to hand construct the canvas object and manually attach the mask layers at runtime through unity script code.

Do not try and use a canvas as a prefab.
My Daggerfall Mod Github: l3lessed DFU Mod Github

My Beth Mods: l3lessed Nexus Page

Daggerfall Unity mods: Combat Overhaul Mod

Enjoy the free work I'm doing? Consider lending your support.

Post Reply