Editing Modding:Coding An Item
Jump to navigation
Jump to search
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 1: | Line 1: | ||
<div class="nomobile" column-width: "60em2;> | |||
Now, you have made a mesh for a certain race. We are going to add it to the game. | |||
First, we add the mesh we created to the | |||
We now open our meshes.lsx which we created in. | |||
<version major="4" minor="0" revision="4" build="602" /> | <version major="4" minor="0" revision="4" build="602" /> | ||
<region id="VisualBank"> | <region id="VisualBank"> | ||
Line 80: | Line 23: | ||
<attribute id="ID" type="FixedString" value="00000000000000000000000000001" /> '''(This UUID links up to the Roottemplate)''' | <attribute id="ID" type="FixedString" value="00000000000000000000000000001" /> '''(This UUID links up to the Roottemplate)''' | ||
<attribute id="MaterialType" type="uint8" value="0" /> | <attribute id="MaterialType" type="uint8" value="0" /> | ||
<attribute id="Name" type="LSString" value="HUM_M_CLT_MySweetCirclet" /> ''' | <attribute id="Name" type="LSString" value="HUM_M_CLT_MySweetCirclet" /> '''Usually doesn't matter but try to make it unique.''' | ||
<attribute id="NeedsSkeletonRemap" type="bool" value="False" /> | <attribute id="NeedsSkeletonRemap" type="bool" value="False" /> | ||
<attribute id="RemapperSlotId" type="FixedString" value="" /> | <attribute id="RemapperSlotId" type="FixedString" value="" /> | ||
Line 89: | Line 32: | ||
<attribute id="SoftbodyResourceID" type="FixedString" value="" /> | <attribute id="SoftbodyResourceID" type="FixedString" value="" /> | ||
<attribute id="SourceFile" type="LSString" value="Generated/Public/MySweetMod/Assets/HUM_M_CLT_Headwear_Circlet_Silver_A.GR2" /> (Remember to set your own filepath for your meshes correctly.) | <attribute id="SourceFile" type="LSString" value="Generated/Public/MySweetMod/Assets/HUM_M_CLT_Headwear_Circlet_Silver_A.GR2" /> (Remember to set your own filepath for your meshes correctly.) | ||
<attribute id="SupportsVertexColorMask" type="bool" value="False" /> | <attribute id="SupportsVertexColorMask" type="bool" value="False" /> | ||
<attribute id="Template" type="FixedString" value="Generated/Public/MySweetMod/Assets/HUM_M_CLT_Headwear_Circlet_Silver_A.Dummy_Root.0" /> | <attribute id="Template" type="FixedString" value="Generated/Public/MySweetMod/Assets/HUM_M_CLT_Headwear_Circlet_Silver_A.Dummy_Root.0" /> (Remember to set your own filepath for your meshes correctly. Dummy Root may need to be renamed in Blender as a bone part depending on what you are making) | ||
<attribute id="_OriginalFileVersion_" type="int64" value="144115207403209020" /> | <attribute id="_OriginalFileVersion_" type="int64" value="144115207403209020" /> | ||
Line 107: | Line 50: | ||
<node id="Objects"> | <node id="Objects"> | ||
<attribute id="LOD" type="uint8" value="0" /> | <attribute id="LOD" type="uint8" value="0" /> | ||
<attribute id="MaterialID" type="FixedString" value=" | <attribute id="MaterialID" type="FixedString" value="06cee86f-8ca8-a19b-69ea-6fbac8b7516f" /> '''What material it links up to.''' | ||
<attribute id="ObjectID" type="FixedString" value="HUM_M_CLT_Headwear_Circlet_Silver_A.HUM_M_CLT_Headwear_Circlet_Silver_A_Mesh.0" /> | <attribute id="ObjectID" type="FixedString" value="HUM_M_CLT_Headwear_Circlet_Silver_A.HUM_M_CLT_Headwear_Circlet_Silver_A_Mesh.0" /> The .0 denotes mesh load order. | ||
</node> | </node> | ||
<node id="Objects"> '''Extra entry for a Level of Detail mesh, which will be seen from a certain distance from the camera. In this case the LOD1.''' | <node id="Objects"> '''Extra entry for a Level of Detail mesh, which will be seen from a certain distance from the camera. In this case the LOD1.''' | ||
<attribute id="LOD" type="uint8" value="1" /> ''' | <attribute id="LOD" type="uint8" value="1" /> '''What level of LOD it is''' | ||
<attribute id="MaterialID" type="FixedString" value=" | <attribute id="MaterialID" type="FixedString" value="06cee86f-8ca8-a19b-69ea-6fbac8b7516f" /> | ||
<attribute id="ObjectID" type="FixedString" value="HUM_M_CLT_Headwear_Circlet_Silver_A.HUM_M_CLT_Headwear_Circlet_Silver_A_Mesh_LOD1.1" /> | <attribute id="ObjectID" type="FixedString" value="HUM_M_CLT_Headwear_Circlet_Silver_A.HUM_M_CLT_Headwear_Circlet_Silver_A_Mesh_LOD1.1" /> '''The .1 denotes mesh load order.''' | ||
</node> | </node> | ||
Line 123: | Line 66: | ||
<attribute id="Object" type="FixedString" value="feet" /> | <attribute id="Object" type="FixedString" value="feet" /> | ||
</node> | </node> | ||
And this code would stop the body's feet from loading in and clipping, ideal for boot items. See [https://bg3.wiki/wiki/Modding:VertexColorMaskSlots here for a full list of Vertex Mask Slots for the body.] | |||
</children> | </children> | ||
</node> | </node> | ||
Line 132: | Line 77: | ||
</save> | </save> | ||
An item will begin in the root template lsx. Here is an example for it: | |||
<?xml version="1.0" encoding="utf-8"?> | <?xml version="1.0" encoding="utf-8"?> | ||
Line 241: | Line 90: | ||
<attribute id="Description" type="TranslatedString" handle="HANDLE2" version="1" /> '''Generate a handle for this in your .loca file.''' | <attribute id="Description" type="TranslatedString" handle="HANDLE2" version="1" /> '''Generate a handle for this in your .loca file.''' | ||
<attribute id="DisplayName" type="TranslatedString" handle="HANDLE1" version="1" /> '''Generate a handle for this in your .loca file.''' | <attribute id="DisplayName" type="TranslatedString" handle="HANDLE1" version="1" /> '''Generate a handle for this in your .loca file.''' | ||
<attribute id="EquipSound" type="FixedString" value="ea27b98e-5fc0-4b0d-8602-e4a421dd481e" /> '''Not necessary but you may wish to specify one or it will use whatever default sound is in the parent template.''' | <attribute id="EquipSound" type="FixedString" value="ea27b98e-5fc0-4b0d-8602-e4a421dd481e" /></code> '''Not necessary but you may wish to specify one or it will use whatever default sound is in the parent template.''' | ||
<attribute id="Icon" type="FixedString" value="Item_Cloth_Headwear_Circlet_Silver_A" /> ''' | <attribute id="Icon" type="FixedString" value="Item_Cloth_Headwear_Circlet_Silver_A" /> '''Sets it up to use a base game icon- custom icons require addition lsx and texture work'''</code> | ||
<attribute id="LevelName" type="FixedString" value="" /> | <attribute id="LevelName" type="FixedString" value="" /></code> | ||
<attribute id="MapKey" type="FixedString" value="0000000000000000000000000002" /> '''This links up to the armor.txt to form the armor.''' | <attribute id="MapKey" type="FixedString" value="0000000000000000000000000002" /> '''This links up to the armor.txt to form the armor.'''</code> | ||
<attribute id="Name" type="LSString" value="MY_COOL_NEW_CIRCLET" /> '''This links up to the armor.txt to form the armor.''' | <attribute id="Name" type="LSString" value="MY_COOL_NEW_CIRCLET" /> '''This links up to the armor.txt to form the armor.'''</code> | ||
<attribute id="ParentTemplateId" type="FixedString" value="4d2e0931-3a01-4759-834b-8ae36749daab" /> '''This tells the game roughly what kind of item it is, such as in this case a | <attribute id="ParentTemplateId" type="FixedString" value="4d2e0931-3a01-4759-834b-8ae36749daab" /> '''This tells the game roughly what kind of item it is, such as in this case a helmet. You should use the right kind for your item to avoid inherited problems.'''</code> | ||
<attribute id="PhysicsTemplate" type="FixedString" value="327039da-0827-811f-24e8-fc57e86c7ba2" /> | <attribute id="PhysicsTemplate" type="FixedString" value="327039da-0827-811f-24e8-fc57e86c7ba2" /></code> | ||
<attribute id="Type" type="FixedString" value="item" /> | <attribute id="Type" type="FixedString" value="item" /></code> | ||
<attribute id="UnequipSound" type="FixedString" value="f4c24367-83af-484e-bcc5-0438b8e64dec" /> '''Not necessary but you may wish to specify one or it will use whatever default sound is in the parent template.''' | <attribute id="UnequipSound" type="FixedString" value="f4c24367-83af-484e-bcc5-0438b8e64dec" /></code> '''Not necessary but you may wish to specify one or it will use whatever default sound is in the parent template.''' | ||
<attribute id="VisualTemplate" type="FixedString" value="2136f57a-a35f-c2fe-69fb-29afa9ebc8db" /> | <attribute id="VisualTemplate" type="FixedString" value="2136f57a-a35f-c2fe-69fb-29afa9ebc8db" /> This is the mesh mapkey to the LOOT model (the one that appears when you examine it, or throw the item. For a weapon, the LOOT model and the item model are the same. </code> | ||
<attribute id="_OriginalFileVersion_" type="int64" value="144115207403209032" /> | <attribute id="_OriginalFileVersion_" type="int64" value="144115207403209032" /></code> | ||
<children></code> | |||
<node id="Equipment"></code> | |||
<children></code> | |||
<node id="AfroLongHair" /></code> | |||
<node id="AfroShortHair" /></code> | |||
<node id="CurlyLongHair" /></code> | |||
<node id="CurlyShortHair" /></code> | |||
<node id="DreadLongHair" /></code> | |||
<node id="DreadShortHair" /></code> | |||
<node id="LongHair" /></code> | |||
<node id="ParentRace"> '''These set the parent races for githyanki, Dragonborn and Tiefling. Unless this line is specified, they will use Human Body or Strong Human Body. (Which may be fine for some races such as Tieflings.)'''</code> | |||
<children></code> | |||
<node id="Object"></code> | |||
<attribute id="MapKey" type="guid" value="6503c830-9200-409a-bd26-895738587a4a" /></code> | |||
<attribute id="MapValue" type="guid" value="00000000-0000-0000-0000-000000000000" /></code> | |||
</node></code> | |||
'''(Removed for length as these all follow the same format)'''</code> | |||
</children></code> | |||
</node></code> | |||
<node id="ShortHair" /></code> | |||
<node id="Slot"></code> | |||
<attribute id="Object" type="FixedString" value="Headwear" /></code> | |||
</node></code> | |||
<node id="Slot"></code> | |||
<attribute id="Object" type="FixedString" value="Hair" /></code> | |||
</node></code> | |||
<node id="VisualSet"></code> | |||
<attribute id="BodySetVisual" type="FixedString" value="" /></code> | |||
<attribute id="ShowEquipmentVisuals" type="bool" value="False" /></code> | |||
<children></code> | |||
<node id="MaterialOverrides"> Sets colours for this one specific</code> | |||
<attribute id="MaterialResource" type="FixedString" value="" /></code> | |||
<children></code> | |||
<node id="MaterialPresets" /></code> | |||
'''(We can add any colour available to us (cloth, leather, accent) but this circlet is only metal 1 so we only need to list metal 1.)'''</code> | |||
<node id=" | |||
<node id=" | |||
<node id=" | |||
<node id=" | |||
'''( | |||
<node id="VisualSet"> | |||
<attribute id="BodySetVisual" type="FixedString" value="" /> | |||
<attribute id="ShowEquipmentVisuals" type="bool" value="False" /> | |||
<children> | |||
'''(We can add any colour available to us (cloth, leather, accent) but this circlet is only metal 1 so we only need to list metal 1.)''' | |||
<node id="Vector3Parameters"></code> | |||
<attribute id="Color" type="bool" value="False" /></code> | |||
<attribute id="Custom" type="bool" value="True" /></code> | |||
<attribute id="Enabled" type="bool" value="False" /></code> | |||
<attribute id="Parameter" type="FixedString" value="Metal_Primary" /></code> | |||
<attribute id="Value" type="fvec3" value="0.7667436 0.7667436 0.7667436" /> The colour code in Hex form, you can use [https://www.nexusmods.com/baldursgate3/mods/502 BG3 Minitool] to convert a value.</code> | |||
</node></code> | |||
</children></code> | |||
</node></code> | |||
<node id="RealMaterialOverrides" /></code> | |||
</children></code> | |||
</node></code> | |||
<node id="Visuals"></code> | |||
<children></code> | |||
<node id=" | <node id="Object"></code> | ||
<attribute id="MapKey" type="guid" value="71180b76-5752-4a97-b71f-911a69197f58" /> Human Male Race IUUD example. [https://bg3.wiki/wiki/Modding:Race_UUID Others Here]</code> | |||
<children></code> | |||
<node id="MapValue"></code> | |||
<attribute id="MapKey" type="guid" value="71180b76-5752-4a97-b71f-911a69197f58" /> Human Male Race IUUD example. [https://bg3.wiki/wiki/Modding:Race_UUID Others Here] | <attribute id="Object" type="FixedString" value="00000000000000000000000000001" /> Your Mesh for Human Male</code> | ||
<children> | </node></code> | ||
<node id="MapValue"> | </children></code> | ||
<attribute id="Object" type="FixedString" value="00000000000000000000000000001" /> Your Mesh for Human Male | </node></code> | ||
</node> | (Removed for length - all the other mapkeys/mapvalues of every race this item is available for)</code> | ||
</children> | </children></code> | ||
</node> | </node></code> | ||
<node id="WavyLongHair" /></code> | |||
</children> | <node id="WavyShortHair" /></code> | ||
</node> | </children></code> | ||
<node id="WavyLongHair" /> | </node></code> | ||
<node id="WavyShortHair" /> | </children></code> | ||
</children> | </node></code> | ||
</node> | |||
</children> | |||
</node> | |||
</node> | </node> | ||
'''(END OF ITEM)''' | '''(END OF ITEM)''' | ||
Line 370: | Line 176: | ||
</save> | </save> | ||
Now, let's see how this links up to the localisation. | |||
== | You can generate a handle by ticking the Handle box next to 'GENERATE' on the Multitool. It is much like an UUID but it starts with an H. | ||
<?xml version="1.0" encoding="utf-8"?><contentList> | |||
<content contentuid="HANDLE1" version="1">Circlet</content> | |||
<content contentuid="HANDLE2" version="1">My circlet is cool.</content> | |||
</contentList> | |||
Meanwhile in your '''Armor.txt''', they link up like this: | Meanwhile in your '''Armor.txt''', they link up like this: | ||
You can look at the games own armor.txt for ideas of what to put here. You can delete a lot of this, all you really need is the entry, the type, what slot it uses and the RootTemplate. | |||
You can look at the | |||
Armor.txt | Armor.txt | ||
new entry "MY_COOL_NEW_CIRCLET" | new entry "MY_COOL_NEW_CIRCLET" | ||
type "Armor" | type "Armor" | ||
data "ValueOverride" "4000" '''(It's a very cool circlet and we want it to cost a lot!)''' | data "ValueOverride" "4000" '''(It's a very cool circlet and we want it to cost a lot!)''' | ||
data "Weight" "0.01" | data "Weight" "0.01" | ||
using "_Head_Magic_Circlet" '''(This tells it what slot to equip in. Ideally this should match up with the ParentTemplate you set up.)''' | using "_Head_Magic_Circlet" '''(This tells it what slot to equip in. Ideally this should match up with the ParentTemplate you set up.)''' | ||
data "RootTemplate" "0000000000000000000000000002" '''Matches up to the rootemplate Mapkey.''' | data "RootTemplate" "0000000000000000000000000002" '''Matches up to the rootemplate Mapkey.''' | ||
data "Rarity" "Rare" '''This effects what colour it is in your inventory, rarer things get a different colour outline.''' | data "Rarity" "Rare" '''This effects what colour it is in your inventory, rarer things get a different colour outline. Note that if you set things as common they may spawn in generic containers, which is not optimal for clean uninstalling.''' | ||
data "Boosts" "UnlockSpell(Target_MAG_HealingWord);UnlockSpell(Shout_MAG_HealingWord_Mass)" '''This forces it to give us these spells. Note that the character needs spell slots in able to use them! If you want it for everyone you may be better off setting it up as a custom passive'''. | data "Boosts" "UnlockSpell(Target_MAG_HealingWord);UnlockSpell(Shout_MAG_HealingWord_Mass)" '''This forces it to give us these spells. Note that the character needs spell slots in able to use them! If you want it for everyone you may be better off setting it up as a custom passive'''. | ||
data "PassivesOnEquip" "MAG_Radiant_Radiating_Helmet_Passive;CUSTOMPASSIVEIMADE" '''(The ; seperates passives.)''' | data "PassivesOnEquip" "MAG_Radiant_Radiating_Helmet_Passive;CUSTOMPASSIVEIMADE" '''(The ; seperates passives.)''' | ||
data "Unique" "1" | data "Unique" "1" | ||
data "MinAmount" "1" | data "MinAmount" "1" | ||
data "MaxAmount" "1" | data "MaxAmount" "1" '''(These may cause you a headache if you put it multiple places, as they won't spawn for people who overlooked the first one. So I don't recommend using these!)''' | ||
If adding a custom passive, your '''Passive.txt''' will look like this | If adding a custom passive, your '''Passive.txt''' will look like this. | ||
The example passive code is borrowed from Isobel's armor. | The example passive code is borrowed from Isobel's armor. | ||
Line 401: | Line 207: | ||
new entry "CUSTOMPASSIVEIMADE" | new entry "CUSTOMPASSIVEIMADE" | ||
type "PassiveData" | type "PassiveData" | ||
data "DisplayName" " | data "DisplayName" "PASSIVEHANDLE1;1" '''(Generate a handle for this in your .loca file.)''' | ||
data "Description" " | 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 "Icon" "CUSTOMPASSIVEICON" '''(we can set this up in the same way an item icon is set up)''' | ||
data "DescriptionParams" "DealDamage(1d4, Radiant)" | data "DescriptionParams" "DealDamage(1d4, Radiant)" | ||
data "StatsFunctorContext" "OnAttacked" | 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)" | 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. | Now, you need to put it in the treasuretable. | ||
Your treasuretable should look like this: | Your treasuretable should look like this: | ||
Line 433: | Line 220: | ||
CanMerge 1 | CanMerge 1 | ||
new subtable "1,1" | new subtable "1,1" | ||
object category "I_MY_COOL_NEW_CIRCLET",1,0,0,0,0,0,0,0 | 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. | |||
{| class="nomobile" style="text-align:center; margin: auto; border:1px solid #785000; font-size:83%; background-color:#1B1B1B; width: 60;" ; | |||
[[Category:Modding guides]] | |- style="font-weight:bold; background-color:#281C14; color:#c27736; border:0px none;" | ||
[[ | | colspan="2" | | ||
[[File:bgwiii.png|30px|link=Template:NavWiki]] [[BG3Wiki:Community|Community]] • [[Guide:Guides|Guides]] • [[Modding: Modding resources|Modding]] | |||
|- | |||
| style="background-color:#28201B; color:#c27736; width: 15%;" |[[:Category:Modding|Modding guides]] | |||
| style="text-align:left; padding:0 4px;" |<div class="navcat" ;> | |||
<categorytree hideprefix="1" hideroot="1" mode="pages">Modding guides</categorytree> | |||
</div> | |||
|- | |||
| style="background-color:#28201B; color:#c27736; width: 15%;" |[[Modding:Modding resources|Modding resources]] | |||
| style="text-align:left; padding:0 4px;" |<div class="navcat" ;> | |||
<categorytree hideprefix="1" hideroot="1" mode="pages">Modding resources</categorytree> | |||
</div> | |||
|}</div><div class="noexcerpt navigation-not-searchable" style="text-align:center"><span class="nodesktop"> [[Modding:Index|Modding index]] </span></div> |