Modding:Creating a custom cloth collider: Difference between revisions

From Baldur's Gate 3 Wiki
Jump to navigation Jump to search
(Created page with "{{Modding box}} If making a custom body, you may need to create a custom cloth collider for it. You can look up any vanilla cloth collider to use as a base, but here is an example one:<syntaxhighlight lang="xml" line="1"> <region id="ClothColliderBank"> <node id="ClothColliderBank"> <children> <node id="Resource"> <attribute id="ID" type="FixedString" value="76296449-d13a-4633-8050-9a273bf717fa" /> <attribute id="Name" type="LSString" value="WLF_FS_NK...")
 
No edit summary
 
(4 intermediate revisions by the same user not shown)
Line 6: Line 6:
<children>
<children>
<node id="Resource">
<node id="Resource">
<attribute id="ID" type="FixedString" value="76296449-d13a-4633-8050-9a273bf717fa" />
<attribute id="ID" type="FixedString" value="a16538a0-69f3-4537-8b3a-192e9e958026" />
<attribute id="Name" type="LSString" value="WLF_FS_NKD_Body_ClothCollider" />
<attribute id="Name" type="LSString" value="FS_NKD_Body_ClothCollider" />
<attribute id="_OriginalFileVersion_" type="int64" value="144537400540921856" />
<attribute id="_OriginalFileVersion_" type="int64" value="144537400540921856" />
<children>
<children>
Line 160: Line 160:
</node>
</node>
</region>
</region>
</syntaxhighlight>
</syntaxhighlight>The Radius attributes control how large each "sphere" of collision is. You can make it bigger or smaller to make cloth physics behave differently when colliding with it.
 
Place this bank inside your body _merged.lsf.lsx file.
[[Category:Modding guides]]

Latest revision as of 14:34, 17 April 2024

If making a custom body, you may need to create a custom cloth collider for it. You can look up any vanilla cloth collider to use as a base, but here is an example one:
<region id="ClothColliderBank">
		<node id="ClothColliderBank">
			<children>
				<node id="Resource">
					<attribute id="ID" type="FixedString" value="a16538a0-69f3-4537-8b3a-192e9e958026" />
					<attribute id="Name" type="LSString" value="FS_NKD_Body_ClothCollider" />
					<attribute id="_OriginalFileVersion_" type="int64" value="144537400540921856" />
					<children>
						<node id="Spheres">
							<attribute id="AttachedName" type="FixedString" value="Ankle_R" />
							<attribute id="Name" type="FixedString" value="Ankle_R" />
							<attribute id="Position" type="fvec3" value="0.02408487 0.008219436 0.0002600327" />
							<attribute id="Radius" type="float" value="0.115" />
						</node>
						<node id="Spheres">
							<attribute id="AttachedName" type="FixedString" value="Knee_R" />
							<attribute id="Name" type="FixedString" value="Knee_R" />
							<attribute id="Position" type="fvec3" value="0.1842566 0.01101419 -0.2196186" />
							<attribute id="Radius" type="float" value="0.12" />
							<children>
								<node id="Links">
									<attribute id="Link" type="FixedString" value="Hip_R_Twist_02" />
								</node>
							</children>
						</node>
						<node id="Spheres">
							<attribute id="AttachedName" type="FixedString" value="Hip_R_Twist_02" />
							<attribute id="Name" type="FixedString" value="Hip_R_Twist_02" />
							<attribute id="Position" type="fvec3" value="0.2335134 -0.009342965 0.0003812611" />
							<attribute id="Radius" type="float" value="0.12" />
							<children>
								<node id="Links">
									<attribute id="Link" type="FixedString" value="Hip_R" />
								</node>
								<node id="Links">
									<attribute id="Link" type="FixedString" value="Ankle_R" />
								</node>
							</children>
						</node>
						<node id="Spheres">
							<attribute id="AttachedName" type="FixedString" value="Hip_R_Twist_01" />
							<attribute id="Name" type="FixedString" value="Hip_R_Twist_01" />
							<attribute id="Position" type="fvec3" value="0.2496572 -0.03000538 0.009381257" />
							<attribute id="Radius" type="float" value="0.12" />
							<children>
								<node id="Links">
									<attribute id="Link" type="FixedString" value="Hip_R" />
								</node>
							</children>
						</node>
						<node id="Spheres">
							<attribute id="AttachedName" type="FixedString" value="Hip_R" />
							<attribute id="Name" type="FixedString" value="Hip_R" />
							<attribute id="Position" type="fvec3" value="0.03671718 0.02558749 -0.03661869" />
							<attribute id="Radius" type="float" value="0.175" />
							<children>
								<node id="Links">
									<attribute id="Link" type="FixedString" value="Root_M" />
								</node>
							</children>
						</node>
						<node id="Spheres">
							<attribute id="AttachedName" type="FixedString" value="Ankle_L" />
							<attribute id="Name" type="FixedString" value="Ankle_L" />
							<attribute id="Position" type="fvec3" value="-0.02430184 -0.008254398 -5.885959E-07" />
							<attribute id="Radius" type="float" value="0.115" />
						</node>
						<node id="Spheres">
							<attribute id="AttachedName" type="FixedString" value="Knee_L" />
							<attribute id="Name" type="FixedString" value="Knee_L" />
							<attribute id="Position" type="fvec3" value="-0.183996 -0.01075782 -4.082918E-06" />
							<attribute id="Radius" type="float" value="0.12" />
							<children>
								<node id="Links">
									<attribute id="Link" type="FixedString" value="Hip_L_Twist_02" />
								</node>
							</children>
						</node>
						<node id="Spheres">
							<attribute id="AttachedName" type="FixedString" value="Hip_L_Twist_02" />
							<attribute id="Name" type="FixedString" value="Hip_L_Twist_02" />
							<attribute id="Position" type="fvec3" value="-0.2332943 0.009374093 -6.183982E-07" />
							<attribute id="Radius" type="float" value="0.12" />
							<children>
								<node id="Links">
									<attribute id="Link" type="FixedString" value="Hip_L" />
								</node>
								<node id="Links">
									<attribute id="Link" type="FixedString" value="Ankle_L" />
								</node>
							</children>
						</node>
						<node id="Spheres">
							<attribute id="AttachedName" type="FixedString" value="Hip_L_Twist_01" />
							<attribute id="Name" type="FixedString" value="Hip_L_Twist_01" />
							<attribute id="Position" type="fvec3" value="-0.249878 0.0301131 -0.00954318" />
							<attribute id="Radius" type="float" value="0.125" />
							<children>
								<node id="Links">
									<attribute id="Link" type="FixedString" value="Hip_L" />
								</node>
							</children>
						</node>
						<node id="Spheres">
							<attribute id="AttachedName" type="FixedString" value="Hip_L" />
							<attribute id="Name" type="FixedString" value="Hip_L" />
							<attribute id="Position" type="fvec3" value="-0.03669894 -0.02522373 0.0368407" />
							<attribute id="Radius" type="float" value="0.175" />
							<children>
								<node id="Links">
									<attribute id="Link" type="FixedString" value="Root_M" />
								</node>
							</children>
						</node>
						<node id="Spheres">
							<attribute id="AttachedName" type="FixedString" value="Chest_M" />
							<attribute id="Name" type="FixedString" value="Chest_M" />
							<attribute id="Position" type="fvec3" value="0.1746373 0.009826064 1.951149E-05" />
							<attribute id="Radius" type="float" value="0.2" />
							<children>
								<node id="Links">
									<attribute id="Link" type="FixedString" value="Spine2_M" />
								</node>
							</children>
						</node>
						<node id="Spheres">
							<attribute id="AttachedName" type="FixedString" value="Spine2_M" />
							<attribute id="Name" type="FixedString" value="Spine2_M" />
							<attribute id="Position" type="fvec3" value="0.1052495 0.02236807 9.536742E-07" />
							<attribute id="Radius" type="float" value="0.15" />
							<children>
								<node id="Links">
									<attribute id="Link" type="FixedString" value="Spine1_M" />
								</node>
							</children>
						</node>
						<node id="Spheres">
							<attribute id="AttachedName" type="FixedString" value="Spine1_M" />
							<attribute id="Name" type="FixedString" value="Spine1_M" />
							<attribute id="Position" type="fvec3" value="0.0001251698 -0.005512714 4.768372E-07" />
							<attribute id="Radius" type="float" value="0.15" />
							<children>
								<node id="Links">
									<attribute id="Link" type="FixedString" value="Root_M" />
								</node>
							</children>
						</node>
						<node id="Spheres">
							<attribute id="AttachedName" type="FixedString" value="Root_M" />
							<attribute id="Name" type="FixedString" value="Root_M" />
							<attribute id="Position" type="fvec3" value="-0.04438829 -0.04123938 -2.205372E-06" />
							<attribute id="Radius" type="float" value="0.18" />
						</node>
					</children>
				</node>
			</children>
		</node>
	</region>
The Radius attributes control how large each "sphere" of collision is. You can make it bigger or smaller to make cloth physics behave differently when colliding with it.

Place this bank inside your body _merged.lsf.lsx file.