Catalogue
This page uses GameObject from Unity. The glossary says what each one is.
The catalogue lists the furniture the game has, plus the furniture mods added. You use it to find the id to give to Place.
Building the catalogue helpers
This is the class that lists the catalogue. Catalog() gives you the list to search for an id, PrefabOf returns the model that Place would build, and IsKnownFurniture checks that an id is real furniture.
public static partial class Building
{
public static List<FurnitureCatalogEntry> Catalog();
public static GameObject PrefabOf(string furnitureId, int alt);
public static bool IsKnownFurniture(string furnitureId);
}
| Method | Returns | What it does |
|---|---|---|
Catalog() | List<FurnitureCatalogEntry> | All furniture the game and mods have. |
PrefabOf(furnitureId, alt) | GameObject | The model Place would build. 0 is the normal one. |
IsKnownFurniture(furnitureId) | bool | true when the id is real furniture. |
FurnitureCatalogEntry one kind of furniture
Catalog() gives you one of these for each kind of furniture. Its Id is the value to pass to Place. (Game pieces are read from the game’s furniture list. A mod piece is described from its definition and template until it is built.)
public sealed class FurnitureCatalogEntry
{
public string Id { get; }
public string Name { get; }
public string Title { get; }
public string Category { get; }
public int SkinCount { get; }
public int AltCount { get; }
}
| Property | Type | What it means |
|---|---|---|
Id | string | The furniture’s id, the value Place and PrefabOf take. |
Name | string | The furniture’s asset name. |
Title | string | The name the game shows. |
Category | string | The furniture’s category name. |
SkinCount | int | How many looks it has. |
AltCount | int | How many alternative shapes it has. |
Things to know
Catalog()lists the game’s furniture first, and then the furniture that mods added. It lists mod furniture once the furniture list is loaded. It gives an empty list when the developer console is not loaded. (The game’s list isDeveloperConsole.Instance.furniture.furnitures.IdisFurniture.Id,NameisFurniture.name,TitleisFurniture.title,SkinCountis the length ofFurniture.skins, andAltCountis the length ofFurniture.AlternativePrefabs.)Catalog()does not build anything. A mod piece that is not built yet is described from its definition and its template:Idis the mod id,TitleandNameare the definition’s title (or the template’s), andCategoryis the template’s.- Mod pieces have no skins or alternative shapes, so
SkinCountandAltCountare0, built or not. A mod piece whose template fails to load is skipped, and the failure is logged once. Categoryis the game’s category name for the game’s furniture. A mod piece shows its group’s category name once it is built, and its template’s category until then, because the group is only set on the piece when it is built.- A mod piece with no category name keeps the template’s category. So does every mod piece while the custom category change is not set up.
PrefabOf(furnitureId, alt)gives the model thatPlacewould build.0is the normal model, and1up toAltCountare the alternative shapes. It places nothing: your code builds the model. (It callsFurniture.GetPrefab(alt).)IsKnownFurniture(furnitureId)istruefor furniture that really exists. That is a mod furniture id that is registered (once the furniture list is ready), or a normal id that is in the catalogue’s list.IsKnownFurnitureisfalsefornull, empty, unknown or failed input. A failure is logged once.- The first form of
Placedoes not callIsKnownFurniture, because it loads any path it is given. The console’s list may not hold every normal piece of furniture. If another player decides the id (co-op orNetBlob), userequireKnownset totrue, or callIsKnownFurniturefirst.
Limits
PrefabOfreturnsnullfor an unknown id, analtout of range, or an error (logged). An empty id returnsnulland is logged once.- The first
PrefabOffor a mod furniture id builds it, and that closes furniture definitions for every mod.Placebuilds it the same way. Building setsFurnitureBuild.Started, which closesFurnitureRegistry.Definefor every mod, not only for that piece. CallPrefabOfafter every mod has defined its furniture.