[MOD]Ambidexterity Module (Shield Module Branch)

Show off your mod creations or just a work in progress.
Post Reply
l3lessed
Posts: 650
Joined: Mon Aug 12, 2019 4:32 pm
Contact:

Re: [MOD]Ambidexterity Module (Shield Module Branch)

Post by l3lessed »

New version just dropped.

Included in it:
  • Shield Animation Timing Fix: Shield numerator is now hooked to the fixedupdate tick cycle to ensure FPS independent animation times. This should resolved any weird shifts in animation times or possible animation bugginess during FPS drops.
  • Weapon Sparks/Particle System In: Added first particle system prefab and scripting code. When you parry successfully, the system will randomly generate between 15 and 30 metal sparks that are 3d meshes with collisions; they also have life like changing trails, colors, and lights to simulate real life sparks. Over a 3rd of a second, they fade from bright white, to bright yellow, to deep glowing red, to dull grey, and die at 1 second to save script and memory space usage.
Particle System Showcase: Parry/Weapon Sparks


I feel like I should have mentioned this a while ago but I think I forgot. Any plans on tweaking the way this mod handles bows when you have the "Equip bows in left hand only" setting activated?
Bows are normally equipped as a two-handed weapon, but the DFU launcher offers an option to make them equippable as one-handed. Without Ambidexterity Mod, this setting was a huge convenience to me, because it meant that I could have a bow equipped, and quickly use the "switch hand" key to switch to a melee weapon when I ran out of arrows without having to open my inventory. However, since I started playingwith Ambidexterity Mod I had to deactivate this setting bcause it looks like you're wielding your bow and your seconary weapon at the same time and whil it makes sense because it' consistent with the way this mod handles other one-handed weapons, it just looks really odd. Maybe you could make it so that when you have one-handed bows activated, the mod makes an exception for them and handles them like vanilla one-handed weapons (meaning that you have to use H to switch between one weapon and the other instead of having both of the at the same time)
Idk if I explained that properly, English isn't my first language and there are some days when I just find it harder to express myself clearly.
I should be able to take care of this. I have to update how the offhand is handled when a bow is equipped, but it should be doable by next release. Right now, I just remove both your weapons, turn off my scripts, and the reenable the default FPS weapon system for bows and magic only. I will ensure the offhand stays equipped, but it doesn't render on screen. Another option until then, is to use my outfit manager mod on Nexus and setup an outfit for bows and an outfit for melee.

For those wondering the prefab issue, it was a dumb oversight, like I thought. Ensure to compile and drop your mod into the streaming asset/mods folder within the editor DFunity directory. Without doing this, it does not have the .dfmod file to try and pull the assets from, and unlike the script files, it won't know where to get the prefab from automatically (It needs your mods .dfmod file in the MODS folder).
My Daggerfall Mods: l3lessed Nexus Page

Daggerfall Unity mods: Combat Overhaul Mod

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

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

Re: [MOD]Ambidexterity Module (Shield Module Branch)

Post by TheLacus »

l3lessed wrote: Thu Oct 22, 2020 12:35 am I named the prefabbed particle system "Spark_Particles"; the file is "Spark_Particles.prefab".

I am putting the prefab in the asset/prefab directory, like explained for models in documentation.
You can place it anywhere inside Assets folder. As suggested in the documentation, you should have a subfolder with all the content used by your mod inside Assets/Game/Mods.
l3lessed wrote: Thu Oct 22, 2020 12:35 am then, I create a blank gameobject to hold the prefab within the script.

Code: Select all

public GameObject ParticleSystemGo;
Then I try to load the compiled prefab to the blank gameobject and use a ToString() to check if the object filled with anything, like so:

Code: Select all

            ParticleSystemGo = mod.GetAsset<GameObject>("Spark_Particles");
            Debug.Log(ParticleSystemGo.ToString());
I also tried it like so:

Code: Select all

            var ParticleSystemGo = mod.GetAsset<GameObject>("Spark_Particles");
            Debug.Log(ParticleSystemGo.ToString());
Do we need to include the directory path in the name, starting as the asset directory as the base?
No, only the name without extension.
l3lessed wrote: Thu Oct 22, 2020 12:35 am Do i need to do anything with the LoadAsset objects?
GetAsset() returns a reference to the loaded prefab, you don't need to do anything else.
l3lessed wrote: Sat Oct 24, 2020 6:06 am For those wondering the prefab issue, it was a dumb oversight, like I thought. Ensure to compile and drop your mod into the streaming asset/mods folder within the editor DFunity directory. Without doing this, it does not have the .dfmod file to try and pull the assets from, and unlike the script files, it won't know where to get the prefab from automatically (It needs your mods .dfmod file in the MODS folder).
That's actually not needed; any asset can be loaded directly in editor if you add it to the list of assets. Make sure you are clicking the save button after you add it with the Mod Builder.

Note that a built mod inside Assets/StreamingAssets/Mods takes precedence over the mod defined by manifest inside Assets/Game/Mods. Maybe you where testing with an old version of your mod that you forgot there.
Mod System documentation - Learn how to create mods for Daggerfall Unity.
Modder Discussion - General help and discussion for the mod system.
Github Issues - Submit a bug report for the game, including the mod system.

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

Re: [MOD]Ambidexterity Module (Shield Module Branch)

Post by l3lessed »

Thanks for all the clarifying information. I get it now. It was my nub misunderstandings of how the project and asset bundle system was working.

For it to work within the editor, the prefab needs to be saved to the project itself, so it appears within the project asset and can be pulled using the asset list in GetAsset().

To get it to work with a mod file and base DFunity, it also needs added to the mod asset bundle, so it gets compiled into the mod bundle and added to the asset list upon mod launch in the base build.

I was being dumb and not saving it to the project itself, so it would show up in the project asset list. I was merely adding it to the mod asset bundle, thinking the system would add it to the project asset list for me. Don't know why I thought that.

Thanks for all the assists. It's in and working now. It looks so nice with all the gradient and lighting effects. Look forward to seeing what other combat effects I can get in, like dirt, rock chunks, blood, more effects for magic and magic weapons, ect.
My Daggerfall Mods: l3lessed Nexus Page

Daggerfall Unity mods: Combat Overhaul Mod

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

Legendoflight44
Posts: 9
Joined: Tue Oct 20, 2020 3:55 pm

Re: [MOD]Ambidexterity Module (Shield Module Branch)

Post by Legendoflight44 »

I'm a little confused it seems you have not updated the git-hub version I'm not sure if you forgot or you're making a different download somewhere else or you are just waiting that's all, sorry if I am being impatient.

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

Re: [MOD]Ambidexterity Module (Shield Module Branch)

Post by l3lessed »

Thanks, let me check.
My Daggerfall Mods: l3lessed Nexus Page

Daggerfall Unity mods: Combat Overhaul Mod

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

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

Re: [MOD]Ambidexterity Module (Shield Module Branch)

Post by l3lessed »

I think I forgot to push it, but to be safe, I reuploaded the mod and zip file too. :D

New version should be up.
My Daggerfall Mods: l3lessed Nexus Page

Daggerfall Unity mods: Combat Overhaul Mod

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

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

Re: [MOD]Ambidexterity Module (Shield Module Branch)

Post by l3lessed »

Pushed new version.

Spark Visual, Animation Timer, & Spark Generation Updates
  • Fixed the spark trail colors being reversed. Now sparks start out bright hot white, then fade to bright yellow, to glowing red like real metal sparks. Also, sparks are smaller and added small light spark effect on initial system spawn.
  • Tweaked animation timer loop to hammer out some unforeseen animation sticking and looping bugs I found.
  • Added spark effect to all parry types; now generates when doing successful active parry, passive swing parry, and npc enemies attacking and parrying each other.
The addition to note here is the additional spark effects for all parry mechanics. Now, when you do a successful attack parry (using an attack, instead of an activated parry) it will also generate the sparks for cool visuals and also a que of what is happening mechanics wise.

The coolest part of this is I also have it working for NPC on NPC fights. NPC's, for a while, have been able to actively parry one another by attacking at the same time (Just like a player vs npc fight). Now, when two npcs fight and one parries the other, you will see sparks, on top of the knockback effect.

KNOWN BUGS
  • Visual bug with sparks: when fighting larger/taller enemies, like humanoids, the spark generates down by their feet. Need to find a way to easily adjust this to align with enemy center/attack area no matter enemy type.
My Daggerfall Mods: l3lessed Nexus Page

Daggerfall Unity mods: Combat Overhaul Mod

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

User avatar
NikitaTheTanner
Posts: 353
Joined: Sun Oct 18, 2015 7:57 pm

Re: [MOD]Ambidexterity Module (Shield Module Branch)

Post by NikitaTheTanner »

Sounds real cool! Going to finally give mod a try :D

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

Re: [MOD]Ambidexterity Module (Shield Module Branch)

Post by l3lessed »

Thanks. Let me know if you find any issues.

Also, I did not get to restoring the bow classic offhand mechanics yet, which is mentioned a few posts back.
My Daggerfall Mods: l3lessed Nexus Page

Daggerfall Unity mods: Combat Overhaul Mod

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

User avatar
NikitaTheTanner
Posts: 353
Joined: Sun Oct 18, 2015 7:57 pm

Re: [MOD]Ambidexterity Module (Shield Module Branch)

Post by NikitaTheTanner »

Not sure if it's connected to the mod, or if it's something else I have enabled - just recently the villagers started being assaulted by me simply passing by, even though I have my weapon sheathed. Maybe it's the improved riding mod and not this one though, I just didn't notice any issues before.

Post Reply