Modding:Coding An Item: Difference between revisions

Jump to navigation Jump to search
No edit summary
No edit summary
Line 85: Line 85:
   
   
  <node id="Objects">
  <node id="Objects">
  <attribute id="LOD" type="uint8" value="0" />  
  <attribute id="LOD" type="uint8" value="0" /> '''What level of LOD it is. This is a LOD0, so it is the highest quality mesh and the one we see in cutscenes.'''
  <attribute id="MaterialID" type="FixedString" value="00000000000000000000004" /> '''What material it links up to.'''
  <attribute id="MaterialID" type="FixedString" value="00000000000000000000004" /> '''What material it links up to (see materialbank code).'''
  <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.
  <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 order, which is not the same as LOD. It is set in the Blender export.'''
  </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" /> '''What level of LOD it is'''
  <attribute id="LOD" type="uint8" value="1" /> '''This is a LOD1 mesh.'''
  <attribute id="MaterialID" type="FixedString" value="00000000000000000000004" />  
  <attribute id="MaterialID" type="FixedString" value="00000000000000000000004" />  
  <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.'''
  <attribute id="ObjectID" type="FixedString" value="HUM_M_CLT_Headwear_Circlet_Silver_A.HUM_M_CLT_Headwear_Circlet_Silver_A_Mesh_LOD1.1" />  
  </node>
  </node>
   
   
Line 101: Line 101:
  <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.]
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 125: Line 125:
  '''(BEGINNING OF MATERIAL)'''
  '''(BEGINNING OF MATERIAL)'''


  <node id="Resource">
  <node id="Resource">
  <attribute id="DiffusionProfileUUID" type="FixedString" value="" />
  <attribute id="DiffusionProfileUUID" type="FixedString" value="" />
Line 170: Line 169:


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.
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 189: Line 186:
     <attribute id="Depth" type="int32" value="1" />
     <attribute id="Depth" type="int32" value="1" />
     <attribute id="Localized" type="bool" value="False" />
     <attribute id="Localized" type="bool" value="False" />
     <attribute id="SRGB" type="bool" value="False" /> This does things. I am not sure what.
     <attribute id="SRGB" type="bool" value="False" /> Ensure this is set to False- can't remember why but it does need to be.
     <attribute id="Streaming" type="bool" value="True" />
     <attribute id="Streaming" type="bool" value="True" />
     <attribute id="Template" type="FixedString" value="" />
     <attribute id="Template" type="FixedString" value="" />
Line 203: Line 200:


==RootTemplate==
==RootTemplate==
Now for the game 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:


MySweetMod\Public\MySweetMod\RootTemplates\MySweetMod.lsf.lsx  
MySweetMod\Public\MySweetMod\RootTemplates\MySweetMod.lsf.lsx