Skip to main content

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 groupFields and purpose
IdentityWeaponID, WeaponType, WeaponDetail
VisualMeshType, StaticMesh, SkeletalMesh, WeaponAnimInstance
Slot providersSubSlotSockets: slot tag → FWeaponSocketArray
CompatibilityWeaponTags and RequiredParts
StatisticsHard reference to UPDA_WeaponStatsBase through Stats
EffectsSoft 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.

FieldMeaning
PartIDRegistered asset identity
CompatibleSlotAccepted hierarchical slot-tag family
WeaponTagsFilterExact required/blocked tags on resolved socket provider
MeshType, StaticMesh, SkeletalMeshSelected visual representation
SubSlotSocketsChild slots exposed by this part
PartTagsPart's tags used by compatibility/stat evaluation
GrantedCapabilities, BlockedCapabilitiesBuild capability accumulation and conflict check
StatModifiersHard references to UPDA_WeaponStatModificator assets
SideEffectsSoft 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​

ClassBaseDBTypeTable value
UPDA_WeaponDatabaseUDataAssetWeaponMasterTSoftObjectPtr of UPDA_WeaponMaster
UPDA_WeaponPartsDatabaseUPrimaryDataAssetWeaponPartTSoftObjectPtr of UPDA_WeaponPart
UPDA_StatModifierDatabaseUPrimaryDataAssetStatModifierTSoftObjectPtr of UPDA_WeaponStatModificator
UPDA_SideEffectDatabaseUPrimaryDataAssetSideEffectTSoftObjectPtr 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 familyDefault skeletal componentsDefault static components
Base11
Melee01
Range120
Throwable11

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.