AttachToWall - originalfoo/Prison-Architect-API GitHub Wiki
Needs further investigation
##Overview
The AttachToWall setting is only applicable for Objects (and their derivatives) and defines whether the object, when placed, should be moved closer to adjacent walls or not.
##Syntax
The optional setting is used in materials.txt and must be within a BEGIN Object ... definition block. It can be used only once per definition block.
AttachToWall true|false
If true, the object will be repositioned when placed next to a wall so that it looks like it's attached directly to the wall (no gap between object and wall). If false, it won't be repositioned.
A default of AttachToWall false is used if the setting is omitted.
##Example
AttachToWall true
##Example Mods
- Chad's Drinks Mod - takes account of this property in Lua script
-
Various Modification Mod 1.3 - fixes gaps between
Cookerand walls, amongst other things.
##Notes
Sprite design is essential when using AttachToWall true - if there is a gap around the edge of the sprite, the results will generally be ugly.
It's not particularly clear what happens when an object has
AttachToWall trueand is then placed with walls on opposite sides - which wall does it choose, if any?
When attaching to a wall, the game will automatically update the positions of Marker positions for slots.
The scripting API doesn't expose the setting to scripts, however if you know an object uses AttachToWall true you can compensate as follows:
For a south-facing object, the .Pos.x gets offset by and the .Pos.y gets offset by . You can use these values, in conjunction with the .Or property and .Walls property (or maybe more reliable Object.GetMaterial() method), to offset any associated objects (eg. spawned objects) if required.
##See Also

