Skip to content

Multi-Building Reference

TL;DR

multibuildings/<name>.json holds a grid of building names. It occupies several city chunks at once instead of one. code review

Keys

Key code review Required Limits Meaning
dimx / dimz yes 1 or more, and no larger than the areasize it is placed with The grid size, in chunks
buildings yes A nested list of building names. See Grid order, because it is not laid out the way it looks

Grid order

The mod reads the grid as buildings[x][z]. The outer list is the X axis and the inner list is the Z axis. game test

That is the opposite of how a nested list usually reads. The outer list is not a row running east: each outer entry is a column at one X coordinate, and the entries inside it run north to south. game test

Position Index Compass corner
buildings[0][0] x 0, z 0 North-west
buildings[0][1] x 0, z 1 South-west
buildings[1][0] x 1, z 0 North-east
buildings[1][1] x 1, z 1 South-east
game test

The mod's own center.json follows this. Its entries are center00, center01, center10 and center11, which is center<x><z>. code review

Getting the order wrong produces a scrambled building, with no error

Nothing checks the grid against the parts it names. Lay the list out as rows running east and the north-east and south-west chunks swap places: the building generates, no message appears, and the halves do not line up. game test

Example

{
  "dimx": 2,
  "dimz": 2,
  "buildings": [
    ["mall_nw", "mall_sw"],
    ["mall_ne", "mall_se"]
  ]
}

A footprint of 2 by 2 chunks, tiling four separate building definitions into one structure. The first inner list is the western column, running north to south. Each entry is a normal Building name, referenced the usual namespaced way. game test

A multi-building larger than its placement area fails the chunk

The mod picks a random offset inside a square area of chunks with random(areasize - dimx + 1). Where dimx or dimz exceeds areasize, that bound reaches zero or goes negative and the mod throws bound must be positive. code review

Two different areasize values apply, depending on how the multi-building is reached. code review

Reached through Setting Shipped default
A city style's multibuildings selector World Style multisettings.areasize 10
A Scattered Building's multibuilding World Style scattered.areasize 8
code review

A multi-building used both ways has to fit the smaller of the two. Nothing checks it at load, and the failure waits until a chunk in that area generates. code review

See also