Data Assets and Databases
Cube Weapon separates reusable definitions from build instances. Data Asset fields are generally EditDefaultsOnly and BlueprintReadOnly; author content in the editor and keep runtime configuration in build structures.
Weapon Master
UPDA_WeaponMaster is an abstract UPrimaryDataAsset. Concrete UPDA_WM_Range, UPDA_WM_Melee and UPDA_WM_Throwable classes provide the corresponding content families.
| Field group | Fields and purpose |
|---|---|
| Identity | WeaponID, WeaponType, WeaponDetail |
| Visual | MeshType, StaticMesh, SkeletalMesh, WeaponAnimInstance |
| Slot providers | SubSlotSockets: slot tag → FWeaponSocketArray |
| Compatibility | WeaponTags and RequiredParts |
| Statistics | Hard reference to UPDA_WeaponStatsBase through Stats |
| Effects | Soft WeaponFX reference and soft SideEffects array |
RequiredParts contains required installed slot tags, not direct part assets. The master has no actor-class property, current-ammo field or collection of installed parts. See The Weapon Master.
Weapon Part
UPDA_WeaponPart is a concrete UPrimaryDataAsset.
| Field | Meaning |
|---|---|
| PartID | Registered asset identity |
| CompatibleSlot | Accepted hierarchical slot-tag family |
| WeaponTagsFilter | Exact required/blocked tags on resolved socket provider |
| MeshType, StaticMesh, SkeletalMesh | Selected visual representation |
| SubSlotSockets | Child slots exposed by this part |
| PartTags | Part's tags used by compatibility/stat evaluation |
| GrantedCapabilities, BlockedCapabilities | Build capability accumulation and conflict check |
| StatModifiers | Hard references to UPDA_WeaponStatModificator assets |
| SideEffects | Soft effect references |
IsDataValid supplies editor validation. Runtime compatibility is a separate explicit build operation. Reusing a part across platforms requires compatible slots and provider tags.
Socket Baking
Master and part assets expose the editor action BakeMeshSockets. Both clear the existing SubSlotSockets map before rebuilding it. A socket named Slot_Barrel_Muzzle derives Cube_Weapon.Slot.Barrel.Muzzle.
The master requires the full derived tag to be registered; the part can use the deepest registered parent along the path. Review the baked map, especially when using tag families for multiple sockets. Character attachment sockets are independent of this naming convention.
Databases
| Class | Base | DBType | Table value |
|---|---|---|---|
| UPDA_WeaponDatabase | UDataAsset | WeaponMaster | TSoftObjectPtr of UPDA_WeaponMaster |
| UPDA_WeaponPartsDatabase | UPrimaryDataAsset | WeaponPart | TSoftObjectPtr of UPDA_WeaponPart |
| UPDA_StatModifierDatabase | UPrimaryDataAsset | StatModifier | TSoftObjectPtr of UPDA_WeaponStatModificator |
| UPDA_SideEffectDatabase | UPrimaryDataAsset | SideEffect | TSoftObjectPtr of UPDA_SideEffectBase |
Each database exposes DatabaseName, DBType and TMap<FName, ...> Table. Editor registry actions include RebuildRegistry and AddMapEntry. Use the asset's WeaponID, PartID, ModifierID or SideEffectID consistently as its table key.
Duplicate IDs in the same target cache are logged and skipped. The shared WeaponDBTypeLookup maps each ID to one type; make IDs unique across types as well. Adding content in the Content Browser does not automatically update configured tables.
UWeaponSettings
Settings use Config=WeaponSubSystem and are shown under Cube Game Systems → Weapon SubSystem. Configure WeaponMasterDBs, WeaponPartsDBs, StatModifierDBs and SideEffectsDBs with soft database references.
| Actor family | Default skeletal components | Default static components |
|---|---|---|
| Base | 1 | 1 |
| Melee | 0 | 1 |
| Range | 1 | 20 |
| Throwable | 1 | 1 |
These counts are consumed by actor constructors when creating default subobjects. Provide capacity for the master plus every installed part of each mesh type. Restart the editor after changes; existing actors are not resized.
DragVisual is a soft class reference for the drag/drop visual widget. See UI Helpers. Full fields and their defaults are in Header Reference.