How to use mod extracted files?

Discuss modding questions and implementation details.
Post Reply
Lorex
Posts: 41
Joined: Sun Apr 08, 2018 2:35 pm

How to use mod extracted files?

Post by Lorex »

I used the "extract text" function and now have a folder with extracted files inside "mods" folder. I'm trying to modify a value but it doesn't take effect, it should change the max value of a slider in the mod settings.

In the modding tutorial it says:
"Loose Files: Individual files, with a predefined format, installed inside subfolders of StreamingAssets. They override any files inside asset bundles."

I suppose that those files are the loose files, where should I put them, or how should I use them in general?

edit: I suspect it's much harder than changing a value :lol: :roll:

Lorex
Posts: 41
Joined: Sun Apr 08, 2018 2:35 pm

Re: How to use mod extracted files?

Post by Lorex »

Ok I figured out how to do it myself, specifically I've changed the crops respawing time of Harvestable Crops mod and it works fine but I'm stuck at the last step anyway, rebundling to a dfmod.

Unity does not recognize ".prefab" assets. It just makes a dfmod without them I suppose.
When I extracted texts in DU these file extensions were named ".imported.txt".
From the ".dfmod.json" file of the modI can see that those file extensions were actually ".prefab" so I renamed them accordingly (I hope that was the right thing to do).

I get these errors for every .prefab file:
Spoiler!
Failed to load asset: Assets/Game/Mods/HarvestableCrops/Assets/***.prefab
UnityEngine.Debug:LogError(Object)
DaggerfallWorkshop.Game.Utility.ModSupport.CreateModEditorWindow:CopyAsset(String, String) (at Assets/Game/Addons/ModSupport/Editor/CreateModEditorWindow.cs:571)
DaggerfallWorkshop.Game.Utility.ModSupport.CreateModEditorWindow:BuildMod() (at Assets/Game/Addons/ModSupport/Editor/CreateModEditorWindow.cs:528)
DaggerfallWorkshop.Game.Utility.ModSupport.CreateModEditorWindow:<OnGUI>m__4() (at Assets/Game/Addons/ModSupport/Editor/CreateModEditorWindow.cs:371)
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:360)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)

index: 51 full path: C:/Users/***/Documents/GitHub/daggerfall-unity/Assets/Untracked/ModBuilder/Harvestable Crops\***.prefab Asset Path: Assets/Untracked/ModBuilder/Harvestable Crops\***.prefab
UnityEngine.Debug:Log(Object)
DaggerfallWorkshop.Game.Utility.ModSupport.CreateModEditorWindow:GetAssetPathFromFilePath(String) (at Assets/Game/Addons/ModSupport/Editor/CreateModEditorWindow.cs:605)
DaggerfallWorkshop.Game.Utility.ModSupport.CreateModEditorWindow:CopyAsset(String, String) (at Assets/Game/Addons/ModSupport/Editor/CreateModEditorWindow.cs:576)
DaggerfallWorkshop.Game.Utility.ModSupport.CreateModEditorWindow:BuildMod() (at Assets/Game/Addons/ModSupport/Editor/CreateModEditorWindow.cs:528)
DaggerfallWorkshop.Game.Utility.ModSupport.CreateModEditorWindow:<OnGUI>m__4() (at Assets/Game/Addons/ModSupport/Editor/CreateModEditorWindow.cs:371)
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:360)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)

Unrecognized assets cannot be included in AssetBundles: "Assets/Untracked/ModBuilder/Harvestable Crops/***.prefab".
UnityEditor.BuildPipeline:BuildAssetBundles(String, AssetBundleBuild[], BuildAssetBundleOptions, BuildTarget)
DaggerfallWorkshop.Game.Utility.ModSupport.CreateModEditorWindow:BuildMod() (at Assets/Game/Addons/ModSupport/Editor/CreateModEditorWindow.cs:560)
DaggerfallWorkshop.Game.Utility.ModSupport.CreateModEditorWindow:<OnGUI>m__4() (at Assets/Game/Addons/ModSupport/Editor/CreateModEditorWindow.cs:371)
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:360)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)

Any help?

User avatar
BadLuckBurt
Posts: 948
Joined: Sun Nov 05, 2017 8:30 pm

Re: How to use mod extracted files?

Post by BadLuckBurt »

Prefabs are not text files, they are models. The Export Text function only dumps scripts so I don't think you'll succeed in what you're trying to accomplish as you'll need the models to successfully build the mod.

And I think the 'loose files' stuff refers more to textures etc, not scripts as those are compiled.

If all you want to do is change the crop's respawn, ask the mod author if they'd be willing to make it a setting.
DFU on UESP: https://en.uesp.net/w/index.php?title=T ... fall_Unity
DFU Nexus Mods: https://www.nexusmods.com/daggerfallunity
My github repositories with mostly DFU related stuff: https://github.com/BadLuckBurt

.

Lorex
Posts: 41
Joined: Sun Apr 08, 2018 2:35 pm

Re: How to use mod extracted files?

Post by Lorex »

Thank you, that explains everything, I actually "knew" those were models... but apparently I didn't join the dots!
If all you want to do is change the crop's respawn, ask the mod author if they'd be willing to make it a setting.
That's not all I want, I wanted to learn something about DF modding and used that mod to start. I've modified lots of MW and (less) OB mods to my liking in the past ten years and it's much more fun than making requests :D (however in this case I had already made a sort of request to the modder).

So now the next step is to learn how to extract models to rebuild mods correctly.

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

Re: How to use mod extracted files?

Post by TheLacus »

BadLuckBurt wrote: Fri Nov 29, 2019 4:05 pm And I think the 'loose files' stuff refers more to textures etc, not scripts as those are compiled.
This is correct. It is not possible to "extract" a mod and rebuild it because only text files can be recreated properly. Binary assets are converted to a format suitable for target platform and you can't get the original texture or mesh file back.

Prefab files are actually yaml serialized data but you still need the assets that they reference to make use of them.

User avatar
BadLuckBurt
Posts: 948
Joined: Sun Nov 05, 2017 8:30 pm

Re: How to use mod extracted files?

Post by BadLuckBurt »

Lorex wrote: Fri Nov 29, 2019 4:51 pm Thank you, that explains everything, I actually "knew" those were models... but apparently I didn't join the dots!
If all you want to do is change the crop's respawn, ask the mod author if they'd be willing to make it a setting.
That's not all I want, I wanted to learn something about DF modding and used that mod to start. I've modified lots of MW and (less) OB mods to my liking in the past ten years and it's much more fun than making requests :D (however in this case I had already made a sort of request to the modder).

So now the next step is to learn how to extract models to rebuild mods correctly.
You're welcome. I'm not sure if the models can actually be extracted so I'll leave it up to others to answer but in any case, good luck

I got ninja'd by a lich :lol:
DFU on UESP: https://en.uesp.net/w/index.php?title=T ... fall_Unity
DFU Nexus Mods: https://www.nexusmods.com/daggerfallunity
My github repositories with mostly DFU related stuff: https://github.com/BadLuckBurt

.

Lorex
Posts: 41
Joined: Sun Apr 08, 2018 2:35 pm

Re: How to use mod extracted files?

Post by Lorex »

Ah, so that puts an end to my crusade. :lol: :cry:

I will try with some scripted-only mods then!

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

Re: How to use mod extracted files?

Post by Hazelnut »

Feel free to peruse the code for my mods which you can find here https://github.com/ajrb/dfunity-mods. Nystul and TheLacus also have their mod code on their GitHub too.
See my mod code for examples of how to change various aspects of DFU: https://github.com/ajrb/dfunity-mods

Lorex
Posts: 41
Joined: Sun Apr 08, 2018 2:35 pm

Re: How to use mod extracted files?

Post by Lorex »

Thanks, I'll give them a look.

Post Reply