Skip to content
aubergine10 edited this page Dec 6, 2015 · 4 revisions

Needs further investigation

##Overview

Objects Utilities

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

##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.

###data/scripts/

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

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

Clone this wiki locally