[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
User avatar
Magicono43
Posts: 1141
Joined: Tue Nov 06, 2018 7:06 am

Re: [Mod] Physical Combat And Armor Overhaul

Post by Magicono43 »

Now that Roleplay Realism - Items has added some new armor, i'm likely going to have to make an update with that in mind. Probably both a setting as well as adding all of the added items and making some armor reduction values for those new items, will have to see how it goes.

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

Re: [Mod] Physical Combat And Armor Overhaul

Post by Magicono43 »

I'm currently in the works on adding some items that will allow for "maintenance" of weapons and equipment on the go, IE being able to repair stuff while in the field. Key examples being a Whetstone for repairing bladed weapons, a sewing kit for repairing damaged leather armor and clothing items, etc.

With this, I may also consider doing that thing on my list that gear will be more or less effective the higher durability it currently is, but i'll get there when I finish these items first and get them working as close to 100% as I would feel comfortable with.

On that note as well, I might consider making these items a separate mod and just have it as a compliment to this mod, instead of an added feature to an already potentially getting bloated feature wise mod, lol.

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

Re: [Mod] Physical Combat And Armor Overhaul

Post by l3lessed »

Hey, Magicon, I need to create a patch for this mod, but because the way you designed your script, I need to rebuild your whole script file with my shield module code and objects being attached into it. The point being, the only way I can patch this, is by releasing a second patched version of your mod. It technically would make it so your original mod would not even be needed anymore, if they enabled my patch in my mod.

Would this be okay to release it? I don't want to take DL's and views away from your work, but I can't figure out a more efficient way than just hijacking your mod and trying it directly into mine.

That or, you need to go into my FPSShield script and use my formula as reference to build a second CalculateAttackDamage formula routine that incorporates my attack damage formula into it, thus connecting it to my shield script but keeping it under the umbrella of your mod. I personally would prefer this, if you plan to continually update this mod. I rather not have to rebuild the patch from scratch every time you update.

I could walk you through that, if you wanted to release the patch yourself, under your mods page. I did some redesigning of my scripts, so other modders could access my mod objects and properties through the nameclass. If you wish to do this, let me know, and I will send you the most recent version of my script with the redesigns in it for patching and answer any questions you have.
Last edited by l3lessed on Thu Jul 02, 2020 6:35 pm, 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.

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

Re: [Mod] Physical Combat And Armor Overhaul

Post by Ralzar »

Would it be possible to do it the other way around? So Magiconos mod has code that only runs when your mod is loaded? I recently submitted a PR to him specifically to make his mod work that way for the RP&R:Items chainmail armors.

https://github.com/magicono43/DFU-Mod_P ... aul/pull/1

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

Re: [Mod] Physical Combat And Armor Overhaul

Post by Magicono43 »

l3lessed wrote: Thu Jul 02, 2020 6:21 pm Hey, Magicon, I need to create a patch for this mod, but because the way you designed your script, I need to rebuild your whole script file with my shield module code and objects being attached into it. The point being, the only way I can patch this, is by releasing a second patched version of your mod. It technically would make it so your original mod would not even be needed anymore, if they enabled my patch in my mod.

Would this be okay to release it? I don't want to take DL's and views away from your work, but I can't figure out a more efficient way than just hijacking your mod and trying it directly into mine.
I'm not sure I really understand, I thought that most of the mechanics of your overhaul were pretty much the opposite in functionality compared to mine. Where your modules are generally there to allow for 100% hit chance, but using player ability to avoid attacks, where mine just changes how the rolls work, therefore making them basically incompatible from the get-go, at least in those aspects.

I assume users of your shield module are asking for a patch for my mod? If so, i'm not 100% sure what they want to achieve with my mod, maybe the armor effects or something?

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

Re: [Mod] Physical Combat And Armor Overhaul

Post by l3lessed »

Funny, I just updated my post to mention this. Yes, that is what I would prefer. It is better for the mod developer, as it keeps the users under his mod (thus I'm not poaching his handwork and users), and it is less work for me in the long run.

I believe its ready for patching too. I rebuilt the namespace and moved my formulaoverride into its own script. At this point, others just need to ask for my most recent script version, and then use the namespace of my mod to connect to the shield properties and objects for the formula override. And, it honestly is only about 20 codes of line being added to the formula, so it is a very simple patch, once you get my FPSShield objects and properties setup in your scripts.
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: 1409
Joined: Mon Aug 12, 2019 4:32 pm
Contact:

Re: [Mod] Physical Combat And Armor Overhaul

Post by l3lessed »

Magicono43 wrote: Thu Jul 02, 2020 6:37 pm
l3lessed wrote: Thu Jul 02, 2020 6:21 pm Hey, Magicon, I need to create a patch for this mod, but because the way you designed your script, I need to rebuild your whole script file with my shield module code and objects being attached into it. The point being, the only way I can patch this, is by releasing a second patched version of your mod. It technically would make it so your original mod would not even be needed anymore, if they enabled my patch in my mod.

Would this be okay to release it? I don't want to take DL's and views away from your work, but I can't figure out a more efficient way than just hijacking your mod and trying it directly into mine.
I'm not sure I really understand, I thought that most of the mechanics of your overhaul were pretty much the opposite in functionality compared to mine. Where your modules are generally there to allow for 100% hit chance, but using player ability to avoid attacks, where mine just changes how the rolls work, therefore making them basically incompatible from the get-go, at least in those aspects.

I assume users of your shield module are asking for a patch for my mod? If so, i'm not 100% sure what they want to achieve with my mod, maybe the armor effects or something?
The final combat overhaul will be that. However, I'm releasing as much of its features as individual mods as I can. This way, as much of it can be compatible with the base DFU engine and allow others to use these features, without having to commit 100% to my end goals and designs. The shield module is just a small part of that, and does nothing to any of the base combat calculations, past zeroing out damage and grabbing the enemy entity object that did the damage, and telling the shield script the player was officially hit.

Right now, the shield will work fine with your mod. It doesn't currently change hit chances at all. All it does it, when an enemy hit is detected on the player, zeros out the damage and assigns the proper enemy entity objects for the shield script to use. At that point, the heavy lifting of my mod begins. I specifically kept the formula as untouched as possible, so it would be as compatible with base DFU as possible, and ensure max compatibility/patching for other modders as possible. Once you connect your mod scripts to my namespace, it should be a super simple patch to add into any base formula.
Last edited by l3lessed on Thu Jul 02, 2020 6:47 pm, edited 2 times 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.

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

Re: [Mod] Physical Combat And Armor Overhaul

Post by Magicono43 »

l3lessed wrote: Thu Jul 02, 2020 6:39 pm Funny, I just updated my post to mention this. Yes, that is what I would prefer. It is better for the mod developer, as it keeps the users under his mod (thus I'm not poaching his handwork and users), and it is less work for me in the long run.

I believe its ready for patching too. I rebuilt the namespace and moved my formulaoverride into its own script. At this point, others just need to ask for my most recent script version, and then use the namespace of my mod to connect to the shield properties and objects for the formula override. And, it honestly is only about 20 codes of line being added to the formula, so it is a very simple patch, once you get my FPSShield objects and properties setup in your scripts.
Oh ok, so you want me to add a patch so our mods can work together right? Ralzar just did that for my mod and RPR:Items, so I guess it should be easy enough in theory. I just need to know what parts need to be added to mine and I should be able to make that work.

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

Re: [Mod] Physical Combat And Armor Overhaul

Post by l3lessed »

Once you've setup the namespace of my mode and can grab the public objects, all you have to do is paste this block of code right before the return damage at the end of the formula routine. It will intercept any damage calculation that has been done and do what it needs to for my shield module to work.

Code: Select all

            //--->SHIELD MODULE ADDITION<---\\
            //checks to see if player is blocking yet and if the target is the player. If so, assign damage to attackerDamage, enemy object to enemyEntity, and
            //0 out the damage, so player doesn't take any.
            if (FPSShield.isBlocking == true && target == GameManager.Instance.PlayerEntity && (FPSShield.shieldStates == 1 || FPSShield.shieldStates == 2) && damage != 0)
            {
                //grabs attackers sense object.
                EnemySenses attackerSenses = attacker.EntityBehaviour.GetComponent<EnemySenses>();

                //uses attackers sense to figure out their direction to target using their position data.
                Vector3 toTarget = attackerSenses.PredictedTargetPos - attackerSenses.transform.position;
                toTarget.y = 0;

                //grabs players main camera object and sets up player direction using the camera object.
                Vector3 targetDirection2D;
                Camera mainCamera = GameObject.FindGameObjectWithTag("MainCamera").GetComponent<Camera>();
                targetDirection2D = -new Vector3(mainCamera.transform.forward.x, 0, mainCamera.transform.forward.z);

                //if the attack angle is shield block angle degrees or more (player does not have them on screen) don't register the block.
                if (!(Vector3.Angle(toTarget, targetDirection2D) > FPSShield.blockAngle))
                {
                    FPSShield.isHit = true;
                    FPSShield.attackerDamage = damage;
                    damage = 0;
                    FPSShield.enemyEntity = attacker;
                }
            }

            return damage;
I'll shoot you my updated base script file. I haven't released it in a public version yet, as I just put in these changes last night for patching specifically. You'll need to load my script file into unity, so you can call my namespace and get access to my public objects and properties. Again, once that is done, just drop the above code block before the return damage, and it should work.
Last edited by l3lessed on Thu Jul 02, 2020 6:57 pm, 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: 1409
Joined: Mon Aug 12, 2019 4:32 pm
Contact:

Re: [Mod] Physical Combat And Armor Overhaul

Post by l3lessed »

K, I just sent you a PM with my update script files in it for reference and attaching your script/formula to my namespace/mod.

Just let me know before you drop the patch. I need to drop my update first, and let my users know to update, if they want cross compatibility. Possibly give them a day or two to update before you drop your patch? Just let me know, we all have busy lives. I'll drop my updates at some point today and blast the news to prep for a patch at some point in the future.
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