Add Things to Inventory - KonradHeinser/EBSGFramework GitHub Wiki

This ability comp allows you to add an item directly to the caster's and/or the target's inventory. Because this allows you to set the stuffing as well, you can make equipment with this, though it is important to note that the pawn will need to drop and equip them afterwards to avoid weird issues. The basic comp looks like this:

        <comps>
            <li Class="EBSGFramework.CompProperties_AddItemToInventory">
            </li>
        </comps>

These are the tags available:

  • targetThing : The ThingDef to add to the target's inventory

  • targetCount : Default (1) : The amount of said thing to add

  • targetStuffing : What to make the thing out of. Note that this will cause errors if a non-stuffable thing is given this

  • casterThing : The ThingDef to add to the caster's inventory

  • casterCount : Default (1) : The amount of said thing to add

  • casterStuffing : What to make the thing out of. Note that this will cause errors if a non-stuffable thing is given this


These examples just add items to the caster's inventory, namely 100 steel with the first one, and a steel long sword with the second one

    <AbilityDef ParentName="EBSG_TestSelfCastBase">
        <defName>GetSteel</defName>
        <label>get steel</label>
        <description>Do as the name says</description>
        <comps>
            <li Class="EBSGFramework.CompProperties_AddItemToInventory">
                <casterThing>Steel</casterThing>
                <casterCount>100</casterCount>
            </li>
        </comps>
    </AbilityDef>

    <AbilityDef ParentName="EBSG_TestSelfCastBase">
        <defName>GetSteelSword</defName>
        <label>get steel sword</label>
        <description>Do as the name says</description>
        <comps>
            <li Class="EBSGFramework.CompProperties_AddItemToInventory">
                <casterThing>MeleeWeapon_LongSword</casterThing>
                <casterCount>1</casterCount>
                <casterStuffing>Steel</casterStuffing>
            </li>
        </comps>
    </AbilityDef>
⚠️ **GitHub.com Fallback** ⚠️