Creating mods with assets

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

Creating mods with assets

Post by Hazelnut »

I'm trying to build a new dfmod of the Archaeologists and facing the same issue that I did when I was originally trying to package it. All assets except for scripts are rejected as 'unrecognised assets' and not packaged into the dfmod file. This is all the quests (with .txt extensions) and worlddata files (with .json extension) - I must have solved this issue back in March but I cannot remember what I had to do for the life of me.

This post has me asking about how to get this working: https://forums.dfworkshop.net/viewtopic ... =50#p10744 but there's no solution, I never posted back with what I had to do to fix it.

At the moment I cannot even think of anything to try. I really don't understand what the issue is here. If I can add assets in the modbuilder window, why can't they get packaged? Hope someone with more knowledge can help. Here's an example of the error messages I see.

Code: Select all

Unrecognized assets cannot be included in AssetBundles: "Assets/StreamingAssets/QuestPacks/Archaeologists/JHAR007.txt".
UnityEditor.BuildPipeline:BuildAssetBundles(String, AssetBundleBuild[], BuildAssetBundleOptions, BuildTarget)
DaggerfallWorkshop.Game.Utility.ModSupport.CreateModEditorWindow:BuildMod() (at Assets/Game/Addons/ModSupport/Editor/CreateModEditorWindow.cs:532)
DaggerfallWorkshop.Game.Utility.ModSupport.CreateModEditorWindow:<OnGUI>m__5() (at Assets/Game/Addons/ModSupport/Editor/CreateModEditorWindow.cs:343)
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:332)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)

Guess the mod is on hold for now...
See my mod code for examples of how to change various aspects of DFU: https://github.com/ajrb/dfunity-mods

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

Re: Creating mods with assets

Post by TheLacus »

Do not put them inside StreamingAssets ;)
If you can't see a preview in the editor it means they are not imported, so it makes sense that you can't make an AssetBundle with them. I personally put my mods inside the Addons folder; Untracked is also a great alternative.

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

Re: Creating mods with assets

Post by Hazelnut »

Thanks TheLacus - you saved me from tearing my hair out. I'm not even sure I realised how I got it working earlier this year - since it was trial and error. :)

Now I understand what I changed yesterday. I was getting Unity confused with these files appearing in both StreamingAssets and Addons due to symlinks so I made them only appear in SA folder to correct this issue. Now I know why I had copied the files into SA before, had wondered why I had them in both places. The files must be in SA to test so it's a shame that means mod creator cannot use them to build the mod directly from there.
See my mod code for examples of how to change various aspects of DFU: https://github.com/ajrb/dfunity-mods

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

Re: Creating mods with assets

Post by Hazelnut »

Have an issue building mac and linux versions of the dfmod package, it says it's not allowed because a required bundle is not installed. Probably since switching to newer version of Unity. What is the difference between the packages for different platforms? The assets are not compiled or linked to any platform dependent resources as far as I can see, so do I really need to release platform specific versions?

If so then I'll track down the relevant modules.
See my mod code for examples of how to change various aspects of DFU: https://github.com/ajrb/dfunity-mods

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

Re: Creating mods with assets

Post by TheLacus »

Unity API has distinct output build targets. I think it's mostly useful for mobile platforms but there are also some assets that could use different build formats for desktop. I believe shaders are an example. You can select Linux and Mac supports if you re-run the editor installer.

Post Reply