Zum Hauptinhalt springen

Blueprint Integration

Search for nodes from the Weapon Subsystem categories. Operation helpers are under Weapon Subsystem|BP Lib|Operations; submission is on the Weapon Subsystem object.

Object References​

Get UWeaponSubsystem from your Game Instance. Use the requesting PlayerController, its AC_WeaponNetComp and the controlled Character's AC_WeaponCharComp.

The subsystem exposes GetNetCompForController, GetCharCompForCharacter, GetWeaponRefByGuid and GetWeaponGuidByActorRef with validity outputs. Always check those outputs before using the reference.

Create and Submit Operations​

  1. Call the corresponding Create...Op helper.
  2. Pass bSucceed to QueueWeaponOperation.bCondition.
  3. Pass FailureReason to QueueWeaponOperation.Message.
  4. Pass the returned request to QueueWeaponOperation.Request.
  5. Wait for the relevant delegate/state change before dependent work.

The helper success output only confirms construction. QueueWeaponOperation is a void function. A failed asynchronous validation is reported in the Output Log; there is no universal operation-result return value. FetchBuild also replaces the controller's working build, so finish pending edits before fetching another configuration.

Build Delegates​

DelegateActual trigger
OnWorkingBuildModifiedWorking build mutation on authority; includes old/new values
OnWorkingBuildReplicatedClient RepNotify; includes old/new values
OnWorkingBuildCreatedClient RepNotify when the build GUID changes
OnBuildValidatedCallbackSuccessful explicit validation, including client callback
FetchBuildCallbackBuild data received through the fetch client RPC

For local/authority creation, use OnWorkingBuildModified. Do not wait for OnWorkingBuildCreated on authority, and do not rely on the unused controller BuildCreatedCallback.

Selecting and Firing​

Queue CreateUseOp to select an already assigned actor and move it to a character socket. Use is not a fire command.

For ranged attack input, submit CreateWeaponAttackOp with bCondition = true on press and false on release. Pass the helper's separate bSucceed output to the submission condition. The helper looks up ActualUsedWeapon on the Character component.

Use CreateReloadOp and CreateTriggerFiremodeOp for the corresponding requests. Input mappings remain part of your project.

Inventory and Drop Behavior​

Inventory UI should work with FWeaponBuildData and IDs. Follow Inventory & Weapon Storage when loading a build.

There is no CreateDropOp. A drop/pickup feature needs project logic for its stored build, actor allocation/release, ownership and world representation.

Diagnostics​

Use the subsystem nodes DumpWeaponDBLookup, DumpWeaponLookupTables and DumpBuildData to inspect registration, cached assets and build records. Check logs before treating a successful helper call as successful execution.