Blade & Sorcery
0 of 0

File information

Last updated

Original upload

Created by

lobotomyxyz

Uploaded by

lobotomyxyz

Virus scan

Safe to use

Tags for this mod

About this mod

Press trigger to reverse grip. Highly configurable through ingame mod menu and optional item module overrides. Fresh take on the old dynamic handles module with a new code

Permissions and credits
Added some updated experimental versions. These are totally untested as I'm not currently at home. I think they will do what they say but no promises. You probably should back up your saves and if they're buggy I would wipe the new saves before reverting just to be safe. Check descriptions to understand them fully.

Against all odds my blind, untested builds worked, aside from an attempt to add an ingame feature to disable specific weapons, which I have scrapped. I have done some additional polish and would recommend switching to this version. Major features are improved weapon filtering and configurable activation button. This patch did fix ghetto's firearms which missed my filter earlier, but it does also disable the melee weapons in his pack which I only realized exist during testing. I have no interest in building my mod around someone else's questionable view of what constitutes a firearm, but if anyone particular wants those knives to work you can see the code below and decide what to do. The knives have firearm in their ID which I think could be changed without breaking them completely as I'm not reading the important stuff for retrieving the assets. I just don't care to try right now

I've also finally had time to get some footage so I'd consider this a proper release now rather than an early access mess. Updates will be maintenance only from here on out unless I feel inspired to rewrite some stuff. Probably not as it meets my standards. 



Context:

Sometimes you just want to reverse grip and go stabby mode or roleplay as Starkiller from the Force Unleashed (I actually made this because I was using a costume mod for him and recording cinematic camera footage) and there's no viable way to do this consistently and quickly without using focus (if you disagree or think this mod is superfluous please send me a video of you flipping your grip mid swing because I would love to see that). I actually looked at footage of starkiller's attacks which confirmed that he does constantly switch grips midslash and immediately made it apparent what we're missing: Fingers. We don't have finger control in BAS so the only option is to add an animated button controlled action.

Originally I ported the old "dynamic handle module" to u12 for my own use but after discussing with the author I decided to remake it from scratch (I got permission to reference their code for learning purposes only). This takes it a step further and removes the need for the "dynamic handles everywhere"" mod. A script adds the module to any weapon not marked as a ranged weapon allowing it to be used with any weapon without requiring you to edit any json files. You do however, have the option of manually disabling anything I missed using a json edit. The mod can be paused with an ingame mod option (module is still added to weapons but nothing runs on the main update loops when its disabled) and you also can toggle animations globally ingame or for specific weapons in their json. 

This has been in development on and off (mostly off) since July but unfortunately due to a drive failure and my personal failure with revision control I lost several months of work including many important fixes and features. This is an older version that I decompiled and tweaked just enough to reach my minimum standards for usability and decided to release since its been delayed long enough. Since losing the actual source code all development was done in dnspyex, though its long since passed the point of being more convenient than just building in a real IDE. That said, the code is functional but not formatted to my standards so I have not posted it to github. If you want to build off this, please do so. For small edits you can use dnspyex even with minimal code knowledge, there is zero obfuscation, but unfortunately no comments. If any of the code is weird or sloppy that's probably a compiler generated/formatted line. You can export it to visual studio yourself if you prefer or have larger scale plans. I grant full permission to do anything you want with this except sell it or claim you made it from scratch. 

Even with the rocky development this has become an essential feature of the game for me. This is the only mod to my knowledge to add a button driven player attack animation and it increases defensive utility with a single blade. Its also fantastic for dealing with the gravitationally challenged NPCs if you've gotten tired of crouching down to finish them off every time they trip over their own feet. It works best with lightsabers and daggers but you can use it with large weapons as well.


Usage notes:


Sometimes the flip will not complete but you can see some movement. This is not a bug, you were attempting to swing your weapon through a solid object, possibly yourself. Be sure not to activate the flip too close to a wall or floor. Specifically it checks for penetration, not collision
 which means you can use it as an attack or parry but you can't activate it while stuck inside an enemy. Lightsaber users can briefly turn off their saber to get around this which feels great once mastered. I will not be adjusting anything with environment collision as it could reintroduce bugs ranging from disabled hands to orbital or subterranean launches 

There is some math under the hood to try to adjust the flip direction to swing back and forth, farther from the player, rather than rotating in a continuous circle. Its not perfect so I don't recommend using self-collision        

As of the 2nd public main release you have the option of the Use or alternate use keys which correspond to trigger or A/X on oculus. These settings are completely unaffected by ingame settings and simply add the action to the end of action event, meaning that any other actions like activating a lightsaber or using the Yamato sword slashes will activate along with the flip. Hold to use works as expected                                                                                                                                                                                                               
The exception is sliding which is disabled when using the trigger and only holding the item with one hand as otherwise you'll end up with awkward hand placements after the flip. Gripping with a second hand allows you to freely slide and deactivates the flip function. This is also the case if you grab a weapon an enemy is still holding. Previously you could just press flip and tear their arm off which is funny but not very balanced. Weapons with short handles that don't allow sliding will not be affected by the slide changes but should flip with no issue.

Some mmp daggers with grip points on the blade will flip between the blade and the normal handle. I'd expect similar results with any half-swording/mordhau grip mod. I know neeshka has one, not sure if its gone or just modio exclusive but it did work when I started this last year.

This will suck on some weapons and thats not something I can control without a ton of time adjusting for every possible condition or potentially adding scrip lag. Single-edged weapons are especially tricky, sometimes they work, sometimes they end up facing you or don't flip around the expected axis of rotation. These issues can be caused by differences in handle/grip placement on modded weapons as well as the orientation you grab the handle at. I had added an option that can be added in the json module for each item to indicate a different axis of rotation but as of the most recent version that option is causing issues and shouldn't be used unless you're okay with troubleshooting. 

High quality mods from reputable authors have mostly been okay. MMP works mostly well but some weapons with long handles will shoot you to the end of the handle instead of rotating around where you gripped it. I have tried a workaround where I create a new grip point to rotate around but this introduced a whole host of issues so I've opted not to use that method. I think mod authors just need to fix their handle placement if this is an issue, or someone more knowledgeable than me about the SDK can take a try.

When spawning new items you generally need to release and grab the item again before it can be flipped. this seems to persist across saves so its not a big concern. On that note, if you are having issues and need to try a different version or if you want to modify the script make sure to delete your save as the script may be attached to some weapons still.

You may see null references in your log. These are mostly non-issues due to heavy "Try" abuse without handling every exception (in other words, I've accounted for the errors so it shouldn't break your game, I just didn't write error messages). The issue is probably because the script attaches to each instance of  a weapon rather than globally hooking into the player's controls. The script persists until the weapon despawns and holds its reference to the playerhand even when not held and fixing this caused issues with the two handed function and when playing on an existing save. It seems pretty harmless so I won't fix it unless someone makes a strong case for the errors affecting performance. 



Guns autodisable themselves. Specifically anything labeled gun, firearm, blaster,  if you need to disable a weapon you can add a module to the item json with the following options:

"modules": [
  { 
"$type": "GripFlip.GripFlipModule,GripFlipper",
"animated": true,         //does override global setting
"disabled': true,          //setting false here does not override global disable
"changeAxis" //currently broken
  }


You can make a new json in the gripflipper folder with the same name and identifier so it will merge without having to edit your original json files but you'll need to change gripflipper folder to zGripFlipper or similar so that it loads afterwards late if you want to override other settings. Adding modules will work without doing this.