Page 1 of 5

Upgrading Mods to 0.10.25 and Later

Posted: Thu Jul 16, 2020 10:38 pm
by Interkarma
Hello Modding Community!

I didn't communicate this very well earlier. The recent 0.10.25 release carries the upgrade to Unity 2019.4.2f1 LTS. This will be the last major engine upgrade for at least 2 years. This will be the baseline engine version from now through to 1.0 and foreseeable future.

To prepare your mods for 0.10.25 and later, you will need to setup the following:
  • Unity 2019.4.2f1 (specifically this version).
  • Clone the 0.10.25a code (or whatever version you're building for) using the tagged release for that build. I recommend always building mods against tagged release, as master will tend to be somewhat ahead of the current release and may have breaking changes.
  • Look for and resolve any errors in editor.
  • Finally, rebuild your mods in Unity 2019.4.2f1 against 0.10.25 code and test mod against live builds before releasing.
Many mods built under 2018.2.21f1 will continue to function in 0.10.25, but there could be compatibility issues depending on the mod. I've made a change to the Live Builds page to help differentiate releases like 0.10.25 as preview builds, with 0.10.24 being the last stable build for next few months.

There will be another change coming up in 0.10.26 related to Localization features. To start with, all text from HardString.cs will be migrated to Localization. The CSV text tables will be migrated in future. If you have any touch on the strings in HardStrings.cs or CSV text tables, please keep your master build up to date as well and be ready to change the way these strings are accessed. I'll cover this more once 0.10.26 is closer to completion. Reserving a couple of replies below for this purpose later.

Re: Upgrading Mods to 0.10.25 and Later

Posted: Thu Jul 16, 2020 10:38 pm
by Interkarma
Some common/known issues you might encounter after upgrading:
  • There appears to be an issue with building to Linux targets. Most likely related to deprecation of StandaloneLinux and StandaloneLinuxUniversal build targets. Only StandaloneLinux64 is a supported build target in Unity 2019.4. We are investigating issue in mod builder and will fix as soon as possible. Edit: Building to Linux appears to be OK based on reports from multiple other modders. Will continue monitoring.
  • Any mods using custom Func delegate with more than 4 targets will need to check operation of these methods. Now the core is on .NET 4.0, Scripts/External/Func.cs has been removed. Any prior mod builds targeting this custom Func delegate need to be rebuilt for 0.10.25a and later.
I will add to this list as anything comes up.

Re: Upgrading Mods to 0.10.25 and Later

Posted: Thu Jul 16, 2020 10:39 pm
by Interkarma
Please also note the following limitations with portable compiler.

Can't define enums in mods
TheLacus wrote: Sat Jul 18, 2020 12:57 am It's not possible to define enums inside mod scripts. This is a known limitation that has always been there.

Use constants instead. You can make a static class containing only constants to partially emulate an enum.

Can't use declaration expressions
TheLacus wrote: Fri Jul 17, 2020 4:38 pm Found a new limitation of portable compiler. Unity Editor doesn't show any issue with declaration expressions and Visual Studio 2019 even suggests the refactoring:

Code: Select all

int value;
if (dict.TryGetValue(value, out value))

Code: Select all

if (dict.TryGetValue(value, out int value))
The portable compiler, however, states that this feature is not available in C# 6 (which is actually true).

Can't use enum values as default
The below signature will throw an error due to WindowModes windowMode = WindowModes.Sell.

Code: Select all

public MyTradeWindowClass(IUserInterfaceManager uiManager, DaggerfallBaseWindow previous = null, WindowModes windowMode = WindowModes.Sell, IGuild guild = null)
The following will not with default value removed. Workaround is to overload constructors and pass values without being defaults.

Code: Select all

public MyWindowClass(IUserInterfaceManager uiManager, DaggerfallBaseWindow previous, WindowModes windowMode, IGuild guild = null)

Re: Upgrading Mods to 0.10.25 and Later

Posted: Fri Jul 17, 2020 2:19 am
by Interkarma
Reserved.

Re: Upgrading Mods to 0.10.25 and Later

Posted: Fri Jul 17, 2020 4:00 pm
by Magicono43
Interkarma wrote: Thu Jul 16, 2020 10:38 pm Some common/known issues you might encounter after upgrading:
  • Any mods using custom Func delegate with more than 4 targets will need to check operation of these methods. Now the core is on .NET 4.0, Scripts/External/Func.cs has been removed.
So does this mean that a few of the "FormulaHelper.cs" Delegates will need to be rewritten? There are a few that have at least 5 targets, and now that I got my 2019 Unity environment set up and opened some of these in VS it is showing warnings involving what you mentioned. Also due to this, many overrides obviously overriding the same methods are getting the same error due to the 4+ delegate targets.

Re: Upgrading Mods to 0.10.25 and Later

Posted: Fri Jul 17, 2020 8:40 pm
by Interkarma
The Func delegate for >4 arguments is now part of .NET 4.x. The custom Func delegate we used earlier is no longer required and has been removed.

Now I see a mistake on my end - the tagged 0.10.25 commit is 244b7a3, and Func was removed in the commit immediately after that one cbcbf58. This should have been the tagged release commit and used for builds, not 244b7a3. Yeah, that could definitely cause some problems.

I'll reissue 0.10.25 builds (as 0.10.25a) and fix tag.

Edit: I've updated tagged releases with v0.10.25a-alpha. This tag is now correctly after the custom Func delegate was removed and you will not see those warnings in editor. Matching builds are cooking now and will be up in another hour. This build is still internally versioned as 0.10.25, but will have the display name "0.10.25a" on live builds page when ready. This should be the build you test against moving forwards. Users will need to re-download 0.10.25a.

Edit2: 0.10.25a builds are available now. Please grab the tagged code and rebuild mods against this code, then test in matching 0.10.25a live builds. Hopefully that solves the problems of built mods working in editor but not in live builds.

Re: Upgrading Mods to 0.10.25 and Later

Posted: Fri Jul 17, 2020 10:37 pm
by Magicono43
So I just downloaded the 0.10.25a build and put it in my Unity environment, I have not built any of the mods having issues yet, but I did notice that in "FormulaHelper.cs" those warnings for the Funcs are still showing up, as well as for mods overriding said methods. This time it gives a "Potential Fixes" option in FormulaHelper saying to "Inline Variable Declaration".

Here are some screen-shots to show what it looks like:
Untitled111.png
Untitled111.png (89.27 KiB) Viewed 2533 times

Untitled222.png
Untitled222.png (97.49 KiB) Viewed 2533 times
I'm not really sure if in this case the "warnings" would cause any problems in actual execution, but just as a note that those Func lines are apparently considered redundant, but like I said, not sure if having them still exist will cause any problems.

I'm now going to try and rebuild my mod that was having issues in it's compiled form in this 0.10.25a version and see if anything changed, thanks.

Re: Upgrading Mods to 0.10.25 and Later

Posted: Fri Jul 17, 2020 10:59 pm
by Magicono43
I think you forgot to change the name of the version.
Untitled11.png
Untitled11.png (699.17 KiB) Viewed 2529 times
This is from the 0.10.25a release

Re: Upgrading Mods to 0.10.25 and Later

Posted: Fri Jul 17, 2020 11:09 pm
by Magicono43
Also just as a note, the mod that I was talking about working in a virtual form and not in a "live" built form is still not working in its compiled form, showing the same error, unfortunately. But maybe some other mods were helped by this, like Ralzar, but i'd have to see from them first if that's the case or not.

Re: Upgrading Mods to 0.10.25 and Later

Posted: Fri Jul 17, 2020 11:28 pm
by Interkarma
Those Func warning do not appear when downloading from latest tag. I just downloaded and confirmed again then. Please double-check you're using the correct version. If you have the correct code, Func.cs will be nowhere in your project. You can ignore the editor style change to inline.

I did not forget to change the version, I mention this above:
This build is still internally versioned as 0.10.25, but will have the display name "0.10.25a" on live builds page when ready.
For your specific error, it sounds like something else is happening. :(