Overview
This guide shows how to define equipment (contraband, tools, weapons) in materials.txt…
Introduction
Equipment items cover all tools, narcotics, luxuries and weapons in the game. They do not appear on any menu but are instead found in rooms (contraband), on entities (equipment) and sometimes even smuggled in to the 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 Equipment Definition
To give a quick overview, here’s an example definition of some equipment that comes with the game:
There are a few other properties that we’ll cover later, but the example above covers the basics.
Physical Attributes
Should this equipment trigger metal detectors?
- Optional: Defaults to not triggering detectors
- Value type: Bitmask
- Multiple: You can define multiple “Properties” per definition, one for each value required
- Lua script: Not accessible
Example:
Is this equipment detectable by dogs?
- Optional: Defaults to not detectable by dogs
- Value type: Bitmask
- Multiple: You can define multiple “Properties” per definition, one for each value required
- Lua script: Not accessible
Example:
Does this equipment require both hands to use?
- Optional: Defaults to false (one-handed use)
- Value type: Boolean (true or false)
- Singleton: Can use only once per definition
- Lua script: Not accessible
Example:
What is the delay (in game seconds) between uses of this equipment?
- Optional: Defaults to 0.0
- Value type: Number >= 0
- Singleton: Can use only once per definition
- Lua script: Not accessible
Example:
Delivery Attributes
Prevent this equipment being imported (smuggled or thrown)?
- Optional: Defaults to allowing imports
- Value type: Bitmask
- Multiple: You can define multiple “Properties” per definition, one for each value required
- Lua script: Not accessible
Example:
Can this equipment be improvised (eg. a wooden pickaxe can be improvised in the workshop) by prisoners?
- Optional: Defaults to not improvised
- Value type: Bitmask
- Multiple: You can define multiple “Properties” per definition, one for each value required
- Lua script: Not accessible
Example:
Not sure how this works yet, will update when I find out.
Staff and other entities can have equipment (see Materials.txt – Entities for details). If they get attacked they will sometimes drop that equipment.
Rooms can be sources of equipment (see Materials.txt – Rooms for details). Prisoners gaining access to those rooms can steal the equipment.
Some materials can be purchased from shops or become available due to production processes.
Tools Attributes
Can this equipment be used as a tool?
- Optional: Defaults to not being a tool
- Value type: Bitmask
- Multiple: You can define multiple “Properties” per definition, one for each value required
- Lua script: Not accessible
Example:
Not sure how to invoke the use of a tool yet, will update when I work out how.
Contraband Attributes
Is this narcotics (eg. drugs, booze) equipment?
- Optional: Defaults to not being narcotics
- Value type: Bitmask
- Multiple: You can define multiple “Properties” per definition, one for each value required
- Lua script: Not accessible
Example:
Is this luxuries (eg. mobile phone) equipment?
- Optional: Defaults to not being luxury
- Value type: Bitmask
- Multiple: You can define multiple “Properties” per definition, one for each value required
- Lua script: Not accessible
Example:
Weapons
Can this equipment be used as a weapon?
- Optional: Defaults to not being a weapon
- Value type: Bitmask
- Multiple: You can define multiple “Properties” per definition, one for each value required
- Lua script: Not accessible
Example:
You need to define this property in order to use any of the following 3 properties…
How much damage does this weapon do?
- Optional-ish: Defaults to 0.0; for weapons it should always be > 0
- Value type: Number >= 0.0
- Singleton: Can use only once per definition
- Lua script: Not accessible
Example (based on scissors which have low attack power):
Certain traits of prisoners can multiply attack power.
Can this weapon be used for ranged attacks?
- Optional: Defaults to not melee weapon (direct contact)
- Value type: Bitmask
- Multiple: You can define multiple “Properties” per definition, one for each value required
- Lua script: Not accessible
Example:
The range (in map tiles) of the weapon.
- Optional-ish: Defaults to 0.0; for ranged weapons it should always be > 0
- Value type: Number >= 0.0
- Singleton: Can use only once per definition
- Lua script: Not accessible
Example (based on assault rifle which has very long range):
Sprites
Will complete this section later.
Used to tweak the size of the equipment sprite.
- Optional: Defaults to 1.0 (normal size)
- Value type: Number > 0.0
- Singleton: Can be used only once per definition
- Lua script: Not accessible
Example:
A scale smaller than 1.0 will shrink the sprite, a scale larger than 1.0 will enlarge the sprite.