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 8: | Line 8: | ||
Remember to check your naming conventions for .lsf.lsx files so the multitool correctly converts them, and keep in mind that some lsx files should not be converted to lsf at all. | Remember to check your naming conventions for .lsf.lsx files so the multitool correctly converts them, and keep in mind that some lsx files should not be converted to lsf at all. | ||
This guide does not cover adding custom icons | This guide does not cover adding custom icons. | ||
==Sample Templates== | == Sample Templates == | ||
Please do remember it is best practice to unpack and consult the game files directly. | Please do remember it is best practice to unpack and consult the game files directly. | ||
*[https://www.nexusmods.com/baldursgate3/mods/3862 Mod Builder] by ReallyLazyIcarus. A python script that generates a folder workspace and empty lsx in the correct format to be converted with the multitool. Recommended! | *[https://www.nexusmods.com/baldursgate3/mods/3862 Mod Builder] by ReallyLazyIcarus. A python script that generates a folder workspace and empty lsx in the correct format to be converted with the multitool. Recommended! | ||
Line 26: | Line 26: | ||
*[https://www.nexusmods.com/baldursgate3/mods/1808 BG3 Creator's Cauldron]- an older program. Useful for its long lists of armor.txt and passives for you to use. | *[https://www.nexusmods.com/baldursgate3/mods/1808 BG3 Creator's Cauldron]- an older program. Useful for its long lists of armor.txt and passives for you to use. | ||
*[https://www.nexusmods.com/baldursgate3/mods/502 BG3 MiniTool by Padme4000]- Can generate a [[Modding:Creating meta.lsx|Meta]] for you to use. | *[https://www.nexusmods.com/baldursgate3/mods/502 BG3 MiniTool by Padme4000]- Can generate a [[Modding:Creating meta.lsx|Meta]] for you to use. | ||
==File Overview== | ==File Overview == | ||
Your mod is '''MySweetMod''' | Your mod is '''MySweetMod''' | ||
Line 48: | Line 48: | ||
******Assets | ******Assets | ||
*******Characters | *******Characters | ||
******** [PAK]_Armor <-- material and mesh LSX for custom outfits and weapons | ********[PAK]_Armor <-- material and mesh LSX for custom outfits and weapons | ||
****GUI | **** GUI | ||
*****RootTemplates <--- Your Roottemplate lsx goes here. MySweetMod.Lsx | *****RootTemplates <--- Your Roottemplate lsx goes here. MySweetMod.Lsx | ||
*****Stats | *****Stats | ||
*******Generated <--- TreasureTable.txt - This tells the game where the item will spawn. | *******Generated <--- TreasureTable.txt - This tells the game where the item will spawn. | ||
********Data <--- Armor.txt, Object.txt, Passive.txt, Weapon.txt and other TXT files. These contain stats. | ********Data <--- Armor.txt, Object.txt, Passive.txt, Weapon.txt and other TXT files. These contain stats. | ||
Line 132: | Line 132: | ||
</save> | </save> | ||
==Materials and Texture .lsx== | ==Materials and Texture .lsx == | ||
Now, we move on to our materialbank. | Now, we move on to our materialbank. | ||
Line 191: | Line 191: | ||
Now the material we have found, SourceFile "Public/Shared/Assets/Materials/Characters/CHAR_BASE.lsf" is a fairly standard shader without transparency or glowing. Materials that can be Transparent have 'Alpha' in the title. For example, "Public/Shared/Assets/Materials/Characters/CHAR_BASE_AlphaTest_2S.lsf" or "CHAR_BASE_AlphaTest_2S_Dither" will enable alpha and make the mesh visible from both sides (turns off backface culling). Underwear needs to have a Dither shader or it won't hide correctly. | Now the material we have found, SourceFile "Public/Shared/Assets/Materials/Characters/CHAR_BASE.lsf" is a fairly standard shader without transparency or glowing. Materials that can be Transparent have 'Alpha' in the title. For example, "Public/Shared/Assets/Materials/Characters/CHAR_BASE_AlphaTest_2S.lsf" or "CHAR_BASE_AlphaTest_2S_Dither" will enable alpha and make the mesh visible from both sides (turns off backface culling). Underwear needs to have a Dither shader or it won't hide correctly. | ||
Materials with _VT at the end are | Materials with _VT at the end are useless to us, as they only work with virtual texture. A virtualtexture is essentially a box for textures that makes it load faster. We don't have any way of packing virtualtextures ourselves, so do not attempt to use those materials. | ||
In order to make, say, pants disappear when boots are put on, you may need to use a _Vertcut Material, such as 'Public/Shared/Assets/Materials/Characters/CHAR_BASE_VertCut.lsf', and ensure VertexMask is set to True in the mesh lsx. (As well as vertex painting the item itself the desired colour) | In order to make, say, pants disappear when boots are put on, you may need to use a _Vertcut Material, such as 'Public/Shared/Assets/Materials/Characters/CHAR_BASE_VertCut.lsf', and ensure VertexMask is set to True in the mesh lsx. (As well as vertex painting the item itself the desired colour) | ||
Line 225: | Line 225: | ||
If there is anything wrong with the material, your item may simply refuse to show up, so it is worth double-checking everything here. | If there is anything wrong with the material, your item may simply refuse to show up, so it is worth double-checking everything here. | ||
==RootTemplate == | ==RootTemplate== | ||
Now for the game to recognise the circlet as an item, we add it to the root template lsx: | Now for the game to recognise the circlet as an item, we add it to the root template lsx: | ||
Line 382: | Line 382: | ||
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.)''' | ||
Line 393: | Line 393: | ||
data "MinAmount" "1" | data "MinAmount" "1" | ||
data "MaxAmount" "1" | data "MaxAmount" "1" | ||
Other <code>using</code> slots include <code>"ARM_Camp_Body"</code>, <code>"_Vanity_Shoes_Generic_Common"</code> for camp clothes, <code>"_Foot_Magic"</code> for boots, <code>"ARM_Robe_Body"</code> for robes, <code>"_Hand"</code> for gloves. | Other <code>using</code> slots include <code>"ARM_Camp_Body"</code>, <code>"_Vanity_Shoes_Generic_Common"</code> for camp clothes, <code>"_Foot_Magic"</code> for boots, <code>"ARM_Robe_Body"</code> for robes, <code>"_Hand"</code> for gloves. | ||