[Mod] Physical Combat And Armor Overhaul

A curated forum for compatible and maintained mods. Users are unable to create new topics in this forum but can reply to existing topics. Please message a moderator to have your mod moved into this forum area.
Post Reply
l3lessed
Posts: 1399
Joined: Mon Aug 12, 2019 4:32 pm
Contact:

Re: [Mod] Physical Combat And Armor Overhaul

Post by l3lessed »

You are not wrong. The script files have to be loaded into your unity/C# project so the namespace can be accessed by the C# compiler. There is no way around this. The compiler, when reading the code and then later building the json, has to be able to pull my script objects from the project environment. Without my class objects in the formula, my mod won't be able to intercept needed data to run all its code and cause it to break instantly. Cost of adding a whole new fps mechanism with animations.

However, The developer files shouldn't be added to the mod builder asset list when compiling your mod since using my namespace does the connecting to my script files.

You should not need to update the developer files again, once downloaded from nexus and added to your project. Sorry, but there is no way around this, just how object language works.

Also, if the user doesn't check the patch, it doesn't load anything from my mod, since the patch loads its own separate formula object, thus never having to use the namespace if the user doesn't have my mod.
Last edited by l3lessed on Sat Jul 04, 2020 5:20 am, edited 1 time in total.
My Daggerfall Mod Github: l3lessed DFU Mod Github

My Beth Mods: l3lessed Nexus Page

Daggerfall Unity mods: Combat Overhaul Mod

Enjoy the free work I'm doing? Consider lending your support.

l3lessed
Posts: 1399
Joined: Mon Aug 12, 2019 4:32 pm
Contact:

Re: [Mod] Physical Combat And Armor Overhaul

Post by l3lessed »

Sorry, ignore me, I'm high and been coding all day, so little hazy in the head. You do not need to compile a separate json if you do not want to. From what I can tell, your mod loads fine into default DFU, even without my shield module there. So, you can do it either way. You can use the single file and have the user click a setting like my first example, or you can just create a separate json file like this last exampe. Up to you.


*Keeping below info for reference on creating second JSON mod file, if that is what you choose*

One more clarification. You can create a separate json mod file for my mod onlyif so, you can remove the settings option and use one formula. The user will just choose which version of your mod file to use based on if they use my mod or not.

Just have two files on your nexus. One for users using shield module, and one for those not.

Here is the updated example script file, without the settings and extra formula. Just compile this as a separate json mod file. I know, annoying having two of them.

I updated the drop box file for you: https://www.dropbox.com/s/56galqnv84g7j ... ch.cs?dl=0
My Daggerfall Mod Github: l3lessed DFU Mod Github

My Beth Mods: l3lessed Nexus Page

Daggerfall Unity mods: Combat Overhaul Mod

Enjoy the free work I'm doing? Consider lending your support.

l3lessed
Posts: 1399
Joined: Mon Aug 12, 2019 4:32 pm
Contact:

Re: [Mod] Physical Combat And Armor Overhaul

Post by l3lessed »

Here are two reference script files. One for each approach. Either works.

Use mod settings to allow user to enable or disable if they have the shield module: https://www.dropbox.com/s/5tc198f7nde4f ... de.cs?dl=0

Provide a seperate json file for downloading, instead of using the mod settings:
https://www.dropbox.com/s/56galqnv84g7j ... ch.cs?dl=0
My Daggerfall Mod Github: l3lessed DFU Mod Github

My Beth Mods: l3lessed Nexus Page

Daggerfall Unity mods: Combat Overhaul Mod

Enjoy the free work I'm doing? Consider lending your support.

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

Re: [Mod] Physical Combat And Armor Overhaul

Post by Magicono43 »

Well if that is the only option, I think i'll just go with the making a separate "compatible" version and leave one without the changes. Depending on changes that happen to either of our mods, the compatibility version may not get updated as quickly, but will have to see how it works out.

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

Re: [Mod] Physical Combat And Armor Overhaul

Post by Magicono43 »

Released Update Version 1.15. See Main Post For Details. Mainly compatibility with other mods related.

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

Re: [Mod] Physical Combat And Armor Overhaul

Post by Magicono43 »

l3lessed wrote: Sat Jul 04, 2020 6:47 am Here are two reference script files. One for each approach. Either works.

Use mod settings to allow user to enable or disable if they have the shield module: https://www.dropbox.com/s/5tc198f7nde4f ... de.cs?dl=0

Provide a seperate json file for downloading, instead of using the mod settings:
https://www.dropbox.com/s/56galqnv84g7j ... ch.cs?dl=0
Alright, so the main script for my mod is no longer giving any compile errors while using your namespace with the FPSShield.cs inside the environment, but I think you are still forgetting some files or something here, because now the FPSShield.cs script itself is giving compile errors in the "void Awake()" method:

Code: Select all

void Awake()
        {
            Mod rr = ModManager.Instance.GetMod("RoleplayRealism");

            if (rr != null)
            {
                ModSettings rrSettings = rr.GetSettings();
                encumbranceRPR = rrSettings.GetBool("Modules", "encumbranceEffects");
            }
            if (tt != null)
            {
                tediousTravel = true;
                txtSeverity = false;
            }
            if (ff != null)
            {
                fillingFoodOld = true;
            }
            if (cc != null)
            {
                climatesCloaksOld = true;
            }
            if (ff != null || cc != null)
            {
                EntityEffectBroker.OnNewMagicRound += ClimateIncomp_OnNewMagicRound;
            }

            mod.IsReady = true;
        }
All those referenced mods are throwing "does not exist in this context" compile errors. So can I delete these references, and am I supposed to be using the entire FPSShield script or what? I can't just reference your namespace with my mod script alone, as I can't build the .dfmod at all with any compile errors such as this currently active in the Unity environment.

l3lessed
Posts: 1399
Joined: Mon Aug 12, 2019 4:32 pm
Contact:

Re: [Mod] Physical Combat And Armor Overhaul

Post by l3lessed »

Yes, as part of moving to Patch-O-Rama, I moved my formula into its own script file to ensure my formula is not loaded in any fashion when another mod loads their own after it. That is included in the developer files. What I can do is remove the line giving the error, since you are loading a custom formula already, and repackage the script files.

I'm dropping an updated developer package, with a read me and all the example and the single required file. I commented out the line giving you the compile error, so you can load the script file without having to load the custom formulahelper script file I created.

You can get the official developer file package here: https://www.nexusmods.com/daggerfalluni ... ?tab=files.

Sorry, and thanks for being my test subject on getting this together for future modders.
My Daggerfall Mod Github: l3lessed DFU Mod Github

My Beth Mods: l3lessed Nexus Page

Daggerfall Unity mods: Combat Overhaul Mod

Enjoy the free work I'm doing? Consider lending your support.

l3lessed
Posts: 1399
Joined: Mon Aug 12, 2019 4:32 pm
Contact:

Re: [Mod] Physical Combat And Armor Overhaul

Post by l3lessed »

Download the new developer package from nexus. In there you will find the new required file, along with a number of none required files for coding examples and explanations.

You should be able to drop the new "Required - FPSShield.cs" file into your project, replacing the old one "FPSShield.cs". Again, you can ignore all the non-required files, as they are just for developers who need code examples to look at.

This should remove the compile error, and let you compile. Just ensure your mod has the override formula setup with the code patches I provided, and you should be good to go. It should compile the JSON that you can release as a separate file.

Thanks again, and let me know if there are any other issues.
My Daggerfall Mod Github: l3lessed DFU Mod Github

My Beth Mods: l3lessed Nexus Page

Daggerfall Unity mods: Combat Overhaul Mod

Enjoy the free work I'm doing? Consider lending your support.

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

Re: [Mod] Physical Combat And Armor Overhaul

Post by Magicono43 »

l3lessed wrote: Sat Jul 04, 2020 7:26 pm Download the new developer package from nexus. In there you will find the new required file, along with a number of none required files for coding examples and explanations.

You should be able to drop the new "Required - FPSShield.cs" file into your project, replacing the old one "FPSShield.cs". Again, you can ignore all the non-required files, as they are just for developers who need code examples to look at.

This should remove the compile error, and let you compile. Just ensure your mod has the override formula setup with the code patches I provided, and you should be good to go. It should compile the JSON that you can release as a separate file.

Thanks again, and let me know if there are any other issues.
Alright, I was able to get the .dfmod built finally and did not have to bundle your script in with my mod's script. However, when your mod is active at the same time as mine (mine being loaded last) i'm getting some weird errors when the mod Inits should be internalizing and leads to either your mod working as intended, but mine not, or mine working but yours not functioning besides parts of the shield GUI texture, and the shield itself not working at all. Here is one of the errors upon launching the game.
Capture.JPG
Capture.JPG (112.5 KiB) Viewed 2330 times
I tried a bunch of different combinations of things to see if I could get something that worked, but the things I tried always had either one of the mods not working. So i'm just going to link the files and see if you can figure out what is going on here, because i have no idea. I used a different method to detect your mod, this one being the way Ralzar helped me get RPR:I and Meaner Monsters to be compatible without having to use un-intuitive settings options, but I don't think that's why this is not working. In this example that i'm sending it has an error occur at line 82 of my script as the above image shows. Maybe you can figure out what's up with this, because I can't, but I better understand how your namespace usage works at least.

Here is the .rar with my files:

l3lessed
Posts: 1399
Joined: Mon Aug 12, 2019 4:32 pm
Contact:

Re: [Mod] Physical Combat And Armor Overhaul

Post by l3lessed »

You're still misunderstanding the process.

The new error is not a result of anything to do with my files. It has to do with how you setup you InitMod method.

First, you do not need to include a setting for shield module if you're going to release it as a separate file, which is seems that is what you want to do.

I'm compiling the script for you now. However, I ran into one last issue I need to resolve. Once I do, I'll send you the fixed script file to you.
My Daggerfall Mod Github: l3lessed DFU Mod Github

My Beth Mods: l3lessed Nexus Page

Daggerfall Unity mods: Combat Overhaul Mod

Enjoy the free work I'm doing? Consider lending your support.

Post Reply