Objects
Were you looking for...?
- ...things on the "Objects" menu? See Statics and Doors.
- ...things on the "Utilities" menu? See Utilities and Wireables.
- ...things on the "Staff" menu? See Entities.
- ...room requirements? See
Object
,AdjacentObject
andLikelyObject
.- ...scripting global
Object
? See [Object (Global)](Object (Global)).Confusing, huh? Just you wait...
From an end-user perspective, Objects are things that appear on the "Objects" menu. However, from a modding perspective Objects define a vast range of additional things that appear on the map.
To try and avoid confusion, the wiki splits Objects in to several categories as shown in the sidebar (along with the Properties
used to put stuff in that category, where applicable).
Objects are highly moddable...
Objects appear in different menus (or no menus) depending on the settings used in their definition blocks within materials.txt
. For detailed information, choose your menu from the list below:
Stuff on other menus is defined elsewhere, see Menus for details.
Regardless of which of the three menus an object appears in, its menu icon can be defined in one of the following two ways:
ToolbarSprite
- Or the first defined
Sprite
...
The Sprite
of an object defines what it looks like on the map. There are two approaches to defining sprites (keep reading before choosing one):
Sprite
(usingobjects.png
)- [
Sprite
(usingsprites.png
)](Sprite (sprites.png))
If you're using a sprite that's already part of the base game, use the first approach (objects.png
). All you'll need to do is refer to the existing sprite by its name.
If you want to use a custom sprite, use the second approach (sprites.png
). There's even an [online sprite editor](Chad's Sprite Editor) you can use.
You can define multiple sprites for an object, and use either the SpriteVariants
setting to choose one at random when the object is placed on the map, or use .SubType
scripting to have precise control over which sprite is used.
###Object
Definitions
Add or replace objects (regardless of category) using BEGIN Object...
definition blocks within data/
materials.txt
A list of known settings is shown below. Which ones you can or should use depends on the category (see links in sidebar for more detailed information). Bullet points are just for aesthetics (don't include them in your definition). Bold settings are mandatory, the others are optional.
BEGIN Object
Name
<objectId>
-
AttachToWall
true|false
-
AutoOrder
<consumableId>
-
AutoOrderQuantity
<number>
- required ifAutoOrder
setting used -
BlockedBy *
<groupId>
-
ConstructionTime
<number>
-
Equipment
<equipmentId>
-
Group *
<groupId>
-
Height
<tiles>
-
MadeOf
<id>
-
MaxStackSize
<number>
--1
= don't stack? -
MoveSpeedFactor
<number>
-
NumSlots
<number>
- must also define markers (seeSprite
settings) -
Price
<number>
-
Properties *
<id>
-
RenderDepth
<number>
-
RenderPostOffset
<number>
-
RenderPreOffset
<number>
-
Research
[<researchId>
](Name (research.txt)) -
Sprite
<spriteId>
- usingobjects.png
- [
Sprite ... *
](Sprite (sprites.png)) - usingsprites.png
x <offset> y <offset>
w <offset> h <offset>
-
RotateType
<mode>
Marker ... *
-
SpriteScale
<number>
-
SpriteVariants
<number>
-
StackSprite
<spriteId>
-
Teleportable
true|false
-
ToolbarSprite
<spriteId>
-
Toughness
<number>
-
ViewRange
<number>
-
Width
<tiles>
-
Workers ...
- only forProcessor
objects -
Workgroup
<id>
END
All objects, regardless of category, can be scripted using data/
scripts/
todo: grants.lua
todo: campaign scripting
To move the object to the "Utilities" menu you'll need to add at least one of the following settings:
-
Group
UtilityStation
-
Properties
Utility
(not checked) -
Properties
Wired
To move the object to the "Staff" menu you'll need to add the following setting: