Name - originalfoo/Prison-Architect-API GitHub Wiki

##Overview

Foundations Materials Rooms Staff Objects Utilities Emergencies

The Name setting is mandatory and must be specified for all definitions. It sets the <id> by which the object is referred to everywhere else.

##Syntax

This mandatory setting is used in materials.txt and must be within a definition block. It can be used only once per definition block.

    Name <id>

Where <id> is a unique ID for whatever is being defined, eg. Prisoner for a prisoner entity.

##Example

    Name ArmedGuard

##Notes

Due to the huge importance of the Name setting, it is always the first setting in a definition block.

If there is already a definition using the same <id>, the existing definition will be completely overwritten by the new definition. This is the primary way that mods alter standard game objects, by overwriting them. It also means that only one mod can overwrite a definition at a time (if multiple mods overwrite it, the last one to try wins as it overwrites the previous one and so on).

When the <id> value is displayed in the user interface, for example in a menu or tooltip, it will first be localised via base-language.txt. The locale key will be different based on the type of object being defined.

###data/scripts/

The <id> value is referred to in scripts as the "type".

It is most commonly used in relation to functions such as .GetNearbyObjects()), Object.GetMaterial()) and Object.Spawn()).

It is also exposed by the .Type property. It is not exposed by the .Name or .Id properties. This helps make things as confusing as fuck, because fuck consistency.

##See Also

  • Localisation
⚠️ **GitHub.com Fallback** ⚠️