Testing A Mod Script Without Having to Keep Rebuilding Mod

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

Testing A Mod Script Without Having to Keep Rebuilding Mod

Post by Magicono43 » Wed Mar 04, 2020 9:38 pm

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: 969
Joined: Mon Oct 07, 2019 4:11 pm
Location: Norway

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

Post by Ralzar » Wed Mar 04, 2020 9:51 pm

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 137 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.
My released mods

"I feel like Ralzar specifically wrote those mods for me and then said "Use them". Just so he could watch me die more."
-FuzzyBeanPlays

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

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

Post by Magicono43 » Thu Mar 05, 2020 1:44 am

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.

BadLuckBurt
Posts: 422
Joined: Sun Nov 05, 2017 8:30 pm

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

Post by BadLuckBurt » Thu Mar 05, 2020 5:41 am

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

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

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

Post by Hazelnut » Thu Mar 05, 2020 12:40 pm

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: 150
Joined: Tue Nov 06, 2018 7:06 am

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

Post by Magicono43 » Fri Mar 06, 2020 1:40 am

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: 2125
Joined: Sat Aug 26, 2017 2:46 pm
Contact:

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

Post by Hazelnut » Fri Mar 06, 2020 9:16 am

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