I think its a very common issue but I have yet to find a solution. I have been through tutorials and aren't even able to successfully complete tutorials.
I have a test.dfmod file inside StreamingAssets/Mods folder.
I have test.dfmod.json file under Assets\Game\Mods
I have original mod content I used to make mod is under Assets\Untracked\Minimap
I have this so far:
Mod works under unity scene where it was developed. All its gameobjects are disabled when testing loading of mod.
Mod shows up under mod menu.
Mod is not loaded into scene while playing game under unity.
I am using a script from Example3, this script should load my gameobject prefab into game using this, see very last lines in below code.
Code: Select all
using UnityEngine;
using System.Collections;
using DaggerfallWorkshop.Game;
using DaggerfallWorkshop.Game.Utility.ModSupport;
namespace DaggerfallModdingTutorials.Part3
{
//this class initializes the mod.
public class MinimapModLoader
{
public static Mod mod;
public static GameObject ExampleGo;
//like in the last example, this is used to setup the Mod. This gets called at Start state.
[Invoke]
public static void InitAtStartState(InitParams initParams)
{
mod = initParams.Mod;
Debug.Log("Started setup of : " + mod.Title);
//start loading all assets asynchrousnly - the bool paramater tells it to unload the asset bundle since all assets are loaded
ModManager.Instance.GetComponent<MonoBehaviour>().StartCoroutine(mod.LoadAllAssetsFromBundleAsync(true));
mod.IsReady = true;
}
[Invoke(StateManager.StateTypes.Game)]
public static void InitAtGameState(InitParams initParams)
{
if (ExampleGo != null)
return;
//Get a clone of the example gameobject prefab from mod
ExampleGo = mod.GetAsset<GameObject>("Canvas.prefab", true); //fetches gameobject and puts in scene
//ExampleGo = mod.GetAsset<GameObject>("MINIMAP.prefab", true);
}
}
}
Code: Select all
Ignoring virtual mod test because release mod is already loaded.
Error (): `UnityEngine.UIElements.BaseField<TValueType>' must be type definition or nested non-inflated type to MakeGenericType
added asset: test.dfmod.json
added asset: minimapmodloader.cs.txt
Finished Mod setup: test
ModManager - started loading mod: test
At the moment I am simply fetching prefab using Example3 script from tutorial. The prefab has everything inside setup to use these files to show a functional minimap. I have done everything with no luck.
Any guidance is welcome, you can contact me here discord: gunsling3r#6099 to quickly reach me.
This is actually what I am working on, a Minimap mod viewtopic.php?f=14&t=3098
.