Search Unity

[Released] uMod 2.0 - Modding support made easy!

Discussion in 'Assets and Asset Store' started by scottyboy805, Jan 6, 2017.

  1. scottyboy805

    scottyboy805

    Joined:
    Apr 10, 2013
    Posts:
    654
    Ok good to hear that the first issue is sorted.

    When using interface assmblies it is important to make sure that all interface assemblies are also included in the game project as well as the mod project. Is this the case?
     
  2. fup

    fup

    Joined:
    Jan 18, 2016
    Posts:
    76
    Ah! That works. :) Thanks.
     
  3. scottyboy805

    scottyboy805

    Joined:
    Apr 10, 2013
    Posts:
    654
    No problem. Let me know if there is anything else.
     
  4. Rotary-Heart

    Rotary-Heart

    Joined:
    Dec 18, 2012
    Posts:
    522
    Are there plans for a better selection method in the ModToolsBuilder? I wish we could have the same tree logic that we have with the asset importer window. This way it's easier to hide/show folders, select all inside a folder and more. Right now is a little to hard to use since it's super easy to miss a file.

    upload_2020-1-12_21-51-2.png
    upload_2020-1-12_21-51-19.png
     
  5. scottyboy805

    scottyboy805

    Joined:
    Apr 10, 2013
    Posts:
    654
    Hi,
    Yes this is certainly something we could do. I am not sure why we did not take that approach to start with because it is clearly much easier to use and view. We are working on some other features and assets at the moment but we will add this as soon as we have chance.
     
    Rotary-Heart likes this.
  6. scottyboy805

    scottyboy805

    Joined:
    Apr 10, 2013
    Posts:
    654
    uMod 2.6.0 has been submitted to the asset store and will be avaliable for download shortly. This update adds a new feature - The moddable content system. This system allows you to make certain Unity components such as Renderers and Mesh Filters be auto moddable meaning that modders can create new materials, textures, Meshes or other asset types to replace the content of a specific component. Essentially you will add a 'ModdableContent' component to a scene or prefab object and assign a target component. This will generate a moddable asset naming scheme for the object in the uMod settings which will contain a relative file path for the corrosponding asset type. You can then create a mod which contains an matching asset at that file path (Relative to the mod export folder) and the content will be automatically loaded, replaced and managed when the mod is loaded.

    moddablecontent.png
     
    vestigial likes this.
  7. vestigial

    vestigial

    Joined:
    May 9, 2015
    Posts:
    141
    A few updates ago it was added to let you populate the included content programatically instead of going through the GUI
     
  8. scottyboy805

    scottyboy805

    Joined:
    Apr 10, 2013
    Posts:
    654
    uMod version 2.6.1 has been submitted to the asset store. This version now uses a hierarchy structure to display file and folder content in the mod tools builder window as requested by @Rotary-Heart and others.

    ModToolsContentWindowChanges.png
     
    vestigial and Rotary-Heart like this.
  9. fup

    fup

    Joined:
    Jan 18, 2016
    Posts:
    76
    Hi, I grabbed 2.6.1 but the Mod Tools Builder starts throwing errors when 'Content' is clicked. It is possible to keep going, and get to 'Export' but there is no button to export. There are lots of errors in the console.

    Same behavior on two different machines.
     
  10. fup

    fup

    Joined:
    Jan 18, 2016
    Posts:
    76
  11. scottyboy805

    scottyboy805

    Joined:
    Apr 10, 2013
    Posts:
    654
  12. fup

    fup

    Joined:
    Jan 18, 2016
    Posts:
    76
    yes. Attached is the manifest
     

    Attached Files:

  13. scottyboy805

    scottyboy805

    Joined:
    Apr 10, 2013
    Posts:
    654
    Ok thanks, I pm’ed you a possible solution.
     
  14. scottyboy805

    scottyboy805

    Joined:
    Apr 10, 2013
    Posts:
    654
    uMod 2.6.2 has been submitted to the asset store. This fixes a bug in the mod tools builder window reproted by a few users where package assets could cause exceptions resulting in the UI to not being displayed correctly and export not being possible. We have also optimzed the load time of the content page as it could become very slow on larger projects.
     
    Last edited: Feb 9, 2020
  15. CircuitLord

    CircuitLord

    Joined:
    Dec 15, 2016
    Posts:
    4
    Hello!

    UMod is working great for me so far. I do have one small issue that I've still been poking around to see if there's a way to fix this.

    I'm including some assemblies/scripts in my mod tools, and whenever a mod uses those scripts, and say there's like a
    Code (CSharp):
    1. [SerializeField] private bool testingBool = false;
    If I use that script on an object, and in the inspector set the value to true, then when I load the mod in the main game, this value is not saved, and will always be false. Other stuff, like references to scripts/components in the scene, saves fine, but not with things like that, such as bool and string values.

    Is this just not really possible? It's not super needed for what I'm doing, but it'd be a really nice to have thing for making mods.

    Thanks!
     
  16. scottyboy805

    scottyboy805

    Joined:
    Apr 10, 2013
    Posts:
    654
    Hi, Public and serialize fields are fully supported and the inspector values should be saved when building a mod. Which Unity version are you using? We just tested this in 2018.1 and all inspector values were saved and loaded correctly with the expected values (We tested a number of primitive types like string, bool, int etc). Are you getting any errors or warnings when building or loading the mod related to link issues? You may need to enable full logging in the loading project to see these warnings by going to 'Tools -> uMod 2.0 -> Settings' and setting 'LogLevel' to 'All'.
     
  17. CircuitLord

    CircuitLord

    Joined:
    Dec 15, 2016
    Posts:
    4

    Okay, I think I sort of narrowed down the issue.

    For reference, I'm using Unity 2019.3.
    And, I've seen no errors when building, but I think I found the issue.

    Images: https://imgur.com/a/GpYKJH8

    Long story short, I have a DLL Interface that has a lot of the core classes of my game, so that devs can easily access them and inherit from them if needed. The problem seems to be that any scripts in the mod project that either are or inherit from classes in my DLL Interface will reset their values to the default of the script and ignore any inspector changes.

    However, any just random scripts I have on the object that aren't from my DLL interface or inheriting from it, (like the Test script in that picture) will save any changed inspector values fine. So maybe the problem has something to do with using the DLL interface?

    Let me know if there's anything else I can test to help :)
     
  18. scottyboy805

    scottyboy805

    Joined:
    Apr 10, 2013
    Posts:
    654
    Thanks for the detailed response.
    Ofcourse we tested with a compiled script so did not reproduce the problem. It does indeed look like a bug relating to pre-compiled assemblies so we will look into that as soon as possible and get it fixed.
     
  19. scottyboy805

    scottyboy805

    Joined:
    Apr 10, 2013
    Posts:
    654
    We may need a bit more information to reproduce this because after our initial testing everything seems to be deserialized correctly, even on a type that is defined in an interface assembly.
    1. I assume that your interface assembly is not built into the mod? IE. the interface assembly is located outside of the mod export folder and is also present in your game project?
    2. Are you inheriting from a type in the interface assembly or using the type directly as a script component?
     
  20. CircuitLord

    CircuitLord

    Joined:
    Dec 15, 2016
    Posts:
    4
    1. Yes, the assembly is a separate dll file with some of my classes in it, and it's included in both the main game project and in the mod project. I just used the content export thingy in the Mod Tools Builder from my main game, and included the dll file in the mod tools that way.

    2. I'm doing both, actually. The first script is directly from the assembly, and the second one is inheriting from a class in it.

    I'm gonna try to do a bit more testing with it to see if I can narrow down the issue, I'll let you know if I find anything.
     
  21. scottyboy805

    scottyboy805

    Joined:
    Apr 10, 2013
    Posts:
    654
    We have submitted a new Add-On asset for uMod 2.0 to the asset store. The uMod 2.0 Runtime Compiler Add-On will allow you to compile C# source code at runtime using the Roslyn compiler. As you may have guessed, this asset takes the features of our Roslyn C# asset and integrates them seamlessly with uMod 2.0. This means that you can now compile and load C# source code into a uMod script domain to allow you even more modding capabilities.
    CoverKeyImage.png
    If you have already purchased our Rolsyn C# asset as well as uMod 2.0 then we did intend to setup a free upgrade path. At the moment this is not possible due to a Unity requirement that our Roslyn C# asset should be live for atleast 1 year before we can setup upgrades, which it has not been. As a result we cannot offer a free automatic update at the moment but will in the future. We can however offer free upgrade vouchers to the first 12 exsiting customers that request a voucher from us.

    To request a voucher simply follow these steps:
    1. Locate your invoice numbers for uMod 2.0 and Roslyn C# assets.
    2. Send us an email to info(at)trivialinteractive.co.uk including these invoice numbers and stating that you would like to receive a free upgrade voucher.
    3. We will get back to you as soon as possible with your free voucher code if they have not already been taken.
    We expect the asset to go live within 2-3 weeks depending upon asset approval time.
     
    vestigial and Rotary-Heart like this.
  22. CircuitLord

    CircuitLord

    Joined:
    Dec 15, 2016
    Posts:
    4
    Okay, I think I've sort of figured out the problem, but it's still really inconsistent so I'm not sure.

    It seems like, if I have a script that inherits from something in my DLL Interface, and then that script has a SerializedField wanting another class that's in the DLL Interface, then none of the inspector values on the script will save. As soon as I remove that serialized field wanting that other class, then all the other properties work fine again and save their inspector values.

    Again, I'm not really sure if this is exactly what's happening, but it seems to be that way at the moment. Hopefully that helps somewhat?

    I've sort of gotten around the issue for now by just removing the SerializedField and doing a GetComponent<> on the object I was trying to get the script reference from.

    Thanks!
     
  23. scottyboy805

    scottyboy805

    Joined:
    Apr 10, 2013
    Posts:
    654
    Thanks for the extra info. We will keep working to reproduce the problem and let you know when we have made any progress.
     
  24. scottyboy805

    scottyboy805

    Joined:
    Apr 10, 2013
    Posts:
    654
    Hi again,
    We still seem to be having difficulty reproducing this problem. We have tested behaviour scripts that inherit from and declare types defined in the interface assembly and all fields (Primitive and reference) are deserialized correctly. We have tested in 2018.1.0, 2019.1.0 and 2019.3.0 but still no joy reproducing the problem. The only time we could come close to replicating this behaviour was by declaring a new class in the interface assembly and building a mod that referenced this type. Then in the game project don't update the interface assembly and we end up with a mod linker error with a TypeLoad exception which is to be expected. In this case the desired script is not attached to the mod object when the scene loads because the type was not found so it is not the same problem that you face.

    Would it be possible for you to send us the built mod (.umod file) and the interface assembly you are using to info(at)trivialinteractive.co.uk so we can look into this further. We are out of ideas on how to continue testing at this point.
     
  25. scottyboy805

    scottyboy805

    Joined:
    Apr 10, 2013
    Posts:
    654
    uMod 2.6.3 has been submitted to the asset store and fixes a bug introduced in the last update where many 'Find' type methods of the 'ScriptAssembly' type would incorrectly return null or an empty array.
     
    vestigial likes this.
  26. vestigial

    vestigial

    Joined:
    May 9, 2015
    Posts:
    141
    scottyboy805 likes this.
  27. vestigial

    vestigial

    Joined:
    May 9, 2015
    Posts:
    141
    I'd like to share my code and some things I've figured out for getting ECS to work through UMod. Like the manual says, the biggest problem is getting our mods loaded before TypeManager.Initialize() is called. Unfortunately my experimenting with UNITY_DISABLE_AUTOMATIC_SYSTEM_BOOTSTRAP didn't work out, because even if we take control of the world generation process, AttachToEntityClonerInjection will still trigger it. So we are stuck with using RuntimeInitializeOnLoadMethod to call up our mod loading, which might not be ideal. There is also some Editor-specific workarounds necesesary by injecting the types into the TypeManager.

    The example script also shows how to instantiate our mod-defined systems, and hook them up to have their OnUpdate() called. As well as finding out which ComponentUpdateGroup the system wants to belong to, and placing it in there.

    The one thing I can't show in the script though, is a workaround for exporting [GenerateAuthoringComponent] and Entities.ForEach-to-Job code generation stuff. Basically, its possible, if you put your [GenerateAuthoringComponent] types in a separate project, then copy the dll from MyExternalProject/Library/ScriptAssemblies/MyStuff.dll into your ModProject/Assets/MyMod. In this way, the Unity EntitiesILPostProcessor in the exterior project will generate the authoring component type into the dll, and after the DLL gets copied into the mod project, UMod will then pick up the DLL during mod export. The same thing works for IJobs that get created from Entities.ForEach lambda. EDIT: it can be done to have the types in the same project as the mod export, no need for a second project, just that there needs to be an additional script of some kind in the mod folder, alongside the DLL pulled in from /Library/ScriptAssemblies (need to use an assembly definition file to collect your ECS types into one DLL).

    So if anyone else is doing ECS, hopefully this helps!
     

    Attached Files:

    Last edited: Mar 5, 2020
    scottyboy805 likes this.
  28. scottyboy805

    scottyboy805

    Joined:
    Apr 10, 2013
    Posts:
    654
    Thanks for sharing. Hopefully this will help out many other uMod users.
     
  29. scottyboy805

    scottyboy805

    Joined:
    Apr 10, 2013
    Posts:
    654
    uMod 2.0 Runtime Compiler Add-On is now released and is available on the asset store.
     
unityunity