As a result, I have decided to begin a second module that is an updated branch of the shield module, and I will call it the Ambidexterity Module; I think you can figure out why I am naming it that. Look at the magic I created this evening.
What's Done/Included:
Blue = New Features
- SHIELD MODULE: Everything from the original, plus anything I add further down.
- COUNTER ATTACKING/PARRYING: You can time your attack against your enemy's attacks to counter them zeroing out damage and knocking you both away from one another, but it must be timed to your weapons hit frame (The second render frame).
- OFF-HAND WEAPON WITH FULL ATTACK ANIMATIONS: Already recreated the animation system and implemented a full fps weapon for the off hand, including attacks and attack animations. It mimics the traditional system down to the frame. Weapon animation/times are exactly the same as default and hit ray is tied to the hit frame and animation time like traditional DF FPSWeapon system. Should feel exactly the same as your main weapon.
- SMART/RESPONSIVE KEY INPUT: The mod will monitor for the attack keys. Upon detecting the player pushing either one, it will begin the smart input system using c# queue class. From here, it will allow you to begin a parry up for a small window before beginning the swing. Once the attack starts, it will monitor for follow up key presses, and will start chaining attacks if it detects a new attack triggered them during the current attack last frame.
- BASIC CHAIN ATTACK COMBO SYSTEM: Using the key input detection system, you can prime a follow up attack during the current attack to keep the momentum of your attacks/body/combo going. The moment you stop this chain of attacks, it resets, and you have to wait the small attack primer window before beginning another chain of attacks (Defaults to .16 seconds but it adjustable in mod settings).
- WEAPON PARRY: A short animation that has you put your weapon up to try a momentary weapon parry. Will be for offhand weapons and two handed weapons. Will play counter attack animation, stun enemy for a moment, and allow quicker counter attacks.
- WEAPON PHYSICS SIMULATION/MULTIPLE RAYCAST CODE- DF engine begins sending out raycasts on every frame. Once it hits an object, the raycasts stop. A bool trigger then tells the animation system to replay the animation backwards at an accelerated rate. This simulates a hit and collision. Marking it as finished, but plan on smoothing animations at some point. I have inserted in a coding loop so hit detect raycasts will continually shoot out from the players camera to simulate actual weapon swings from beginning to end. Currently raycast stops on first object hit detection. Uses weapons animation time to sync raycast and time their shots (shoots about 30 within a normal animation). As each raycast is shot, a lerp vector transform moves it along a defined axis based on the animation time. Once an object is hit, raycast stop, fps collision animation begins, and player sets back to idle. Marked as finished, even though I have to refine the vector offsets for the animations.
- PARTICLE SYSTEM/WEAPON SPARKS - Setup particle system and created realistic looking metal sparks for succesful parries. Particle system emits between 15 and 30 metal sparks, each one a unique tiny 3d mesh with collisions. Also, the mesh changes colors, emits light, and has trails, all changing overtime to mimic real life sparks.
- DYNAMIC HANDS - both hands will always animation during an attack. Non-attacking hands moves out and back into view as attack animation plays to mimic natural attacking body movements. Will add this to primer attack window too, so weapons pull back quickly before initiating attack to mimic more natural, real attacking movements.
- CONFURGABLE WEAPON PROPERTIES - Added code and text file to allow users to set a number of unique weapon properties to whatever they see fit with the simple editing of a text file. This includes changing individual weapon attack range, individual weapon attack speeds, individual unsheathed movement speed, and individual attacking movement speed. This also support addition of any mod added item template weapons through the addition of a single line to a text file.
- MOVEMENT BASED ATTACKS - Added code and setting to enable attack based on last movement direction. Only allows left, right, down, and up since we only have 4 movements.
- DIRECTION BASED ATTACKS - Added code and setting to enable attack based on mouse yaw direction.
- WEAPON/SHIELD BOBBING - restored weapon and shield bobbing animation code. When toggle on in settings, weapons and shields will bob up and down while moving. Works with classic animations too, but it looks best with modern smooth animations enabled.
- DREAM Texture Support - Added in custom animation code for all animations to ensure animations smooth and play properly with DREAM Textures.
- ANIMATION SMOOTHING *BETA* - You can now try animation smoothing by turning off classic animations under settings. When turned off, you get smooth animations. It limits you to left, right, down, and up attacks, since down-right and down-left are very hard to smooth properly.
AUTOPATCHER FOR POPULAR MODS - My mod will now detect if either DREAM or Physical Combat & Armor Overhaul are installed. If so, it will enable DREAM textures and/or Physical Combat & Overhaul Formulas to ensure the mods are compatibility out of the box with this one; Let me know if there are others needed.
- When installing the mod, you will find a WeaponProperties text file within the "streamingassets/mods/" folder, where the mod file is put.
- When you open this file, you will find all the weapon properties listed by their weaponID as the first time.
- From here start modifying the properties however you wish, and they will load on the fly anytime you equip a weapon. No need to relaunch the game. the text file is read dynamically on weapon equip once to ensure most up to date text file values are loaded into engine.
- Once done, save the file, and load or alt tab to the game and play with your custom weapons now.
*any dash symbol "-" put within the text line will mark that line as none usable comments and will ignore it. Use the "-" to add any custom comments about your changes, if you wish.*
- Item/Weapon ID: This is used by the code to figure out which properties go to which weapon/item. I've already added the ids for all classic weapons. If you have any custom weapons from mods, you can add them using their itemtemplate id.
- Reach: The attack range of the weapon. This is a raw float value, with classic defaulting to 2.25f for all weapons.
- Unsheathed movement: How much the weapon slows you down when unsheathed in hand. This is a float value used to scale base values by percentage. use 1 for default 100% and change from there.
- Attack movement: How much the weapon slows your during attacks. This is a float value used to scale base values by percentage. use 1 for default 100% and change from there.
- Attack Speed: How fast or slow compared to classic speed the weapon attack is. This is a float value used to scale base values by percentage. use 1 for default 100% and change from there.
- Offhand Allowed: Can this weapon be equipped in the offhand? This is a float value being turned into an int/bool switch. This needs to be 0 for No the weapon not being equippable in the offhand and 1 for yes, it can be equipped in the offhand.
- More Mod Settings for more customization
Patches for most commonly used combat mods. They will be ready before public release to ensure players don't have to choose between mods.Exploring weapon sparks/debri on object/parry hit.- Melee blocking/parrying for stopping melee attacks but not weapons.
Animation smoothing (As seen in my combat Overhaul project).Unique weapon attack reach.Movement modifiers for unsheathed state and when in attacking state.
- Setup the key using the proper unity keycode property name from the list on this site: https://docs.unity3d.com/ScriptReference/KeyCode.html
- Parry: Offhand Weapon Key + Mainhand Weapon key
Green = Bug Fix Submitted but waiting for player testing to confirm fixed.
Yellow= Bug Fixed but not submitted.
Red = Currently debugging.
Purple = Reported Bug.
- Parry animation shows slight artwork clipping for certain weapons. This is a result of the devs never expecting the artwork to move on screen. I'll fix this through some offsetting or an updated parry animation.
- Using left handed settings doesn't break the mod, but your right swing animation will be jumpy and glitchy when using smooth animations. It will get fixed in next release.
Melee attacks do not have hit arcs built for them yet, so when using melee attacks you will still get large weapon arcs. This will be fixed on next release.Sparks generate at larger enemies feet. Need to move generation location to hitcast location.Drag mouse attacking broken again.Weapon hit trace still happens when weapons are sheathed/not showing.Parry animation glitches out on successful parry.Bow equip state largely broken and buggy. Will add bowstates to remedy this issue. Will add vanilla mode, plus add mode for added offhand render.Enhanced bow setting breaks bow and render states when enabled and bow equipped. Now checks and restores enhanced bow mechanics.Can swap weapons during attacking but shouldn't be able to.Bow doesn't disappear on reload.Weapons do not disappear during equip.Weapons do not disappear during swapping.Can't attack villagers or guards.Offhand stops rendering when equipping shield without weapon.Equipping from a shield to a bow the bow breaks the shield and will stay there forever without switching to something else.Downright attack animation for the offhand is misaligned, which shows the art clipping border on the first frame.Shield breaks when using left handiness setting. This is a result of how ambidexterity manager assigns each hands item object and how the base game sets up player equipped items when in shield state.When using physical weapons & left-handedness, hit arcs don't flip also and cause reverse alignment.Casting hands render over duel wield gui hands.Werebeast state offhand breaks when loading a save in form.Enemy Paralysis effect doesn't stop attacking or hide weapons during effect. Fixed: copied the weaponmanager check over to ambidexterity script.Input manager routine has a state stuck bug. Every now and then, it won't clear the input que and will cause a parry when initiating a new attack.
TEST VIDEO OF PARTICLE SYSTEM/WEAPON SPARKS
Download At l3lessed's MOD Hub