Mask Trigger Collision Script
This page is part of the Building making tutorial. The game actually does this automatically, every time the mod is loaded to the game. So, you only need to do this IF you need some other settings than default for the collision. Which includes weather dust interior removal. This is the reason I do not delete this page, as someone might need to change the flags, some day.
NOTE NOTE NOTE This script only works with cube as the collision starting primitive. If your exported xml says ‘triangle’ this will not work. Unfortunately I could not find a vanilla collision script that was made for triangles (or any other shape than a cube), so I do not know what changes would need to be done to make the script work for non-cube primitives.
How to make a Mask Trigger Collision Script
-
Crate a collision file normally for your mask trigger, move it to your mod folder and then just edit with notepad++ or visual studio and copy the dimensions to a separate notepad
-
Replace the entirety of it with the code below.
-
Replace “D:\Kenshi\mods\MyMod\buildings\FloorOneTrigger.xml” with your mod’s actual path and collision xml file name.
NOTENOTENOTE: it HAS TO be the same name as the actual script and it has to be your mod’s folder!! This is not a reference to the mesh, this is reference to itself.
- Search for dimensions and replace the data on
with your dimensions. If you have an off-center build, also replace the global position with yours.
If you need to make an odd shaped mask, fe. a pyramid etc. export the mesh as normal but create a collision box shape that encompasses the building and export that as collision shape box. Opening that in an editor (like notepad++ or visual studio) allows you to copy the dimensions and global position. Do not adjust the collision shape in this script.
Remember, if you replace an existing house collision, to delete its bin file before testing.
<density>0</density>
<NxActorFlag id\="flags">
<NX\_AF\_DISABLE\_COLLISION>false</NX\_AF\_DISABLE\_COLLISION>
<NX\_AF\_DISABLE\_RESPONSE>false</NX\_AF\_DISABLE\_RESPONSE>
<NX\_AF\_LOCK\_COM>false</NX\_AF\_LOCK\_COM>
<NX\_AF\_FLUID\_DISABLE\_COLLISION>false</NX\_AF\_FLUID\_DISABLE\_COLLISION>
<NX\_AF\_CONTACT\_MODIFICATION>false</NX\_AF\_CONTACT\_MODIFICATION>
<NX\_AF\_FORCE\_CONE\_FRICTION>false</NX\_AF\_FORCE\_CONE\_FRICTION>
<NX\_AF\_USER\_ACTOR\_PAIR\_FILTERING>false</NX\_AF\_USER\_ACTOR\_PAIR\_FILTERING>
</NxActorFlag>
<group>0</group>
<compartment></compartment>
<NxConvexShapeDesc meshData\="ConvexMesh\_0">
<NxMeshShapeFlag id\="meshFlags">
<NX\_MESH\_SMOOTH\_SPHERE\_COLLISIONS>false</NX\_MESH\_SMOOTH\_SPHERE\_COLLISIONS>
<NX\_MESH\_DOUBLE\_SIDED>false</NX\_MESH\_DOUBLE\_SIDED>
</NxMeshShapeFlag>
<NxShapeDesc userProperties\="" name="Storm\_Shack\_INTERIOR\_TRIGGER">
<localPose>1 0 0 0 1 0 0 0 1 0 0 0</localPose>
<NxShapeFlag id\="shapeFlags">
<NX\_TRIGGER\_ON\_ENTER>false</NX\_TRIGGER\_ON\_ENTER>
<NX\_TRIGGER\_ON\_LEAVE>false</NX\_TRIGGER\_ON\_LEAVE>
<NX\_TRIGGER\_ON\_STAY>false</NX\_TRIGGER\_ON\_STAY>
<NX\_SF\_VISUALIZATION>true</NX\_SF\_VISUALIZATION>
<NX\_SF\_DISABLE\_COLLISION>false</NX\_SF\_DISABLE\_COLLISION>
<NX\_SF\_FEATURE\_INDICES>false</NX\_SF\_FEATURE\_INDICES>
<NX\_SF\_DISABLE\_RAYCASTING>false</NX\_SF\_DISABLE\_RAYCASTING>
<NX\_SF\_POINT\_CONTACT\_FORCE>true</NX\_SF\_POINT\_CONTACT\_FORCE>
<NX\_SF\_FLUID\_DRAIN>false</NX\_SF\_FLUID\_DRAIN>
<NX\_SF\_FLUID\_DISABLE\_COLLISION>false</NX\_SF\_FLUID\_DISABLE\_COLLISION>
<NX\_SF\_FLUID\_TWOWAY>false</NX\_SF\_FLUID\_TWOWAY>
<NX\_SF\_DISABLE\_RESPONSE>false</NX\_SF\_DISABLE\_RESPONSE>
<NX\_SF\_DYNAMIC\_DYNAMIC\_CCD>false</NX\_SF\_DYNAMIC\_DYNAMIC\_CCD>
<NX\_SF\_DISABLE\_SCENE\_QUERIES>false</NX\_SF\_DISABLE\_SCENE\_QUERIES>
<NX\_SF\_CLOTH\_DRAIN>false</NX\_SF\_CLOTH\_DRAIN>
<NX\_SF\_CLOTH\_DISABLE\_COLLISION>false</NX\_SF\_CLOTH\_DISABLE\_COLLISION>
<NX\_SF\_CLOTH\_TWOWAY>true</NX\_SF\_CLOTH\_TWOWAY>
<NX\_SF\_SOFTBODY\_DRAIN>false</NX\_SF\_SOFTBODY\_DRAIN>
<NX\_SF\_SOFTBODY\_DISABLE\_COLLISION>false</NX\_SF\_SOFTBODY\_DISABLE\_COLLISION>
<NX\_SF\_SOFTBODY\_TWOWAY>true</NX\_SF\_SOFTBODY\_TWOWAY>
</NxShapeFlag>
<group>0</group>
<materialIndex>1</materialIndex>
<CCDSkeleton></CCDSkeleton>
<shapeDensity>0</shapeDensity>
<shapeMass>190.227828979</shapeMass>
<skinWidth>0.100000001</skinWidth>
<NxGroupsMask id\="groupsMask" bits0="1" bits1="0" bits2="1" bits3="0"/>
<NxShapeCompartmentType id\="nonInteractingCompartmentTypes">
<NX\_COMPARTMENT\_SW\_RIGIDBODY>false</NX\_COMPARTMENT\_SW\_RIGIDBODY>
<NX\_COMPARTMENT\_HW\_RIGIDBODY>false</NX\_COMPARTMENT\_HW\_RIGIDBODY>
<NX\_COMPARTMENT\_SW\_FLUID>false</NX\_COMPARTMENT\_SW\_FLUID>
<NX\_COMPARTMENT\_HW\_FLUID>false</NX\_COMPARTMENT\_HW\_FLUID>
<NX\_COMPARTMENT\_SW\_CLOTH>false</NX\_COMPARTMENT\_SW\_CLOTH>
<NX\_COMPARTMENT\_HW\_CLOTH>false</NX\_COMPARTMENT\_HW\_CLOTH>
<NX\_COMPARTMENT\_SW\_SOFTBODY>false</NX\_COMPARTMENT\_SW\_SOFTBODY>
<NX\_COMPARTMENT\_HW\_SOFTBODY>false</NX\_COMPARTMENT\_HW\_SOFTBODY>
</NxShapeCompartmentType>
</NxShapeDesc>
</NxConvexShapeDesc>
<dominanceGroup>0</dominanceGroup>
<contactReportFlags>0</contactReportFlags>
<forceFieldMaterial>0</forceFieldMaterial>
</NxActorDesc>
<NxActorGroupPair group0\="0" group1="0">
<NxContactPairFlag id\="flags">
<NX\_IGNORE\_PAIR>false</NX\_IGNORE\_PAIR>
<NX\_NOTIFY\_ON\_START\_TOUCH>true</NX\_NOTIFY\_ON\_START\_TOUCH>
<NX\_NOTIFY\_ON\_END\_TOUCH>true</NX\_NOTIFY\_ON\_END\_TOUCH>
<NX\_NOTIFY\_ON\_TOUCH>true</NX\_NOTIFY\_ON\_TOUCH>
<NX\_NOTIFY\_ON\_IMPACT>false</NX\_NOTIFY\_ON\_IMPACT>
<NX\_NOTIFY\_ON\_ROLL>false</NX\_NOTIFY\_ON\_ROLL>
<NX\_NOTIFY\_ON\_SLIDE>false</NX\_NOTIFY\_ON\_SLIDE>
<NX\_NOTIFY\_FORCES>false</NX\_NOTIFY\_FORCES>
<NX\_NOTIFY\_ON\_START\_TOUCH\_FORCE\_THRESHOLD>false</NX\_NOTIFY\_ON\_START\_TOUCH\_FORCE\_THRESHOLD>
<NX\_NOTIFY\_ON\_END\_TOUCH\_FORCE\_THRESHOLD>false</NX\_NOTIFY\_ON\_END\_TOUCH\_FORCE\_THRESHOLD>
<NX\_NOTIFY\_ON\_TOUCH\_FORCE\_THRESHOLD>false</NX\_NOTIFY\_ON\_TOUCH\_FORCE\_THRESHOLD>
</NxContactPairFlag>
</NxActorGroupPair>
</NxSceneDesc>
</NxuPhysicsCollection>