Universal Weapon Sway

Projects that alter game functions but do not include new maps belong here.
Forum rules
The Projects forums are only for projects. If you are asking questions about a project, either find that project's thread, or start a thread in the General section instead.

Got a cool project idea but nothing else? Put it in the project ideas thread instead!

Projects for any Doom-based engine (especially 3DGE) are perfectly acceptable here too.

Please read the full rules for more details.
User avatar
Boondorl
Posts: 138
Joined: Wed Jul 11, 2018 10:57 pm

Universal Weapon Sway

Post by Boondorl »

Current version: 1.0
Tested on: GZDoom 4.3.3

Github Repo

Universal Weapon Sway is a general mod that seeks to add momentum-based weapon swaying to any weapon in the GZDoom engine. The amount your weapon sways is based off how quickly you turn as opposed to being cumulative giving it a much snappier feeling. Included are both horizontal and vertical sway alongside a plethora of options to customize it to your liking.

Features
  • Horizontal and vertical sway for any weapon in GZDoom
  • Sway based on player velocity
  • Vertical offsetting for weapon sprites
  • Options to customize movement sway, vertical sway, horizontal sway, when the weapon should sway, and more
Showcase
Spoiler: Aiming sway
Spoiler: Movement sway
FAQ
Q: Will this work with anything?
A: It should. If something doesn't work let me know and I'll see what I can do to fix it.

Q: Do I need to load this before or after anything?
A: No, this mod is currently load order independent.

Section for modders

Q: Can I use this in my own project?
A: Yes, you may freely use this in your projects so long as it follows the license. This project is licensed under the MIT license. See the included LICENSE file for more info.

Q: Should I use the Github repo?
A: The Github repo may be updated frequently with more experimental features. Using the version here ensures you'll always have the current stable release, but the choice is up to you.
Attachments
UniversalWeaponSway.zip
(7.28 KiB) Downloaded 5992 times
Last edited by Boondorl on Thu Apr 30, 2020 9:40 am, edited 7 times in total.
User avatar
MFG38
Posts: 414
Joined: Sun Apr 14, 2019 8:26 am
Graphics Processor: nVidia (Modern GZDoom)
Location: Finland
Contact:

Re: [Beta] Universal Weapon Sway

Post by MFG38 »

Wasn't a mod like this already done at one point?

In any case, judging by the videos alone, it looks quite nice. c:
3336655445
Posts: 34
Joined: Wed Jul 24, 2019 6:54 pm
Graphics Processor: Not Listed
Location: Odessa

Re: [Beta] Universal Weapon Sway

Post by 3336655445 »

probably it will be the best weapons sway mod for Doom
3336655445
Posts: 34
Joined: Wed Jul 24, 2019 6:54 pm
Graphics Processor: Not Listed
Location: Odessa

Re: [Beta] Universal Weapon Sway

Post by 3336655445 »

I tested this mod with: Trailblazer, Guncaster, Duke Nukem weapons and monster (v10b) and lambda
this mod works with: Trailblazer and lambda
this mod does not work: Guncaster and Duke Nukem v10b
User avatar
Boondorl
Posts: 138
Joined: Wed Jul 11, 2018 10:57 pm

Re: [Beta] Universal Weapon Sway

Post by Boondorl »

Hmm, seemed to be a problem with title maps. I've released a hotfix for it that fixes the crash on start up and can verify it works with those two mods now.
MFG38 wrote:Wasn't a mod like this already done at one point?
Nash made a weapon sway mod a couple years ago but it doesn't have a lot of customizability and lacks some of the features this one has.
User avatar
Samarai1000
Posts: 160
Joined: Sun Sep 25, 2016 7:04 pm
Graphics Processor: nVidia (Modern GZDoom)
Location: Somewhere in Canada

Re: [Beta] Universal Weapon Sway

Post by Samarai1000 »

3336655445 wrote:*snip*
While I can't speak for the Duke mod, the reason why Guncaster doesn't work with this is due to it having its own "sway" system, based off of Nash's IIRC.
User avatar
bingojohnson
Posts: 24
Joined: Tue Mar 12, 2013 8:29 am

Re: [Beta] Universal Weapon Sway

Post by bingojohnson »

This replaced Nash's mod in my autoload. The sway movement looks very natural. Works fine on GZDoom 3.8.2.
User avatar
Nash
 
 
Posts: 17439
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia
Contact:

Re: [Beta] Universal Weapon Sway

Post by Nash »

bingojohnson wrote:This replaced Nash's mod in my autoload. The sway movement looks very natural. Works fine on GZDoom 3.8.2.
This is literally a 1-line change that I just didn't find time to add and update to my mod (it's technically a bug in my mod, it was doing something wrong which cause the movement to feel floaty) :shrug:

(and before anyone asks, "you don't have time to release a 1 line change?", it's not just that 1 change that my mod is overdue for - there are other issues with it that I need to wrap up, plus I am busy elsewhere with several other different projects)
MrJohnny
Posts: 212
Joined: Fri Aug 05, 2016 8:41 am

Re: [Beta] Universal Weapon Sway

Post by MrJohnny »

Ah, YES... this is very nice. The weapons even sway during the fire states; it feels very fluid. Thanks for this, Boondorl!
User avatar
Ryan Cordell
Posts: 4349
Joined: Sun Feb 06, 2005 6:39 am
Preferred Pronouns: No Preference
Operating System Version (Optional): Windows 10
Graphics Processor: nVidia (Modern GZDoom)
Location: Capital of Explodistan

Re: [Beta] Universal Weapon Sway

Post by Ryan Cordell »

This mod is pretty rad! Though there are some things I noticed..
  • It needs a weapon null check (any mod that can quickly take away and force a different weapon, like DRLA, will make the mod crash otherwise)
  • Aren't all titlemaps actually named TITLEMAP? The check could probably be

    Code: Select all

    gamestate == GS_TITLELEVEL
    or some equivalent
  • Is there an advantage to using StaticEventHandler vs EventHandler?
User avatar
doomfiend
Posts: 526
Joined: Sun Aug 27, 2006 6:10 am
Location: some where

Re: [Beta] Universal Weapon Sway

Post by doomfiend »

Got a little bug it seems, upon moving forward the script forces the weapon to sway to the right a tiny bit. (Disabled movement sway and it sways regardless)
User avatar
Boondorl
Posts: 138
Joined: Wed Jul 11, 2018 10:57 pm

Re: [Beta] Universal Weapon Sway

Post by Boondorl »

Beta 2 is now available! Nothing major included.
Spoiler: Changelog
doomfiend wrote:Got a little bug it seems, upon moving forward the script forces the weapon to sway to the right a tiny bit. (Disabled movement sway and it sways regardless)
I couldn't replicate this. Was weapon bobbing turned off via the HUD menu? If so, that's something it does even without mods.
Ryan Cordell wrote:*snip*
The gamestate and name of the map are very, very different things. This code should only ever run when actually in a playable level which the current check ensures. As for the EventHandler, static wasn't needed before but as an optimization I've made it so CVars are now only updated on level load. Since CVars can't be serialized I need to be able to update them when loading from a save file which only StaticEventHandlers can do.
User avatar
doomfiend
Posts: 526
Joined: Sun Aug 27, 2006 6:10 am
Location: some where

Re: [Beta] Universal Weapon Sway

Post by doomfiend »

what the heck, I disabled my autoload and yes, it turns out it was a gzdoom thing; not your mod. Had I disabled it via decorate it wouldn't slide to the right like that. (defeats the purpose of 0 weaponbob speed if you ask me lol)
User avatar
OfficialYeen
Posts: 25
Joined: Tue Feb 12, 2019 6:08 pm

Re: [Beta] Universal Weapon Sway

Post by OfficialYeen »

I absolutely love how customizable this is and it really brings some life to static weapon sprites. It's part of my autoload and it works with everything else except DoomRL Arsenal, which it outright breaks. Upon assembling a weapon with mods, GZDoom crashes. I'm using GZD version 4.3.3 and RLA version 1.1.4. I have a pretty extensive load order when I play RLA/RPG, and I've done some testing on my own and have been able to isolate this particular mod as the problem, as it will always crash under the same circumstances even when just running it and RLA, without all of my filler stuff. Any idea what could be causing this? I'll provide the crash report if you need it.
User avatar
Boondorl
Posts: 138
Joined: Wed Jul 11, 2018 10:57 pm

Re: [Beta] Universal Weapon Sway

Post by Boondorl »

Are you using the beta 2 version of this mod? If so, can you send a screenshot of the error message alongside steps on how to recreate it? (I have absolutely no idea how to play DoomRL Arsenal so I'm not entirely sure how to quickly assemble a weapon with mods to test it)
Post Reply

Return to “Gameplay Mods”