# G.A.S. with Combat and Inventory: Initialize Plugin Attributes

> For the complete documentation index, see [llms.txt](llms.txt).

Use an ability bundle to give a combatant starting health or an inventory owner a backpack capacity. Each example works independently. Begin with an actor that [has an initialized Ninja Ability System Component](gas-first-steps.html) and a G.A.S. Setup asset in a [registered bundle folder](asset-manager.html).

## Give a Combatant Starting Health

Procedure: Initialize the Combat Attribute Set

1. With Ninja Combat enabled, copy the JSON below into a file named `DT_CombatAttributes.json`. Import it into the Content Browser as a Data Table with row structure AttributeMetaData. The sample sets Health and MaxHealth to 100 and BaseDamage to 10.

2. Open the combatant's G.A.S. Setup asset. In Default Attribute Sets, add `NinjaCombatAttributeSet` and select the imported table as its Attribute Table. Assign the bundle to Default Ability Setup on the character or its owning component.

3. In play, inspect this combatant with `showdebug abilitysystem`. Check that health starts at 100 and base damage at 10. To use the values in an attack, continue with [Set Up a Combatant](cbt-first-steps.html).

For a health bar on a newly possessed pawn, use the Blueprint node Wait For Ability System before reading Health. In C++, read the starting value from that component and subscribe to `GetGameplayAttributeValueChangeDelegate` for Health to update the bar when Combat applies damage. Remove the binding when switching components.

```JSON
[
    {"Name": "NinjaCombatAttributeSet.Health", "BaseValue": 100, "MinValue": 0, "MaxValue": 0, "DerivedAttributeInfo": "", "bCanStack": false},
    {"Name": "NinjaCombatAttributeSet.MaxHealth", "BaseValue": 100, "MinValue": 0, "MaxValue": 0, "DerivedAttributeInfo": "", "bCanStack": false},
    {"Name": "NinjaCombatAttributeSet.MaxHealthAdd", "BaseValue": 0, "MinValue": 0, "MaxValue": 0, "DerivedAttributeInfo": "", "bCanStack": false},
    {"Name": "NinjaCombatAttributeSet.MaxHealthPercent", "BaseValue": 0, "MinValue": 0, "MaxValue": 0, "DerivedAttributeInfo": "", "bCanStack": false},
    {"Name": "NinjaCombatAttributeSet.HealthRegenRate", "BaseValue": 0, "MinValue": 0, "MaxValue": 0, "DerivedAttributeInfo": "", "bCanStack": false},
    {"Name": "NinjaCombatAttributeSet.Stamina", "BaseValue": 100, "MinValue": 0, "MaxValue": 0, "DerivedAttributeInfo": "", "bCanStack": false},
    {"Name": "NinjaCombatAttributeSet.MaxStamina", "BaseValue": 100, "MinValue": 0, "MaxValue": 0, "DerivedAttributeInfo": "", "bCanStack": false},
    {"Name": "NinjaCombatAttributeSet.MaxStaminaAdd", "BaseValue": 0, "MinValue": 0, "MaxValue": 0, "DerivedAttributeInfo": "", "bCanStack": false},
    {"Name": "NinjaCombatAttributeSet.MaxStaminaPercent", "BaseValue": 0, "MinValue": 0, "MaxValue": 0, "DerivedAttributeInfo": "", "bCanStack": false},
    {"Name": "NinjaCombatAttributeSet.StaminaCost", "BaseValue": 20, "MinValue": 0, "MaxValue": 0, "DerivedAttributeInfo": "", "bCanStack": false},
    {"Name": "NinjaCombatAttributeSet.StaminaRegenRate", "BaseValue": 10, "MinValue": 0, "MaxValue": 0, "DerivedAttributeInfo": "", "bCanStack": false},
    {"Name": "NinjaCombatAttributeSet.StaminaRegenDelay", "BaseValue": 5, "MinValue": 0, "MaxValue": 0, "DerivedAttributeInfo": "", "bCanStack": false},
    {"Name": "NinjaCombatAttributeSet.Mana", "BaseValue": 100, "MinValue": 0, "MaxValue": 0, "DerivedAttributeInfo": "", "bCanStack": false},
    {"Name": "NinjaCombatAttributeSet.MaxMana", "BaseValue": 100, "MinValue": 0, "MaxValue": 0, "DerivedAttributeInfo": "", "bCanStack": false},
    {"Name": "NinjaCombatAttributeSet.MaxManaAdd", "BaseValue": 0, "MinValue": 0, "MaxValue": 0, "DerivedAttributeInfo": "", "bCanStack": false},
    {"Name": "NinjaCombatAttributeSet.MaxManaPercent", "BaseValue": 0, "MinValue": 0, "MaxValue": 0, "DerivedAttributeInfo": "", "bCanStack": false},
    {"Name": "NinjaCombatAttributeSet.ManaCost", "BaseValue": 20, "MinValue": 0, "MaxValue": 0, "DerivedAttributeInfo": "", "bCanStack": false},
    {"Name": "NinjaCombatAttributeSet.ManaRegenRate", "BaseValue": 0, "MinValue": 0, "MaxValue": 0, "DerivedAttributeInfo": "", "bCanStack": false},
    {"Name": "NinjaCombatAttributeSet.ManaRegenDelay", "BaseValue": 5, "MinValue": 0, "MaxValue": 0, "DerivedAttributeInfo": "", "bCanStack": false},
    {"Name": "NinjaCombatAttributeSet.BaseDamage", "BaseValue": 10, "MinValue": 0, "MaxValue": 0, "DerivedAttributeInfo": "", "bCanStack": false},
    {"Name": "NinjaCombatAttributeSet.BaseDamageBonus", "BaseValue": 0, "MinValue": 0, "MaxValue": 0, "DerivedAttributeInfo": "", "bCanStack": false},
    {"Name": "NinjaCombatAttributeSet.BaseDamageReduction", "BaseValue": 0, "MinValue": 0, "MaxValue": 0, "DerivedAttributeInfo": "", "bCanStack": false},
    {"Name": "NinjaCombatAttributeSet.CriticalHitChance", "BaseValue": 0, "MinValue": 0, "MaxValue": 0, "DerivedAttributeInfo": "", "bCanStack": false},
    {"Name": "NinjaCombatAttributeSet.CriticalHitMultiplier", "BaseValue": 0, "MinValue": 0, "MaxValue": 0, "DerivedAttributeInfo": "", "bCanStack": false},
    {"Name": "NinjaCombatAttributeSet.BlockChance", "BaseValue": 0, "MinValue": 0, "MaxValue": 0, "DerivedAttributeInfo": "", "bCanStack": false},
    {"Name": "NinjaCombatAttributeSet.BlockMitigation", "BaseValue": 0, "MinValue": 0, "MaxValue": 0, "DerivedAttributeInfo": "", "bCanStack": false},
    {"Name": "NinjaCombatAttributeSet.BlockAngle", "BaseValue": 0, "MinValue": 0, "MaxValue": 0, "DerivedAttributeInfo": "", "bCanStack": false},
    {"Name": "NinjaCombatAttributeSet.BlockLimit", "BaseValue": 0, "MinValue": 0, "MaxValue": 0, "DerivedAttributeInfo": "", "bCanStack": false},
    {"Name": "NinjaCombatAttributeSet.BlockStaminaCostRate", "BaseValue": 0, "MinValue": 0, "MaxValue": 0, "DerivedAttributeInfo": "", "bCanStack": false},
    {"Name": "NinjaCombatAttributeSet.BlockCooldown", "BaseValue": 3, "MinValue": 0, "MaxValue": 0, "DerivedAttributeInfo": "", "bCanStack": false},
    {"Name": "NinjaCombatAttributeSet.EvadeStaminaCost", "BaseValue": 20, "MinValue": 0, "MaxValue": 0, "DerivedAttributeInfo": "", "bCanStack": false},
    {"Name": "NinjaCombatAttributeSet.EvadeCooldown", "BaseValue": 0.2, "MinValue": 0, "MaxValue": 0, "DerivedAttributeInfo": "", "bCanStack": false},
    {"Name": "NinjaCombatAttributeSet.DefenseChance", "BaseValue": 0, "MinValue": 0, "MaxValue": 0, "DerivedAttributeInfo": "", "bCanStack": false},
    {"Name": "NinjaCombatAttributeSet.DefenseMitigation", "BaseValue": 0, "MinValue": 0, "MaxValue": 0, "DerivedAttributeInfo": "", "bCanStack": false},
    {"Name": "NinjaCombatAttributeSet.DefenseStaminaCostRate", "BaseValue": 0, "MinValue": 0, "MaxValue": 0, "DerivedAttributeInfo": "", "bCanStack": false},
    {"Name": "NinjaCombatAttributeSet.ArmorReduction", "BaseValue": 0, "MinValue": 0, "MaxValue": 0, "DerivedAttributeInfo": "", "bCanStack": false},
    {"Name": "NinjaCombatAttributeSet.Absorption", "BaseValue": 0, "MinValue": 0, "MaxValue": 0, "DerivedAttributeInfo": "", "bCanStack": false},
    {"Name": "NinjaCombatAttributeSet.MaxAbsorption", "BaseValue": 0, "MinValue": 0, "MaxValue": 0, "DerivedAttributeInfo": "", "bCanStack": false},
    {"Name": "NinjaCombatAttributeSet.LastStandCount", "BaseValue": 0, "MinValue": 0, "MaxValue": 0, "DerivedAttributeInfo": "", "bCanStack": false},
    {"Name": "NinjaCombatAttributeSet.LastStandHealthPercent", "BaseValue": 0, "MinValue": 0, "MaxValue": 0, "DerivedAttributeInfo": "", "bCanStack": false},
    {"Name": "NinjaCombatAttributeSet.Poise", "BaseValue": 100, "MinValue": 0, "MaxValue": 0, "DerivedAttributeInfo": "", "bCanStack": false},
    {"Name": "NinjaCombatAttributeSet.PoiseDamage", "BaseValue": 0, "MinValue": 0, "MaxValue": 0, "DerivedAttributeInfo": "", "bCanStack": false},
    {"Name": "NinjaCombatAttributeSet.PoiseRecovery", "BaseValue": 100, "MinValue": 0, "MaxValue": 0, "DerivedAttributeInfo": "", "bCanStack": false},
    {"Name": "NinjaCombatAttributeSet.PoiseRecoveryInterval", "BaseValue": 10, "MinValue": 0, "MaxValue": 0, "DerivedAttributeInfo": "", "bCanStack": false},
    {"Name": "NinjaCombatAttributeSet.StaggerDuration", "BaseValue": 5, "MinValue": 0, "MaxValue": 0, "DerivedAttributeInfo": "", "bCanStack": false},
    {"Name": "NinjaCombatAttributeSet.RiposteWindowDuration", "BaseValue": 5, "MinValue": 0, "MaxValue": 0, "DerivedAttributeInfo": "", "bCanStack": false},
    {"Name": "NinjaCombatAttributeSet.RiposteDamageBonusMultiplier", "BaseValue": 2, "MinValue": 0, "MaxValue": 0, "DerivedAttributeInfo": "", "bCanStack": false},
    {"Name": "NinjaCombatAttributeSet.KnockDownDuration", "BaseValue": 10, "MinValue": 0, "MaxValue": 0, "DerivedAttributeInfo": "", "bCanStack": false},
    {"Name": "NinjaCombatAttributeSet.KnockDownHealthPercent", "BaseValue": 10, "MinValue": 0, "MaxValue": 0, "DerivedAttributeInfo": "", "bCanStack": false}
]
```

## Give a Backpack Its Capacity

Procedure: Initialize the Inventory Attribute Set

1. With Ninja Inventory enabled, copy the JSON below into `DT_InventoryAttributes.json`. Import it as a Data Table with row structure AttributeMetaData. It starts BackpackSlots at 12, WeightLimit at 100, and Wealth at zero.

2. In the inventory owner's G.A.S. Setup asset, add `NinjaInventoryAttributeSet` to Default Attribute Sets and assign the inventory table. Assign the bundle to the owner. If the same character uses Combat, add both sets with their respective tables to the same bundle.

3. On the backpack container, choose Gameplay Attribute as the slot count type and select BackpackSlots. In play, inspect the owner's attribute and open the backpack. Both should show a capacity of 12. See [Build a Standard Slot-Based Inventory](inv-guide-simple-grid.html) for the container setup.

For a pawn with its own backpack size, assign its bundle through Default Ability Setup on the avatar Blueprint. A custom C++ avatar can implement `IAbilitySystemDefaultsInterface::GetAbilityData` to return that bundle. If the Player State already grants the Inventory Attribute Set, configure the shared capacity there. The component skips duplicate entries for the same set class.

```JSON
[
  {
    "Name": "NinjaInventoryAttributeSet.Wealth",
    "BaseValue": 0,
    "MinValue": 0,
    "MaxValue": 0,
    "DerivedAttributeInfo": "",
    "bCanStack": false
  },
  {
    "Name": "NinjaInventoryAttributeSet.WeightLimit",
    "BaseValue": 100,
    "MinValue": 0,
    "MaxValue": 0,
    "DerivedAttributeInfo": "",
    "bCanStack": false
  },
  {
    "Name": "NinjaInventoryAttributeSet.BackpackSlots",
    "BaseValue": 12,
    "MinValue": 0,
    "MaxValue": 0,
    "DerivedAttributeInfo": "",
    "bCanStack": false
  }
]
```

## Try It in Play

For Combat, take a hit and check that current Health falls while MaxHealth stays at 100. For Inventory, change the table's BackpackSlots base value to eight and start with a fresh inventory. The bag should show eight slots. If the attribute reads eight but the bag still has 12, check that the container uses the attribute for its slot count.

