-
Notifications
You must be signed in to change notification settings - Fork 5
AttachToWall
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
Cooker
and 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 true
and 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
^ Open "Pages" to Search
Settings:
*
= multi-use per block...
=BEGIN...END
block
-
Name
<objectId>
-
AttachToWall
true|false
-
AttackPower
<number>
-
AutoOrder
<objectId>
-
AutoOrderQuantity
<num>
-
BlockedBy *
<groupId>
-
BlockMovement
true|false
-
BlockVisibility
true|fals
-
Capturable
true|false
-
ConstructionTime
<time>
-
Contraband ... *
<eqipId>
- [
Entity
](Entity (Callout))<entityId>
-
Equipment
<equipmentId>
-
Group
<groupId>
-
Height
<tiles>
-
IndoorOutdoor
<mode>
-
LikelyObject ... *
<objId>
-
MadeOf
<id>
-
MaxNumber
<number>
-
MaxStackSize
<number>
-
MoveCost
<number>
-
MoveSpeedFactor
<number>
-
NumEntities
<number>
-
NumSlots
<number>
-
NumSprites
<number>
-
ObjectRequired
<consumableId>
-
Price
<number>
-
Properties *
<id>
-
Qualification
-
Range
<tiles>
-
RechargeTime
-
RenderDepth
<number>
-
RenderPostOffset
<number>
-
RenderPreOffset
<number>
-
Requirement ... *
<id>
-
Research
[<researchId>
](Name (research.txt)) -
Rotatable
true|false
-
Scale
<number>
-
SoftEdged
<mode>
-
Sprite
<spriteId>
- [
Sprite ... *
](Sprite (sprites.png))x <offset> y <offset>
w <offset> h <offset>
-
RotateType
<mode>
Marker ... *
-
Sprite0..N ... *
x <x> y <y>
-
SpriteOverlayScale
<num>
-
SpriteScale
<number>
-
SpriteType
<mode>
-
SpriteVariants
<number>
-
StackSprite
<spriteId>
-
Teleportable
true|false
-
ToolbarSprite
<spriteId>
-
Toughness
<number>
-
TwoHanded
true|false
- [
Vehicle
](Vehicle (Callout))<vehicleId>
-
ViewRange
<tiles>
-
Width
<tiles>
-
Workers ...
-
Workgroup
<id>
Equipment:
Name Sprite AttackPower num RechargeTime num Properties Weapons Properties NoImport Properties Improvised Properties Metal Properties Tools Scale TwoHanded true|false Range num Rotatable true|false - eg. book
Callouts:
Name Cost num MaxNumber num Vehicle vehicleId Entity entityId NumEntities Sprite