Changes

Jump to navigation Jump to search
3 bytes removed ,  17:38, 29 August 2025
Line 178: Line 178:  
You can add mesh replacements, which work kind of like the texture atlas, but allow the player to replace entire meshes + materials for a piece of furniture. This feature is only available as of Beta 1.7.35.
 
You can add mesh replacements, which work kind of like the texture atlas, but allow the player to replace entire meshes + materials for a piece of furniture. This feature is only available as of Beta 1.7.35.
   −
Replacements are grouped together, replacement groups can be mapped to one or more furniture. As an example, all stairs in the game use 2 replacement groups: "Stairs" and "Railings". Each group contains a list of possible replacements for that group, e.g. "metal", "glass", "fence". The replacement has a thumbnail for the UI and a material that all meshes that get replaced will use, when that replacement is active. Each replacement also has a list of mesh replacements, which tell the game which objects should use which mesh when that replacement is active, e.g "Stairs", "Platform" and "Support" for the "Stairs" replacement, and "Pole" and "Railing" for the "Railing" replacement.
+
Replacements are grouped together, replacement groups can be mapped to one or more furniture. As an example, all stairs in the game use 2 replacement groups: "Stairs" and "Railings". Each group contains a list of possible replacements for that group, e.g. "metal", "glass", "fence". The replacement has a thumbnail for the UI and a material that all meshes that get replaced will use, when that replacement is active. Each replacement also has a list of key/mesh pairs, which tell the game which objects should use which mesh when that replacement is active, e.g "Stairs", "Platform" and "Support" for the "Stairs" replacement, and "Pole" and "Railing" for the "Railing" replacement.
    
So the overall structure is:
 
So the overall structure is:
Line 236: Line 236:  
Other than the elements described so far, all tables added to the root table are interpreted as Unity MonoBehaviour components. If you added a table called '''BoxCollider''', the children records would be interpreted as variables of the BoxCollider component and if the component does not exist, it will be instantiated for the Furniture. All MonoBehaviour variables in a Component will use the '''ComponentName''' record set in the other tags, or alternatively you can add a Transforms list to define empty transforms with a Name, Position and Rotation. Using '''self''' as a value for a MonoBehaviour variable will find the corresponding component in the root furniture object itself. This allows for anything to be added to a furniture, even MonoBehaviors from custom mods.
 
Other than the elements described so far, all tables added to the root table are interpreted as Unity MonoBehaviour components. If you added a table called '''BoxCollider''', the children records would be interpreted as variables of the BoxCollider component and if the component does not exist, it will be instantiated for the Furniture. All MonoBehaviour variables in a Component will use the '''ComponentName''' record set in the other tags, or alternatively you can add a Transforms list to define empty transforms with a Name, Position and Rotation. Using '''self''' as a value for a MonoBehaviour variable will find the corresponding component in the root furniture object itself. This allows for anything to be added to a furniture, even MonoBehaviors from custom mods.
   −
If you set the '''ParentTransform''' record to a '''ComponentName''' reference, the component will be fetched/added to that object instead of the root furniture object. This could be used to add a Light component to an empty object to make your own lights. Make sure to add a '''LampScript''' component to your furniture object if you’re making a custom lamp, so the game can control shadows and lighting.
+
If you set the '''TransformParent''' record to a '''ComponentName''' reference, the component will be fetched/added to that object instead of the root furniture object. This could be used to add a Light component to an empty object to make your own lights. Make sure to add a '''LampScript''' component to your furniture object if you’re making a custom lamp, so the game can control shadows and lighting.
    
Adding a '''RemoveComponent True''' record for a table will remove that MonoBehavior from the furniture or '''TransformParent'''.
 
Adding a '''RemoveComponent True''' record for a table will remove that MonoBehavior from the furniture or '''TransformParent'''.

Navigation menu