Changes

Jump to navigation Jump to search
4,623 bytes added ,  14:42, 4 May 2016
Line 540: Line 540:     
=== Snap points ===
 
=== Snap points ===
 +
Snap points are points at which certain furniture can be snapped to other furniture, like chairs to tables.
 +
 +
If you have used the Base attribute, the furniture will inherit its snap points from the base furniture, unless you add the “SnapPoints” tag.
 +
 +
Snap points should define a Name, which will control which furniture can snap to it, currently in use in the base game is “PCAddon”, “AtTable” and “OnTable”. “Food” is also used in the game for tables which should allow for food but not OnTable furniture, like benches. They should also have Position and Rotation defined.
 +
 +
You can define a ComponentName tag to name the snap point for later reference.
 +
 +
Snap points can also have “CheckValid” defined, which controls whether the game should allow for something to be placed no matter if there are collisions. This calculation is heavy, but not needed for stuff like computers and computer add-ons.
 +
 +
Finally, snap points can define Links, which is a comma separated list of linked snap points, referencing the ith snap point defined (zero index). Links are currently used to link chairs with computers and chairs with food. E.g. for the square table, the OnTable point is linked to all AtTable points around it. The bench does not have chairs and instead the “Use” interaction points are defined in the same order as its “Food” snap points so the game knows where to put the employee’s food and how to save it to a file.
    
=== Components ===
 
=== Components ===
 +
Other than the tags described so far, all tags are interpreted as MonoBehaviour components. If you added a tag called “<BoxCollider>”, the children tags 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 reference set in the other tags, or alternatively you can add a Transforms tag to define empty objects with a Name, Position and Rotation. Using “self” as a value for a MonoBehaviour variable will find the corresponding component in the furniture object itself. This allows for anything to be added to a furniture, even MonoBehaviors from custom mods.
 +
 +
If you set the Parent attribute to a ComponentName reference or Transforms reference, the component will be fetched/added to the object instead. This could be used to add a PointLight 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.
 +
 +
Setting a Destroy attribute to “True” for a tag will remove that MonoBehavior from the furniture.
 +
 +
Note that using MonoBehaviors from other mods requires setting the Namespace attribute and the Assembly attribute so the game knows where to find the classes, e.g. <MyCustomComponent Namespace=”MyMod.Behaviours.” Assembly=”MyMod”>.
 +
 +
==== Furniture ====
 +
This component will always be present in a furniture. Common variables to edit would be:
 +
* Type
 +
* Category
 +
* Cost
 +
* ButtonDescription
 +
* ComputerPower
 +
* RoleBuffs
 +
* Lighting
 +
* Coffee
 +
* Wait
 +
* AuraValues
 +
* Wattage
 +
* Water
 +
* Noisiness
 +
* Comfort
 +
* Environment
 +
* DefaultColorGroup
 +
* PrimaryColorName
 +
* SecondaryColorName
 +
* TertiaryColorName
 +
* ColorPrimaryEnabled
 +
* ColorSecondaryEnabled
 +
* ColorTertiaryEnabled
 +
* ForceColorSecondary
 +
* ForceColorTertiary
 +
* ColorPrimaryDefault
 +
* ColorSecondaryDefault
 +
* ColorTertiaryDefault
 +
* ColorableLights
 +
* LightPrimary
 +
* BuildBoundary
 +
* NavBoundary
 +
* OnXEdge
 +
* OnYEdge
 +
* CanRotate
 +
* Height1
 +
* Height2
 +
* BasementValid
 +
* OnlyExteriorWalls
 +
* WallFurn
 +
* IsSnapping
 +
* SnapsTo
 +
* CanAssign
 +
* ValidIndoors
 +
* ValidOutdoors
 +
* ValidOnFence
 +
* MaxQueue
 +
* ForceAccessible
 +
* ITFix
 +
* UnlockYear
 +
* TemperatureController
 +
* HeatCoolPotential
 +
* EqualizeTemperature
 +
* AlwaysOn
 +
* ComputerTransform
 +
* OriginalOffset
 +
* PCAddonOffset
 +
* OriginalRotation
 +
* PCAddonRotation
 +
* PokesThroughWall
 +
* CanLean
 +
* UseStandardMat
 +
* TwoFloors
 +
* OffsetPoints
 +
* InterPoints
 +
* UpperFloorFrame
 +
* HoldablePoints
 +
* DespawnHoldables
 +
* DespawnHour
    
==== Upgradable ====
 
==== Upgradable ====
 +
This component makes this furniture repairable. Common variables to edit would be:
 +
* TheScreen
 +
* SmokePosition
 +
* TimeToAtrophy
 +
* UpgradePrice
 +
* OnMat
 +
* OffMat
 +
* DegradeAlways
 +
* AffectedByTemp
    
==== TableScript ====
 
==== TableScript ====
 +
This component handles tables and table grouping for meeting, canteens, etc.
    
==== LampScript ====
 
==== LampScript ====
 +
This component handles lighting and shadows for lamps.
    
==== Server ====
 
==== Server ====
 +
This component makes this furniture a server. It is recommended to inherit from a server furniture, as the server component uses some in-game objects, like a text mesh and a wire mesh. Use the Power variable to change its power in mb.
    
== Modding with DLLs ==
 
== Modding with DLLs ==

Navigation menu