Modding:Coding An Item

From bg3.wiki
Revision as of 10:55, 19 December 2023 by CommanderStrawberry (talk | contribs)
Jump to navigation Jump to search

The start to creating a new item is

Meanwhile in your Armor.txt, they link up like this:

Armor.txt
new entry "MY_COOL_NEW_CIRCLET"
type "Armor"
using "_Head_Magic_Circlet"
data "RootTemplate" "0000000000000000000000000002"
data "Rarity" "Rare"
data "PassivesOnEquip" "MAG_Radiant_Radiating_Helmet_Passive;CUSTOMPASSIVEIMADE" (The ; seperates passives.)

If adding a custom passive, your Passive.txt will look like this.

The example passive code is borrowed from Isobel's armor.

new entry "CUSTOMPASSIVEIMADE"
type "PassiveData"
data "DisplayName" "PASSIVEHANDLE1;1" (Generate a handle for this in your .loca file.)
data "Description" "PASSIVEHANDLE2;1" Generate a handle for this in your .loca file.)
data "Icon" "CUSTOMPASSIVEICON" (we can set this up in the same way an item icon is set up)
data "DescriptionParams" "DealDamage(1d4, Radiant)"
data "StatsFunctorContext" "OnAttacked"
data "StatsFunctors" "IF(context.HasContextFlag(StatsFunctorContext.OnAttacked) and HasStatus('MAGE_ARMOR') and IsLastConditionRollSuccess(ConditionRollType.ConditionSavingThrow) and not Self() and IsSavingThrow()):DealDamage(SWAP, 1d4, Radiant,Magical)"

Now, you need to put it in the treasuretable. Your treasuretable should look like this:

new treasuretable "TUT_Chest_Potions"
CanMerge 1
new subtable "1,1"
object category "I_MY_COOL_NEW_CIRCLET",1,0,0,0,0,0,0,0 (Do not forget the I_ prefix!)

This will make it spawn in the tutorial chest.

Bgwiii.png CommunityGuidesModding

Modding guides
Modding resources