Skip to content

Changelog v5.1.0

enso-x edited this page May 28, 2026 · 1 revision

HyGuns Plugin 5.1.0 Changelog

Overview

Version 5.1.0 adds the first complete weapon attachment syst*em and moves weapon stat changes to composable settings modifiers. It also adds attachment inventory UI, attachment-aware zoom and fire sounds, dynamic weapon tooltips, visual weapon states, and the runtime safeguards needed for attachments that change ammo capacity.

Added

Weapon Attachments

Added asset-driven weapon attachments:

  • attachment type JSON files under Server/HyGuns/AttachmentTypes
  • item-level HyGuns.AttachmentSettings
  • weapon-level HyGuns.WeaponSettings.SupportedAttachments
  • weapon-level HyGuns.WeaponSettings.DefaultAttachments
  • runtime attachment registries for attachment types and attachment items
  • compatibility checks for slot type, wildcard slots, conflicts, and per-type max counts

Attachment types are content-defined. The plugin does not hard-code type names such as Scope, Magazine, or Silencer.

Attachment Inventory UI

Added Hyguns_OpenAttachments and a custom attachment inventory page.

The page shows:

  • one attachment grid for the held weapon
  • slot icons from attachment type assets
  • wildcard slot tooltip text as Any attachment
  • player storage and hotbar in one player grid
  • drag-and-drop movement between player inventory and attachment slots
  • dimmed incompatible player slots for non-attachment items

Attachment slots are generated from SupportedAttachments, ordered by visual/indexed slots first, then named slots, then wildcard slots.

Attachment Settings Modifiers

Added WeaponSettingsModifier and NumericOperations.Operation.

Ammo and attachments now use SettingsModifiers instead of old override-style data. Numeric fields can use operation strings:

  • *0.75
  • /2
  • +10
  • -0.02
  • =5

Attachment modifiers are applied before ammo modifiers, so ammo remains the final authority for values such as special fire cooldowns.

Attachment-Aware Weapon Settings Resolver

Added a shared effective weapon settings resolver used by weapon actions. It combines:

  • base HyGuns.WeaponSettings
  • interaction-level settings overrides
  • installed attachment modifiers
  • selected/loaded ammo modifiers

This makes shooting, reloading, zoom checks, guidance, wall penetration, tooltips, and capacity normalization use the same effective settings path.

Attachment Zoom Overrides

Added optional HyGuns.AttachmentSettings.ZoomSettings.

Any attachment type can provide zoom settings. Scope interactions use installed attachment zoom settings when present, without hard-coding a scope attachment type.

Attachment Fire Sound Modifiers

Added optional HyGuns.AttachmentSettings.FireSound.

Added Hyguns_PlayWeaponFireSound, which plays world/local fire sound events while applying installed attachment volume modifiers. This enables silencers and other sound-changing attachments.

Attachment Visual States

Added automatic weapon item state switching based on installed visual attachments.

Weapon states are built from visual attachment type ids in SupportedAttachments Index order. For example:

  • Scope
  • Silencer
  • Scope_Silencer

The generated key is matched directly against the item State block. Runtime id, ammo data, and embedded attachment containers are preserved during state switching.

Default Attachments

Added HyGuns.WeaponSettings.DefaultAttachments.

Weapons can now create default attachment item stacks when initialized for the first time. This is used for weapons that should be crafted with a scope or another attachment already installed.

Attachment Condition Interaction

Added Hyguns_AttachmentsInstalled.

This interaction checks whether the held weapon has at least one or all requested attachment types installed. It is intended for chains such as "only allow zoom when a valid optic is attached".

Item State Interaction

Added Hyguns_SetItemState.

This switches the held item to a Hytale item state while preserving HyGuns runtime metadata.

Dynamic Weapon Tooltips

Added weapon ItemStack tooltip generation and update logic.

Weapon tooltips now show runtime-derived information such as:

  • selected ammo
  • effective weapon stats
  • stat deltas from attachments
  • installed attachments
  • attachment modifiers
  • special attachment effects such as zoom support and fire sound volume changes

Tooltip updates are limited to weapon creation/initialization, attachment changes, ammo type changes, and one pass on player login.

Ammo Capacity Normalization

Added normalization for weapons whose attachments change ammo capacity or reload amount.

When attachment changes reduce current capacity below the loaded ammo count, the overflow is returned to the player instead of disappearing on the next shot.

HUD Runtime Cleanup

Simplified the HUD runtime by replacing the previous multi-HUD bridge classes with the current HudScreenHud path.

Changed

Weapon Settings Key

Weapon assets now use:

"HyGuns": {
  "WeaponSettings": {}
}

instead of the older HyGuns.Settings examples.

Ammo Settings Modifiers

Ammo assets now document and use SettingsModifiers. Numeric operation strings are supported for the same weapon stat fields as attachment modifiers.

Zoom Interactions

Scope_Zoom, Scope_Zoom_In, Scope_Zoom_Out, Scope_Step_Zoom, Hyguns_SetZoom, and Hyguns_CheckZoom were updated to work with the shared zoom state and attachment-provided zoom settings.

Shooting and Reloading

Hyguns_Shoot and Hyguns_Reload now resolve effective weapon settings through the shared resolver so installed attachments and selected ammo are accounted for consistently.

Documentation

Updated JSON and interaction wiki pages for:

  • attachment type files
  • attachment item settings
  • weapon attachment slots
  • default attachments
  • visual states
  • settings modifiers
  • numeric operation syntax
  • new attachment interactions
  • attachment-aware fire sounds and zoom settings

Fixed

  • Fixed attachment slot order changing across server restarts by generating deterministic slot definitions.
  • Fixed attachment containers failing when weapon capacity increased after an item already had an older smaller container.
  • Fixed attachment slots duplicating identical items during UI transfers.
  • Fixed player inventory and hotbar rendering in the attachment page.
  • Fixed drag-and-drop ambiguity when identical attachment item ids existed in both player inventory and weapon attachment slots.
  • Fixed closing the attachment page producing invalid window id errors.
  • Fixed installed attachment validation for wildcard slots and conflicting attachment types.
  • Fixed weapons losing ammo when an attachment that increased capacity was removed.
  • Fixed ammo modifiers being overridden by attachment modifiers in cases where ammo should be authoritative.
  • Fixed dynamic tooltips repeatedly appending duplicated generated text.
  • Reduced noisy debug logging from asset scans.

Compatibility Notes

Content should use HyGuns.WeaponSettings for weapon data.

Ammo and attachment stat changes should use SettingsModifiers. Old override-style documentation has been replaced by operation-based modifier examples.

Fire sounds that must be affected by attachments should be played through Hyguns_PlayWeaponFireSound, not through the standard interaction Effects.WorldSoundEventId / Effects.LocalSoundEventId on the same shot.

Short Version

HyGuns Plugin 5.1.0 adds content-defined weapon attachments with custom slots, wildcard slots, conflicts, default attachments, visual weapon states, zoom overrides, fire sound modifiers, dynamic weapon tooltips, and attachment-aware weapon stat resolution.

Clone this wiki locally