Overview
This guide shows how to define rooms in materials.txt…
Introduction
Rooms are areas which can be drawn in buildings, and sometimes outdoors, that define the specific use of that part of your prison.
Note: This is an add-on to the main Materials.txt – Overview guide – if you are new to modding PA, it’s recommended that you read that guide first to get a basic understanding of how materials.txt works.
Example Room Definition
To give a quick overview, here’s an example of a room definition from a mod I’m working on:
Physical attributes
Does the room have to be a minimum size before it becomes operational?
- Optional: Defaults to minimum of 1×1
- Value type: Bitmask
- Singleton: Can be used only once per room definition
- Lua script: Not scriptable
Example:
The example above requires the room to be either 3×2 or 2×3 before it becomes oprerational.
Note: You can place rooms smaller than the minimum size, but they won’t be usable until you make them greater than or equal to the minimum size.
Is this room treated as an individual sector (security zone) even if it’s not enclosed by walls and doors?
- Optional: Defaults to not being a unique sector
- Value type: Bitmask
- Singleton: Can be used only once per room definition
- Lua script: Not scriptable
Example:
An example in the vanilla game is the canteen.
Does this room need to be enclosed by walls and doors around its edges before it becomes operational?
- Optional: Defaults to not requiring walls and doors
- Value type: Bitmask
- Singleton: Can be used only once per room definition
- Lua script: Not scriptable
Example:
Does this room need to be secured (no escape routes) before it becomes operational?
- Optional: Defaults to not needing to be secure
- Value type: Bitmask
- Singleton: Can be used only once per room definition
- Lua script: Not scriptable
Example:
Placement attributes
Can this room only be placed indoors?
- Optional: Defaults to not requiring indoor placement
- Value type: Bitmask
- Singleton: Can be used only once per room definition
- Lua script: Not scriptable
Example:
Can this room only be placed outside (not in a building)?
- Optional: Defaults to not requiring outdoor placement
- Value type: Bitmask
- Singleton: Can be used only once per room definition
- Lua script: Not scriptable
Example:
Which research is required before the room can be placed?
- Optional: Defaults to none
- Value type: Srting (research id as defined in research.txt)
- Singleton: Can be used only once per room definition
- Lua script: Not scriptable
Example:
Content Attributes
These properties define which objects should be in (or next to) the room, and whether those things are mandatory for the room to become operational.
Note: The ‘RoomSpecific’ property of an object (as defined in Materails.txt – Objects & Utilities) will hide it from the objects menu until a room which mentions it (either as ‘LikelyObject’ or ‘Object’ in the room definition) is visible near the middle of the map window.
What items of contraband might prisoners find in this room?
- Optional: Defaults to no contraband
- Value type: Bitmask
- Multiple: You can define multiple “Contraband” per room definition
- Lua script: Partially scriptable – eg. see Equipment property of entities. Not yet tested to see whether contraband can be spawned, deleted or located.
Example:
See Materials.txt – Equipment for details on how to define contraband items.
Which objects must be placed in the room for the room to become operational?
- Optional: Defaults to no mandatory objects
- Value type: Bitmask
- Multiple: You can define multiple “Object” requirements per room definition
- Lua script: You can spawn, delete, detect and fully interact with objects via scripts.
Example:
See Materials.txt – Objects & Utilities for details on how to define items that can go in rooms.
Does an object need placing adjacent to the room (eg. in or on a wall surrounding the room) before the room becomes operational?
- Optional: Defaults to no mandatory objects
- Value type: Bitmask
- Multiple: You can define multiple “Object” requirements per room definition
- Lua script: You can spawn, delete, detect and fully interact with objects via scripts.
Example:
An example in the vanilla game is the shop front that’s needed next to a shop.
Note: In most cases you’ll need to allow the object to be placed in or on a wall via it’s definition in materials.txt. For more information on how to do that see Materials.txt – Objects & Utilities.
Which optional objects are likely to appear in the room?
- Optional: Defaults to no likely objects
- Value type: Bitmask
- Multiple: You can define multiple “LikelyObject” per room definition
- Lua script: You can spawn, delete, detect and fully interact with objects via scripts.
Example:
See Materials.txt – Objects & Utilities for details on how to define items that can go in rooms.
Interaction Attributes
Can this room be captured by gangs?
- Optional: Defaults to false
- Value type: Boolean
- Singleton: Can be used only once per room definition
- Lua script: Not scriptable
Example:
Can prisoners work in this room?
- Optional: Defaults to no prison labour
- Value type: Bitmask
- Singleton: Can be used only once per room definition
- Lua script: Not scriptable
Example:
What qualification do prisoners require before they can work in the room?
- Optional: Defaults to none
- Value type: String (qualification id)
- Singleton: Can be used only once per room definition
- Lua script: Not scriptable
Example:
Which workgroup is associated with this room?
- Optional: Defaults to none
- Value type: String (workgroup id)
- Singleton: Can be used only once per room definition
- Lua script: Not scriptable
Example:
Note: I’m still not entirely sure how workgroups are set up and used; they don’t seem to be mandatory for rooms that allow prison labour. If you know please post details in comments at end of page.
Sprites
Room sprites are difficult to implement because you have to overwrite one of the main game files rather than using a separate sprites.png; this means that only one mod at a time can update room sprites (epic fail!). Details will be added at a later date.