materials.txt - originalfoo/Prison-Architect-API GitHub Wiki

Overview

The data/materials.txt file defines everything that can appear on the map and also the stuff in many of the menus.

Note: You can view the base game's main.dat/data/materials.txt for reference.

##Modding

Start by creating an empty data/materials.txt file within your mod, then add in only the definitions (see later) that are customised by your mod.

For example, if your mod is in a folder called MyFirstMod, then materials.txt would be located here:

MyFirstMod/data/materials.txt

Now, you're ready to start adding definitions...

###Definition Blocks

There are several types of definition block that can be used in materials.txt, depending on what you want to add or replace - click the links below to find out more:

Each definition has a Name setting. If your definition has the same Name as something in the base game's materials.txt, your definition will overwrite the original. This allows you to change the things defined in the game from within your mod.

###Settings

Within each definition block you'll add one or more settings. The Name setting mentioned above is mandatory and must always be included, but most of the others are optional.

A full list of all known settings is listed in the sidebar. Which ones you can or should use depends on the type of definition block you're using (see the links in section above for more information).

Modding Example

Editing materials.txt changes the default properties of in-game Objects and Entities
-- Give all (new) guards shotguns

-- Original Guard materials.txt Entry
BEGIN Object     
    Name                 Guard  
    MoveSpeedFactor      0.500000  
    Toughness            20.0000  
    Price                -500  
    RenderDepth          2  
    ViewRange            12
    BlockedBy            Wall  
    BlockedBy            StaticObject  
    BlockedBy            UtilityStation  
    Sprite               Guard
    SpriteVariants       4  
    Properties           Entity
    Properties           Staff
    Properties           Guard
    Equipment            Baton
END

-- Guards with Shotguns materials.txt Entry
BEGIN Object     
    Name                 Guard  
    MoveSpeedFactor      0.500000  
    Toughness            20.0000  
    Price                -500  
    RenderDepth          2  
    ViewRange            12
    BlockedBy            Wall  
    BlockedBy            StaticObject  
    BlockedBy            UtilityStation  
    Sprite               Guard
    SpriteVariants       4  
    Properties           Entity
    Properties           Staff
    Properties           Guard
    Equipment            Shotgun
END
⚠️ **GitHub.com Fallback** ⚠️