Consumables
To avoid confusion with actual Materials (terrain, floor and building materials, etc.), we refer to Objects that use
Properties
Material
as "Consumables" throughout the entirety of this wiki.
##Overview
##Modding
The following modding options are available...
###Menus & Menu Icons
Consumables generally don't appear on any menu; however as the Utility
consumables (see sidebar) illustrate, it's possible to put consumables on a menu (most likely the Objects or Utilities menus).
For more details on the required settings for various menus, see Menus.
###Sprites
The Sprite
of a consumable 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.
Note: Many consumable sprites, especially the stack sprites, spill over in to people.png
, which is silently merged with objects.png
when the game loads. For more information on that weirdness, see objects.spritebank
.
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.
###Consumable Definitions
Add or replace consumables using BEGIN Object...
definition blocks within data/
materials.txt
, and make sure to add the Properties
Material
setting to denote that the object is a consumable.
A list of known settings is shown below. Bullet points are just for aesthetics (don't include them in your definition). Bold settings are mandatory, the others are optional.
BEGIN Object
Name
<consumableId>
-
MadeOf
<id>
-
MaxStackSize
<number>
- must also defineStackSprite
setting (see below) -
MoveSpeedFactor
<number>
-
Price
<number>
-
Properties
Material
- required to identify object as a consumable -
Properties
Sellable
-
Properties
SlowDelivery
-
RenderDepth
1
-
Sprite
<spriteId>
- usingobjects.png
- [
Sprite ... *
](Sprite (sprites.png)) - usingsprites.png
x <offset> y <offset>
w <offset> h <offset>
-
RotateType
<mode>
Marker ... *
-
SpriteScale
<number>
-
StackSprite
<spriteId>
- required if you definedMaxStackSize
-
Teleportable
true|false
-
Toughness
<number>
END
#####Utility consumables
There is a special collection of consumables relating to Utilities. Uniquely, this collection appears on the Utilities
menu and can be placed in-game by the player, and as a result these specific consumables have a bunch of extra settings:
-
BlockedBy
LargePipe
- only forSmallPipe
consumable -
BlockedBy
UtilityStation
-
ConstructionTime
1.00000
- required for menu inclusion -
Group
LargePipe
- only forLargePipe
consumable -
Group
SmallPipe
- only forSmallPipe
consumable -
Price
<number>
- required for menu inclusion -
Properties
Utility
- required for menu inclusion -
Properties
CanPlaceOnRoad
-
RenderDepth
1
(for pipes) or2
(forElectricalCable
)
###Scripting
While all consumables can be scripted using data/
scripts/
, it's generally best to avoid scripting the consumables themselves due to the vast quantities of them that can appear on the map (which would grind the game to a halt with all those events being triggered every frame).
Instead, script some other object and have that centrally iterate the consumable as applicable.
todo: grants.lua
todo: campaign scripting
##Notes
##See Also
^ Open "Pages" to Search
Stacks:
- [
Box
](Box (Consumable)) - [
Stack
](Stack (Consumable))
- [
Brick
](Brick (Consumable)) - [
Concrete
](Concrete (Consumable)) - [
GrassTurf
](GrassTurf (Consumable)) - [
Steel
](Steel (Consumable))
[Utilities:](Utilities (Room))
- [
ElectricalCable
](ElectricalCable (Consumable)) - [
PipeLarge
](PipeLarge (Consumable)) - [
PipeSmall
](PipeSmall (Consumable))
[Kitchen:](Kitchen (Room))
- [
Ingredients
](Ingredients (Consumable)) - [
IngredientsCooking
](IngredientsCooking (Consumable)) - [
IngredientsCooked
](IngredientsCooked (Consumable)) - [
IngredientsSpoiled
](IngredientsSpoiled (Consumable))
[Canteen:](Canteen (Room))
- [
Meal
](Meal (Consumable)) - [
FoodTray
](FoodTray (Consumable)) - [
FoodTrayDirty
](FoodTrayDirty (Consumable))
[Cleaning:](CleaningCupboard (Room))
- [
Bleach
](Bleach (Consumable))
[Laundry:](Laundry (Room))
- [
PrisonerUniform
](PrisonerUniform (Consumable)) - [
CrumpledPrisonerUniform
](CrumpledPrisonerUniform (Consumable)) - [
DirtyPrisonerUniform
](DirtyPrisonerUniform (Consumable))
[Library:](Library (Room))
- [
LibraryBookSorted
](LibraryBookSorted (Consumable)) - [
LibraryBookUnsorted
](LibraryBookUnsorted (Consumable))
[Forestry:](Forestry (Room))
- [
Log
](Log (Consumable))
[Workshop:](Workshop (Room))
- [
Wood
](Wood (Consumable)) - [
SheetMetal
](SheetMetal (Consumable)) - [
LicensePlateBlank
](LicensePlateBlank (Consumable)) - [
LicensePlate
](LicensePlate (Consumable))
[Mail:](MailRoom (Room))
- [
MailSatchel
](MailSatchel (Consumable)) - [
MailSorted
](MailSorted (Consumable)) - [
MailUnsorted
](MailUnsorted (Consumable))
[Shop:](Shop (Room))
- [
ShopGoods
](ShopGoods (Consumable))