Mods / Melee Weapons Framework

Category: #Library #Weapons
Author: Maltiez
Side: Both
Created: Apr 26th at 5:41 PM
Last modified: Apr 27th at 5:40 PM
Downloads: 624
Follow Unfollow 47

Latest file for v1.19.4:
meleeweaponsframework_0.0.9.zip 1-click install


Requires: Animation Manager

For other modders

Would be nice to collaborate on combat related mod. Would be nice to have somebody to test features, to animate player and items, may be even to write some code, or just do research part. 

Description:

Library for adding melee weapons with collision based hit detection and block with perfect block mechanic. On its own just adds this functionality to vanilla shields, spears and swords (optional, can be turned off with config lib). In the future, Spears and Swords mods will use this instead of FSMlib. For details of how to use it, feel free to ping me in official VS discord server.

Library has two already implemented classes for sword-like and spear-like weapons, you need only json to use them. But also, the library provides a powerful tool for implementing your own custom control schemes using its C# API.

Example of implementing vanilla like weapon control scheme: link to github.

Features for players:

On its own, this mod reworks vanilla swords, spears and shields. It leaves vanilla animations and balance for weapons, but shields are rebalanced due to having a different mechanic. Due to being early in development, sounds for attacks are missing, will be fixed soon. All these features can be turned off individually using Config lib.

  • Collision based hit detection for swords and spears - changes how weapons interact with enemies. Now you have to aim your weapon model when attacking instead of selecting an entity with reticle. Ranged is based on animations and weapon length and not just hardcoded value. Reticle color does not indicate if enemy is in reach anymore.
  • Hit multiple enemies with single attack - if while attacking your weapon goes through several enemies, all of them will receive damage
  • Block with shield using RMB instead of sneak - now to block with shield you have to hold it in offhand and press Right Mouse Button (or some other button if you remapped it) to block enemy attack. Shield no longer provide passive protection.
  • Cant block enemies behind you - now shields can block only attack coming from 240 degrees arc in front of you
  • Perfect block - if you press block right before an enemy attack, you will perform a perfect block that will block 100% of the damage, sound of successful perfect block is also different

Features for modders:

  • Collision based hit detection instead of vanilla mechanism of selecting entity's selection box. Each weapon can have multiple colliders that will collide with entities and terrain, and you can decide what to do in each case, you will also get point of intersection between collider and entity or terrain collision boxes. You can play sounds, spawn particles, stop attacks, play stagger animations - and all the other stuff.
  • Attack direction selector - each weapon can specify a set of direction that can be selected like in Mordhau or For Honor games, it will be passed to your methods that handles attacks, and you can choose what animation to play (in the future directional blocking for players will be added, so it will move pvp closer to mentioned games)
  • Block and Perfect Block - adds more traditional blocking system (with also directional block), block set amount of damage, if timed right will block all damage (perfect block), can have different coverage (direction from attacker to attacked is compated with attacked line of sight, and checked against coverage angles of block being used, default is +-120 deg in pitch and yaw)
  • Custom control schemes - the library provides a convenient and easy way to implement any control scheme. You can add handlers to any events from EnumEntityAction enum, and action state (like being pressed, active, inactive, released or held).
  • Animation Manager lib based animations with more procedural control and entity behavior that manages them and makes sure that player won't stack in animation after death or in any other case of weapon disappearing from player's hands, same goes for stats (like movement speed).
  • Synchronization - weapon logic is purely client side and only for the player that runs the client. All the synchronization and validation is done by the library. It makes it much easier to manage more complex weapons.

Version For Game version Downloads Release date Changelog Download 1-click mod install*
v0.0.9 408 Apr 27th at 5:40 PM Show meleeweaponsframework_0.0.9.zip Install now
v0.0.8 26 Apr 27th at 4:49 PM Show meleeweaponsframework_0.0.8.zip Install now
v0.0.7 27 Apr 27th at 3:08 PM Show meleeweaponsframework_0.0.7.zip Install now
v0.0.5 53 Apr 27th at 1:36 AM Show meleeweaponsframework_0.0.5.zip Install now
v0.0.4 19 Apr 27th at 12:58 AM Show meleeweaponsframework_0.0.4.zip Install now
v0.0.3 24 Apr 26th at 11:22 PM Show meleeweaponsframework_0.0.3.zip Install now
v0.0.2 42 Apr 26th at 7:17 PM Show meleeweaponsframework_0.0.2.zip Install now
v0.0.1 25 Apr 26th at 5:42 PM Show meleeweaponsframework_0.0.1.zip Install now

8 Comments (oldest first | newest first)

💬 Duski, 6 hours ago

This has been great so far, now my weapons feel like there is actual range to em!

💬 Verlia, 1 day ago

I want to like this mod but everything feels really off, even when I try with multiple/different weapons. Maybe when there's some more work done it, it'll feel less weird. 🔍 

💬 snowbal_l, 1 day ago

is the mod compatible with other mods that add more weapon types? 

💬 Rythillian, Apr 30th at 3:32 AM

Very interesting, will definitely require some changes to current animations of weapons in order to make it feel right. Shall watch this with great interest!

💬 MaltiezAuthor, Apr 26th at 11:23 PM

Wandour

It is a bug, I left some debug imgui tools in Release build, fixed in 0.0.3

💬 Wandour, Apr 26th at 10:52 PM

could be outdated which is the cause of the crash
but this is the log just incase

Game Version: v1.19.7 (Stable)
4/27/2024 1:51:41 AM: Critical error occurred in the following mod: meleeweaponsframework@0.0.2
Loaded Mods: game@1.19.7, animationmanagerlib@0.7.14, creative@1.19.7, survival@1.19.7, meleeweaponsframework@0.0.2
System.IO.FileNotFoundException: Could not load file or assembly 'VSImGui_DebugTools, Version=0.0.5.0, Culture=neutral, PublicKeyToken=null'. The system cannot find the file specified.
File name: 'VSImGui_DebugTools, Version=0.0.5.0, Culture=neutral, PublicKeyToken=null'
at MeleeWeaponsFramework.AttackDirectionController.OnGameTick()
at MeleeWeaponsFramework.MeleeWeaponPlayerBehavior.OnGameTick(Single deltaTime) in D:\Projects\VintageStory\meleeweaponsframework\meleeweaponsframework\source\Integration\EntityBehavior.cs:line 57
at Vintagestory.API.Common.Entities.Entity.OnGameTick(Single dt) in VintagestoryApi\Common\Entity\Entity.cs:line 896
at Vintagestory.API.Common.EntityAgent.OnGameTick(Single dt) in VintagestoryApi\Common\Entity\EntityAgent.cs:line 539
at Vintagestory.API.Common.EntityPlayer.OnGameTick(Single dt) in VintagestoryApi\Common\Entity\EntityPlayer.cs:line 678
at Vintagestory.Client.NoObf.ClientSystemEntities.OnGameTick(Single dt) in VintagestoryLib\Client\Systems\Entities.cs:line 95
at Vintagestory.Common.GameTickListener.OnTriggered(Int64 ellapsedMilliseconds) in VintagestoryLib\Common\Model\GameTickListener.cs:line 27
at Vintagestory.Common.EventManager.TriggerGameTick(Int64 ellapsedMilliseconds, IWorldAccessor world) in VintagestoryLib\Common\EventManager.cs:line 57
at Vintagestory.Client.NoObf.ClientMain.MainRenderLoop(Single dt) in VintagestoryLib\Client\ClientMain.cs:line 838
at Vintagestory.Client.NoObf.ClientMain.MainGameLoop(Single deltaTime) in VintagestoryLib\Client\ClientMain.cs:line 730
at Vintagestory.Client.GuiScreenRunningGame.RenderToPrimary(Single dt) in VintagestoryLib\Client\MainMenu\Screens\GuiScreenRunningGame.cs:line 163
at Vintagestory.Client.ScreenManager.Render(Single dt) in VintagestoryLib\Client\ScreenManager.cs:line 676
at Vintagestory.Client.ScreenManager.OnNewFrame(Single dt) in VintagestoryLib\Client\ScreenManager.cs:line 651
at Vintagestory.Client.NoObf.ClientPlatformWindows.window_RenderFrame(FrameEventArgs e) in VintagestoryLib\Client\ClientPlatform\GameWindow.cs:line 88
at OpenTK.Windowing.Desktop.GameWindow.Run()
at Vintagestory.Client.ClientProgram.Start(ClientProgramArgs args, String[] rawArgs) in VintagestoryLib\Client\ClientProgram.cs:line 324
at Vintagestory.Client.ClientProgram.<>c__DisplayClass9_0.<.ctor>b__1() in VintagestoryLib\Client\ClientProgram.cs:line 128
at Vintagestory.ClientNative.CrashReporter.Start(ThreadStart start) in VintagestoryLib\Client\ClientPlatform\ClientNative\CrashReporter.cs:line 93

💬 Wandour, Apr 26th at 10:44 PM

wow this might actually revolutionize the game 

💬 f0xh0und696, Apr 26th at 8:03 PM

i see great things to be born from this framework. congratz.

(edit comment delete)