Integrating terrain texturing with basic roads texturing

Discuss modding questions and implementation details.
User avatar
Hazelnut
Posts: 3015
Joined: Sat Aug 26, 2017 2:46 pm
Contact:

Re: Integrating terrain texturing with basic roads texturing

Post by Hazelnut »

Sorry, I don't know much about prefabs and have never used them in any of my mods due to this. (and the fact I've never needed to)

Looking at the real grass github repo, they seem to be simply included in the list of files on mod builder. No idea what else needs to be done.
See my mod code for examples of how to change various aspects of DFU: https://github.com/ajrb/dfunity-mods

User avatar
Daniel87
Posts: 391
Joined: Thu Nov 28, 2019 6:25 pm

Re: Integrating terrain texturing with basic roads texturing

Post by Daniel87 »

Hazelnut wrote: Fri May 21, 2021 11:24 am FYI Just tried runnng the mod files attached in this thread on Linux 0.11.3 DFU with my laptop and they work fine with the flys and stars disabled in settings.
Super weird, as I can't even see my mod in the mod list on Linux.
Let me completely delete DFU and reinstall it again, maybe there were some residue files left or something.

I tried changing the materials of the firefly and shooting stars, hope this helps somehow.
I am actually just using the standard shader from unity, as I thought that one would be supported.

EDIT: Nope, nada, niente, nichts. No Chance. Linux DFU 0.11.3 just doesn't want to show me my mod when I use the linux or windows build option.
I reinstalled DFU, redownloaded the current master, hardcoded in the settings variables, but it simply won't show the mod.

I get some yellow "errors" though. First one is

Code: Select all

'Assets/Game/Mods/Wilderness%20Overhaul/Wilderness%20Overhaul.dfmod.json' does not exist
UnityEditor.AssetDatabase:ImportAsset(String, ImportAssetOptions)
DaggerfallWorkshop.Game.Utility.ModSupport.ModManager:ImportAsset(String, ImportAssetOptions) (at Assets/Game/Addons/ModSupport/ModManager.cs:988)
DaggerfallWorkshop.Game.Utility.ModSupport.CreateModEditorWindow:SaveModFile(Boolean) (at Assets/Game/Addons/ModSupport/Editor/CreateModEditorWindow.cs:467)
DaggerfallWorkshop.Game.Utility.ModSupport.<>c__DisplayClass28_0:<OnGUI>b__4() (at Assets/Game/Addons/ModSupport/Editor/CreateModEditorWindow.cs:422)
DaggerfallWorkshop.GUILayoutHelper:Horizontal(VoidDelegate) (at Assets/Scripts/Editor/GUILayoutHelper.cs:55)
DaggerfallWorkshop.Game.Utility.ModSupport.CreateModEditorWindow:OnGUI() (at Assets/Game/Addons/ModSupport/Editor/CreateModEditorWindow.cs:412)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
The Wilderness Overhaul.dfmod.json exists, so no idea why I get this message after building...

Image

Honestly, I ran out of ideas what else to do here. If I get no proper error messages, I cannot properly debug.
I'll have to put this mod back on ice. No idea who to ask or what to do now and spare time to dump into this is spread thin.

Maybe I address that bug you mentioned before, first.
I instantiate a prefab that is located inside Resource folder in my mod folder. I could also instantiate it cia "Assets/..." path, but I would need to know how the game handles my dfmod file. Where would these prefabs be located at runtime when the code tries to instantiate a shooting star?
Would that be "Assets/StreamingAssets/???" or "Assets/Game/Mods/Wilderness Overhaul/Resources/"?
In Julianos we Trust.

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

Re: Integrating terrain texturing with basic roads texturing

Post by Hazelnut »

Hmm, I wish I could be more help. Hoping TheLacus the mod expert can pop in and help you..

As for prefab locations, all I can say is that Real Grass repo and .dfmod.json file have the prefabs in a parallel folder but I don't think this makes any difference as long as the files are included in the json list. I do have some model files which I have in a sub folder called Models for my Archaeologists mod, but again I think they can be anywhere accessible on the filesystem when packing into dfmod files.

I get the same warning when I build your mod too about .dfmod.json doesn't exist but it's not causing any issues my end. Have seen that before, something to do with the mod building process. I don't think it's the cause of your issues.

The only difference is I am building for windows and you for linux. By the way when I tested on linux laptop I simply used the windows build of your mod. Worked fine for the code, and I only tend to make one build of my mods since images and code work regardless of platform. (well actually the model in Archs mod needed a OSX specific build for it to work) However prefabs may need specific platform builds.. not sure.
See my mod code for examples of how to change various aspects of DFU: https://github.com/ajrb/dfunity-mods

User avatar
Daniel87
Posts: 391
Joined: Thu Nov 28, 2019 6:25 pm

Re: Integrating terrain texturing with basic roads texturing

Post by Daniel87 »

Hazelnut wrote: Fri May 21, 2021 8:50 pm Hmm, I wish I could be more help. Hoping TheLacus the mod expert can pop in and help you..

As for prefab locations, all I can say is that Real Grass repo and .dfmod.json file have the prefabs in a parallel folder but I don't think this makes any difference as long as the files are included in the json list. I do have some model files which I have in a sub folder called Models for my Archaeologists mod, but again I think they can be anywhere accessible on the filesystem when packing into dfmod files.

I get the same warning when I build your mod too about .dfmod.json doesn't exist but it's not causing any issues my end. Have seen that before, something to do with the mod building process. I don't think it's the cause of your issues.

The only difference is I am building for windows and you for linux. By the way when I tested on linux laptop I simply used the windows build of your mod. Worked fine for the code, and I only tend to make one build of my mods since images and code work regardless of platform. (well actually the model in Archs mod needed a OSX specific build for it to work) However prefabs may need specific platform builds.. not sure.
The Player.log actually revealed a problem with the Mod Builder I am experiencing:

Code: Select all

Unable to read header from archive file: /mnt/wwn-0x50014ee1aae6e930-part1/Games/Daggerfall Unity Linux/DaggerfallUnity_Data/StreamingAssets/Mods/wilderness overhaul.dfmod 
(Filename:  Line: 74)
Not sure how I could solve this though. Already redownloaded the GitHub Repo but am still getting this error.
In Julianos we Trust.

User avatar
TheLacus
Posts: 1305
Joined: Wed Sep 14, 2016 6:22 pm

Re: Integrating terrain texturing with basic roads texturing

Post by TheLacus »

The proper way to load a prefab with Mod.GetAsset() is with the filename without extension or path. Custom components on a prefab would normally not be supported because they are not known by Unity during deserialization; however you can use the ImportedComponent attribute i wrote to force a json based serialization for custom components. You only need to add it to the class definition.

I don't think this is strictly related to the issue of mod not appearing, there is probably something else going on. Do you recognize /mnt/wwn-0x50014ee1aae6e930-part1 as a valid path? Maybe you use symbolic links or similar?

User avatar
Daniel87
Posts: 391
Joined: Thu Nov 28, 2019 6:25 pm

Re: Integrating terrain texturing with basic roads texturing

Post by Daniel87 »

TheLacus wrote: Sun May 23, 2021 5:27 pm The proper way to load a prefab with Mod.GetAsset() is with the filename without extension or path. Custom components on a prefab would normally not be supported because they are not known by Unity during deserialization; however you can use the ImportedComponent attribute i wrote to force a json based serialization for custom components. You only need to add it to the class definition.

I don't think this is strictly related to the issue of mod not appearing, there is probably something else going on. Do you recognize /mnt/wwn-0x50014ee1aae6e930-part1 as a valid path? Maybe you use symbolic links or similar?
You were completely right. No idea why it didn't work the first time I tried to relocate the daggerfall master to my root SSD.
Just did that again. Dragged the DFU master from my NTFS to my root EXT3 and built the mod WITHOUT precompile option.
This mix seems to have resolved the issue.
In Julianos we Trust.

Post Reply