Testing A Mod Script Without Having to Keep Rebuilding Mod

Discuss modding questions and implementation details.
Post Reply
User avatar
Magicono43
Posts: 1141
Joined: Tue Nov 06, 2018 7:06 am

Testing A Mod Script Without Having to Keep Rebuilding Mod

Post by Magicono43 »

As the title says, is there a way that I can quickly test a .cs script without having to rebuild the mod every-time I change a few lines of code? I'm trying to solve something with some trial and error, but it takes most of the time just rebuilding the mod over and over again.

User avatar
Ralzar
Posts: 2211
Joined: Mon Oct 07, 2019 4:11 pm
Location: Norway

Re: Testing A Mod Script Without Having to Keep Rebuilding Mod

Post by Ralzar »

Haha, I know your pain.

What you need is to make sure you are keeping your mod code in Assets/Game/Mods

When you start the DaggerfallUnityStartup scene, it will read your *dmfod.json files as dfmod files.

Example of how I keep my files:
modstructure.PNG
modstructure.PNG (20.84 KiB) Viewed 1083 times

This is not the most ideal way of doing it though. It's better to just keep each dfmod.json file in its respective mods subfolder. I simply started doing it like this and haven't bothered to change my habits.

User avatar
Magicono43
Posts: 1141
Joined: Tue Nov 06, 2018 7:06 am

Re: Testing A Mod Script Without Having to Keep Rebuilding Mod

Post by Magicono43 »

Does the mod still function property if you just have dfmod.json inside the Assets/Game/Mods folder? I tried to put that alone inside and the mod was called "'mod name' debug" but when I started the game it would not do any of the debug log commands I gave it.

If I built and made a normal dfmod file and put it inside StreamAssets/Mods folder with the others, it functioned properly this time. I must be messing some of this up royally just bumbling around, but maybe i'll just keep rebuilding every-time. I guess the .json does not actually hold any of the scripts and assets, it's just there to debug mod builder settings or something.

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

Re: Testing A Mod Script Without Having to Keep Rebuilding Mod

Post by BadLuckBurt »

You should probably give this a read:

https://www.dfworkshop.net/projects/dag ... p-new-mods

I dont know what you put in the dfmod.json but code should go into separate.cs files
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

.

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

Re: Testing A Mod Script Without Having to Keep Rebuilding Mod

Post by Hazelnut »

Take some time to read the modder docs TheLacus wrote. May help. :)
See my mod code for examples of how to change various aspects of DFU: https://github.com/ajrb/dfunity-mods

User avatar
Magicono43
Posts: 1141
Joined: Tue Nov 06, 2018 7:06 am

Re: Testing A Mod Script Without Having to Keep Rebuilding Mod

Post by Magicono43 »

Hazelnut wrote: Thu Mar 05, 2020 12:40 pm Take some time to read the modder docs TheLacus wrote. May help. :)
I skipped that one and read the other ones, since it looked like it was doing mostly graphical assets and seemed like more than I needed, but I guess scripts are sort of assets as well, so I probably should.

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

Re: Testing A Mod Script Without Having to Keep Rebuilding Mod

Post by Hazelnut »

There's plenty about assets, but there's also this page... https://www.dfworkshop.net/projects/dag ... /features/
See my mod code for examples of how to change various aspects of DFU: https://github.com/ajrb/dfunity-mods

Post Reply