Skip to main content

Extending Cube Weapon

Extend content through master/part assets, supported stats and controller/character interfaces. Keep your own assets in project content to simplify plugin updates.

Add a Weapon Platform​

  1. Create a concrete Weapon Master asset with its ID, mesh, weapon type and stats.
  2. Create or reuse compatible parts.
  3. Register the master and parts in configured databases.
  4. Define build values or presets using their IDs.
  5. Import/create, explicitly validate, acquire and equip through the operation workflow.

Asset creation alone does not register content. Update the database Table entries and Project Settings when adding databases.

Part Compatibility and Statistics​

Configure CompatibleSlot, WeaponTagsFilter, PartTags, GrantedCapabilities and BlockedCapabilities on PDA_WeaponPart. SubSlotSockets lets a part provide additional slots for children.

Assign PDA_WeaponStatModificator assets through StatModifiers. The runtime builder collects the modifiers from installed parts, evaluates Condition and WeaponModifierFilter, applies supported fields, then normalizes statistics.

Tag filters use exact required/blocked tag checks. Modifier lifetime/stacking metadata exists on the asset, but this build-statistics pass does not implement timed expiry or enforce the stack limits. Do not infer those behaviors from the editor fields alone.

External Allocation and Pooling​

Use CreateAcquireOp with AllocationType = External. Implement I_WeaponController::AcquireWeaponExternal to supply an appropriate weapon actor with the correct owner, weapon type, registration and allocation state.

Use WeaponUnequipCallback for allocation-aware cleanup or pool return. Test registration and reuse against the actor's runtime-clear/rebuild behavior.

Internal allocation selects built-in classes from ECustomWeaponType. The master does not contain a custom actor-class property. To allocate a custom actor subclass, use external allocation or modify the allocation implementation.

New Behavior and Weapon Types​

The built-in allocation types are Melee, Range and Throwable. Adding a new enum/actor family or changing operation routing requires C++ changes. Content variants within a supported family can reuse existing assets and operation paths.

The current routed attack implementation handles Range; its Melee and Throwable branches are empty. New projectile, melee damage, explosive or special-ability behavior needs a concrete project/plugin implementation rather than a new build record alone.

See Implementation Limits before extending incomplete behavior.