Customizable weapon sway with million MCM options.
Description:
Just a weapon sway based on animation camera effect. In BHS version If you tweak MCM options - most of them will be applied to only weapon sway with healthy arms, penalties are handled by BHS.
Oh yeah, you need MCM if you want to change things - >>> GET IT HERE <<< .
Hold Breath feature: Hold "Use" button (Default "F") to hold breath while aiming. When you hold your breath the timer is ticking, the longer you hold it the longer it will restore.
(Added option to disable it because I don't really like the look of animation reset and I'm sure some people will feel the same, but since many asked for it - it's still here).
Installation:
FOR 1.5.2: You need new version of Body Health System (it allows me to use its variables from other script). Then it's regular installation (Remove previous version of addon if you had it and also change Release breath power option after installing to 0.04).
New BHS update contains only 2 changes that I needed:
maxhp={}
health={}
These two lines must NOT have "local" before them like in previous versions or other BHS-based addons. So it's easy if you want to make it by yourself for some other addon that changing BHS script.
FOR 1.5.1: Install normal version if you don't use Body Health System.
Install Body Health System version if you play with lattest Body Health System (old versions of BHS are not supported anymore).
Adding your animation effects:
Choosing custom animations will result in crash and will be a sign that you skipped description. It's there for people to easily swap between their own animations and mine.
If you want to add some other animation, just drop any .anm to "anims/weapon_sway/", rename to sway_3 or sway_4 (or overwrite mine) and choose them in MCM. Animations I use are two lightest earthquakes from default Anomaly (they fit very well).
Leave the comment if you want me to add some other factor to MCM.
Changelog:
- v1.0:
- Rewrote everything and updated to 1.5.2 that added new cool features for modmakers and especially this addon, plus added better compatibility. Animations now don't need to reset and don't look clunky anymore. Now with smooth animations it's how I always wanted it to be ;]
- Sway penalty from Holding Breath is not constant anymore and based on how long it's been held.
- With the help of demonized and Raven - added MCM option for Body Health System compatibility.
- Don't forget to remove old version if you had it, I had to rename script to load last.
- I also changed the "Release breath power" MCM option to fit the smooth animation power change. Your config after previous version might be set to MAX now, change new one to 0.04 (current default).
- (Removed couple of redundant options).
- v0.52:
- MCM option for hold breath keybind, update MCM too!
- v0.51:
- Nothing serious, just small MCM tweak to fix a bug where chosen animation option was changing to non-existent one and stayed there forever. (tnx to Edzan)
- v0.5:
- Handling weapon stat and its upgrades affect weapon sway. (tnx to Kolaris for idea.)
- Removed patches for older BHS versions, just a heads up in case someone still want to play with older BHS versions - do not update Weapon Sway to 0.5.
- v0.43:
- Test patch for new BHS version (not the main BHS but the other one). I didn't test anything and don't have time for all of it, will leave it up to you ;]
- v0.42:
- Small BHS version fix for scopes having big sway.
- v0.41: Minor update for people who spam button ;]
- Timers for Hold breath sounds:
- "Breath in" sound has 2 sec cooldown;
- "Breath out" sound will be played when breath was being held for 3 or more seconds (or every time you hit max timer, just to let you know).
- v0.4:
- v0.3:
- Added ability to put a weapon on an obstacle infront of you to reduce weapon sway.
- Some more MCM options for it and debug to display stuff.
- v0.21:
- Patch for text version of Body Health System (totally forgot about it).
Looks very interesting, can't wait to try it out. Good job bro!
One thing of note, would it be possible to "cancel" out the sway if you were up against a box/wall/sandbags/etc? Canceling sway would change up combat dynamics. If you wanted to take a more difficult shot, you would need to maneuver to some kind of cover to rest the weapon upon. Also, does the sway go away if you're prone? Crouching/Standing obviously there should be sway, but prone you'd be able to have a prone supported position and pretty much reduce most sway in real life.
Prone is Low Crouch in settings, you can set it to 0 to disable sway while in low crouch body state ;]
About sandbags and walls I'm not really sure if it's possible. Will take a look.
I think it's possible with ray casting and adding an angle from center ray casting to the bottom and left right side of the screen versus ray cast center of the screen.
If ray casted center distance > ray casted distance bottom or right / left side of the screen it means actor is near a wall.
Added, but only for obstacles infront of you (with a small side radius), x z axises are pain to play with.
tnx Grok for a tip ;]
you're a genius!
Damn bro, that's awesome. Thank you!
Edit: Damn beat me to the first comment ↑
Nice
lol
I already cannot hit the broad side of a barn, knowing this exists and there is a nonzero possibility that it can be downloaded and installed on top of my game makes me seriously nervous.
Good job.
for even better experience multiply ammo dispersion by 10 ;]
(but honestly even that won't feel too much of a difference...well, still better than vanilla values)
When I try to load my game, it crashes. I have BHS Installed and below that your BHS Version. Here is the error log:
FATAL ERROR
[error]Expression : xml_doc.NavigateToNode(path,index)
[error]Function : CUIXmlInit::InitStatic
[error]File : ui\UIXmlInit.cpp
[error]Line : 154
[error]Description : XML node not found
[error]Argument 0 : body_health_system
[error]Argument 1 : ui\ui_custom_msgs.xml
stack trace:
Forgot that text based BHS version is different and need patch too, sorry, fixed.
(Google translator) Do you remember in some version of RC# there was a swing of weapons when the character was walking? Then the developers removed it. I've been trying to get this swing back for three weeks now, but it doesn't work out. Could you do that?
What swing? You mean when you stand still the weapon swing (like from breathing)?
Youtu.be Using the example of the desolation mod, this is exactly what I want to do - swinging the sight when walking, but not only with the sight on, but also without. In older versions of anomaly, this was
That's... something entirely different of what this addon does xd I have no clue how to manipulate the gun itself sorry. This addon simply plays camera animation.
I see, thank you for the quick answer. Can you suggest someone who can tell me how to do it?))
Anomaly devs maybe.
i think it's weapon_sway console command that you're talking about
Compatible with BaS?
Yea
Dead Air had a nice sway mechanics, when depending your stamina it was higher or lower and if you wanna "mantain breath" for reduce it, it consumes stamina faster.
Gonna look wonky coz u have to reset animation to play its new power of effect. Will try to replace animation for camera direction in the future, this will open a lot of new possibilities as hold breath, stamina dependency etc. ;]
I keep getting this error:
FATAL ERROR
[error]Expression : <no expression>
[error]Function : CObjectAnimator::LoadMotions
[error]File : ObjectAnimator.cpp
[error]Line : 47
[error]Description : fatal error
[error]Arguments : Can't find motion file 'weapon_sway\sway_3.anm'.
Ye well, it's because there is no sway_3.anm in files.
There are currently only 2, I left these options open for people to add their own (which I described in description).
What's the difference between this one and Beef's one?
Beef's addon using vanilla's sway, which you can change but it's very hard to do because it's in ltx and you gotta refresh game for every single change, plus it's not very understandable (on paper) which values do what or how they change certain thing. Some other thing is that vanilla's sway breaks up animations once you set it too high (the value I desired did it for me, that's why I had to make my own).
This addon is controlled by script and have a lot of MCM options so you can change it in game to your liking, add different camera animations (there are plenty in Anomaly files or you can yoink from other mods). Plus some new features that I want to add and the one I just added (to put a weapon on obstacle to decrease sway), with the intention to make all of them adjustable via MCM. ;]
Oh I see thank you so much
There's any way to install the addon without MCM?
You can install it without MCM, it's gonna work but if you'd like to change anything you'd need to do it manually in "_mcm.script", it's not hard but why? MCM is a simple drag and drop tool that does not conflict with anything and many addons use it.
What’s the correct load order to use with groks bhs?
1. BHS
2. Weapon sway BHS
(and if u use text version of BHS then 3. Weapon sway BHS text ver)
Getting a CTD after zooming in a ACOG scope with an BaS M4A1. Using the BHS normal version patch.
ctrl+v error here
FATAL ERROR
[error]Expression : <no expression>
[error]Function : CObjectAnimator::LoadMotions
[error]File : ObjectAnimator.cpp
[error]Line : 47
[error]Description : fatal error
[error]Arguments : Can't find motion file 'weapon_sway\sway_3.anm'.
stack trace:
Is this enough info? I'm using default settings btw
actually duping one of the anims and renaming it did the trick, so the game thinks it exists.
There are only 2 existing sway animations, all "custom" ones are for people to add their own.
I should probably delete custom options xd
Together with Grok's Body Health System Redux_1.6.7 this works well only when there are no injuries to the limbs. If the limbs are damaged, the swing of the weapon completely stops. But it is necessary to cure the injury and the swing of the weapon resumes.
Without your addon, but with Grok's Body Health System Redux_1 installed.6.7 it was the opposite. In healthy hands, the weapon did not swing, and if the hands were damaged, it was very difficult to aim.
****, sorry ;[
fixed.
Thanks for the feedback, but the problem persists.
Now there is a swing of weapons on damaged hands, but it is much less than on healthy ones.
Yup the intention wasn't to make this addon be based on BHS, patch just makes it work with it cause otherwise it would play both animations. If you wana play with BHS you need to tweak down some MCM configs. Default values in BHS version are same as in non-BHS version.
(I really didn't want to change BHS script itself, more like making it compatible only)
Although, there is MCM coming for BHS too soon (hopefully) ;p
Which will make it easier to tweak BHS's sway instead.
Can you also do something that reduce the sway if you're near a wall using the leaning movement? i mean, like if you're standing the weapon on the side of the wall when aiming...
dunno if it's realistic, but this is what i would do if i do need more stability with my weapon but i don't have any objects around
Edit: should be even more awesome if you manage to do the shift key while aiming to hold breath and getting more stability, i noticed there's already the heartbeat sound while aiming dunno if is your addon or the prpject inertia addon, but is a great addition! Now i can feel the tension behind aiming a dude
I think it is a good idea
Walls are hard to make, only playing with y-axis was easy ;[
I have a script with "hold breath" feature ready, it just looks weird because I wanted to do it correctly: like, to increase sway power afterwards by the amount of time you held your breath. The problem here is that we can't set power factor to animations like we do to post-process effectors. We have to reset animation to play its new power and when sway is big (after holding breath) and we reset animation, camera then jumps into the middle every time. You can see it now too even without this feature, it just isn't very noticeable and doesn't look that bad right now because of sway not being that big.
So, I can't really make it look like it isn't buggy as hell.
I spent 2 days on it and then scratched the idea only because how bad it looks, really tried sorry ;[
(Will try to think of a light version of this feature without animation power as penalty, idk maybe stamina decrease? This one is weird too when you can't run after aiming xd)
Okay I decided to still add the hold breath feature with a few tweaks to make it look less "bad". Will leave it up to you if you still want to play with it ;]
It doesn't actually look that bad with small multipliers...
For the next update can make that the hold breath key be configurable? i really would appreciate it
If I add it to options I will then need to add tons of compatibility patches for every single addon that does that. Also (that's how it works in vanilla) when you hold some key during aiming, then stop aiming while still holding that key and release it - you will perform that action. For example if I bind it to jump and you release button after aiming - the actor will jump. "Use" to me seemed like the less harmful.
Ok for some reason i don't hear the heartbeat when aim anymore :( , dunno what addon does that feature but now is missed, does someone know what addon adds that?
Wow. Unfortunately I'm away on holiday, but this mod looks awesome. The ability to use obstacles to steady your aim is terrific. There's a game called Post Scriptum that does this and it's one of my favorite gameplay feature. Can't wait to get home and try this.
Would it be possible to rebind the key to the "sprint" key? I was thinking if you wanted to add key options for the hold breath feature, you could add a dropdown with acceptable functions to share a key with (sprint, use, etc.)
The thing is - I don't want to add key options ;]
But will add anyway soon... Other actions just gonna be buggy and I'll have reports that are already in description (once I add it) ;[
I dunno if you can limit it to keys/actions that aren't buggy. I feel like the sprint key would work fine, it really doesn't do anything while you're ADS. There's probably others.
It does, once you cancel aim you gonna sprint (if option for toggle turned on... or off I don't remember) ;]
Jump and sprint were my initial thoughts, both are buggy.
Ah poop.