MeleeSwingCustomization
Adds additional melee customization for devs.
模組介紹 作者原文
MeleeSwingCustomization
Does not require MTFO by default to allow other plugins to use it for QoL.
Customization (Requires MTFO)
Reads custom files under Custom/MeleeSwingCustomization. You can customize the hitbox location for swings (i.e. the attack sphere) and pushes, set capsule hitboxes for swings, and adjust the speed of swing/push animations. Speed adjustments automatically scale attack timings (i.e. MeleeAnimation times). A template file is generated on game launch if the folder does not exist. Files support LiveEdit and immediately apply changes on save. They have the format:
[ // Can contain multiple blocks
{
"ArchetypeID": 4, // MeleeArchetypeID of the target weapon
"Name": "Improved Bat", // Purely for organization
"AttackOffset": "(0 0.55 0)", // Position offset for the attack sphere. null uses the original.
"PushOffset": null, // Position offset the push sphere. null uses the original.
"LightAttackSpeed": 1, // Speed modifier for light attacks/hits
"ChargedAttackSpeed": 1,// Speed modifier for charged attacks/hits
"PushSpeed": 1 // Speed modifier for pushes
"AttackSphereCenterMod": 1.9; // Modifier on attack sphere radius when the hitbox is at the center of the screen.
},
]
AttackOffset also supports capsule hit detection. To use it, specify 2 or 3 offsets. The first specifies the position offset for the attack sphere, while the next two specify the start and end for the capsule, respectively. If a third offset is not specified, the capsule end is set as the attack offset. For exmaple, this makes a capsule hitbox from (0, -0.2, 0) to (0, 0.55, 0):
"AttackOffset": "(0 0.55 0) (0 -0.2 0)"
AttackOffset also supports a larger object definition for further customization:
"AttackOffset": {
"Offset": "(0 0.55 0) (0 -0.2 0)", // Position offset for the attack sphere/capsule.
"EntityRayLengthAdd": 0, // Additional length of the entity-only ray, combined with CameraDamageRayLength. Ignored if 0.
"EntityOffset": null, // Position offset for the entity-only attack sphere.
"EntitySize": 0, // Radius of the entity-only sphere. 0 uses AttackSphereRadius.
"EntityUseCenterMod": true, // Applies the "AttackSphereCenterMod" bonus to EntitySize.
"CapsuleOffset": "(0 -0.2 0)" // Parallel field to Offset that specifies only capsule offsets.
// Useful if you don't want to modify the attack sphere offset.
"CapsuleUseCamFwd": false, // Capsule uses CameraDamageRayLength + EntityRayLengthAdd to compute capsule length.
// Starts at the first capsule offset, drawing towards the second.
// If none are specified, draws from (0, 0, 0) to the attack offset.
"CapsuleCamFwdAdd": 0, // Modifier added with CameraDamageRayLength to compute capsule length.
"CapsuleSize": 0, // Radius/size of the capsule. 0 uses AttackSphereRadius.
"CapsuleUseCenterMod": false // Applies the "AttackSphereCenterMod" bonus to CapsuleSize.
"CapsuleDelay": 0 // Delay after DamageStartTime before the capsule becomes active.
// Can use an object format to adjust specific attacks, e.g.
// { "Light": 0.05, "ChargedLeft": 0.1, "ChargedRight": 0.2 }
}
Short Guide to Melee Hitboxes
Melee follows a 3-step process:
- Direct Hits
- Hits whatever is being looked at within CameraDamageRayLength (MeleeArchetype) distance.
- If something is being looked at within said distance, no other hitboxes can be active.
- Attack Sphere
- Centered on the attack offset, hits any enemy/lock within AttackSphereRadius (MeleeArchetype) of the offset.
- View to Attack Offset
- Checks for hits on a line from the player's viewpoint to the attack offset.
- Hits enemies/locks if AttackSphere hit something, otherwise hits anything.
Capsule hit detection adds an additional 4th step that functions identically to Attack Sphere (but uses a capsule instead).
Examples
Small wall hitbox, normal entity hitbox
- Lower CameraDamageRayLength and AttackSphereRadius and move AttackOffset closer
- Set EntityRayLengthAdd to add up to the intended ray length
- Set EntityOffset a
安裝與使用 安裝:按包內說明操作
- 解壓本站下載的壓縮包,先讀包內的 readme / 說明檔案。
- 多數模組依賴遊戲的模組載入器:常見做法是用社群模組管理器(如 r2modman)選中本遊戲安裝,由管理器自動處理載入器與依賴。
- 手動安裝時,把模組檔案放進遊戲目錄下對應的 Mod / plugins 資料夾。
- 啟動遊戲確認載入成功;帶「前置依賴」的模組需要把依賴一併安裝。
不同模組的安裝位置差異較大,包內說明是最可靠的依據。
下面這些內容需要先安裝,否則該模組不會生效: