ExpansionDefinition
public sealed class ExpansionDefinitionNamespace MapExpansions
Everything the framework needs to build one expansion: where its content comes from, where it goes, which regions and named places it brings, and how it joins the main world. A consumer mod fills one and passes it to MapExpansionsApi.Register before the main menu opens.
Expansion-local coordinates are the coordinates of the source scene. The framework turns them into world coordinates with Offset and QuarterTurns; main-world coordinates stay as they are.
Properties
Section titled “Properties”public string Id { get; set; }Stable id; part of every saved identity the expansion produces. Lowercase, no spaces.
DisplayName
Section titled “DisplayName”public string DisplayName { get; set; }Version
Section titled “Version”public string Version { get; set; }Content version of the consumer, compared between host and clients.
Source
Section titled “Source”public WorldSource Source { get; set; }Type: WorldSource
The scene the expansion’s own world comes from. Null makes the expansion an edit layer over the main world: nothing is captured, it has no terrain, connections or separate views, and its offset is zero.
Offset
Section titled “Offset”public Vector3 Offset { get; set; }World position of the source scene’s origin.
QuarterTurns
Section titled “QuarterTurns”public int QuarterTurns { get; set; }Clockwise quarter turns seen from above. Terrains turn only in whole quarter turns.
Regions
Section titled “Regions”public List<RegionDefinition> Regions { get; }Type: RegionDefinition
public MapSheetDefinition Map { get; set; }Type: MapSheetDefinition
The expansion’s part of the phone map; without it the expansion is not on the map.
Connections
Section titled “Connections”public List<ConnectionDefinition> Connections { get; }Type: ConnectionDefinition
public List<ObjectRule> Hide { get; }Type: ObjectRule
Objects switched off when the expansion is built, in the expansion or in the main world.
GroundPlates
Section titled “GroundPlates”public List<GroundPlate> GroundPlates { get; }Type: GroundPlate
Large flat plates of the source that are replaced by a plate over a smaller local area.
Locations
Section titled “Locations”public List<LocationDefinition> Locations { get; }Type: LocationDefinition
Named places inside the expansion, resolved through LocationRef.
Buildings
Section titled “Buildings”public List<BuildingDefinition> Buildings { get; }Type: BuildingDefinition
Buildings NPCs can enter, created on every peer when the expansion is built.
ParkingLots
Section titled “ParkingLots”public List<ParkingLotDefinition> ParkingLots { get; }Type: ParkingLotDefinition
Parking lots for NPC cars, created on every peer when the expansion is built.
DealLocations
Section titled “DealLocations”public List<DealLocationDefinition> DealLocations { get; }Type: DealLocationDefinition
Places where customers of the expansion’s regions wait for deals.
Properties
Section titled “Properties”public List<PropertyDefinition> Properties { get; }Type: PropertyDefinition
Properties the player can buy, copied from main-world properties.
WorldStates
Section titled “WorldStates”public List<WorldStateDefinition> WorldStates { get; }Type: WorldStateDefinition
Named local states, initially dormant. One expansion per independent upgrade retains completed effects.
PoliceStation
Section titled “PoliceStation”public PoliceStationDefinition PoliceStation { get; set; }Type: PoliceStationDefinition
The expansion’s own police station. A player arrested in the expansion is set free there instead of at the main world’s station, and the car taken from them is parked there. Null leaves arrests to the main world.
public List<ShopDefinition> Shops { get; }Type: ShopDefinition
Shops with a seller at the counter, each with the main-world interior and doors it copies.
Copies
Section titled “Copies”public List<CopyDefinition> Copies { get; }Type: CopyDefinition
Main-world objects copied into the expansion outside any shop, such as furniture.
VehicleArea
Section titled “VehicleArea”public Rect VehicleArea { get; set; }Local rectangle the vehicle graph covers, in addition to the connections. Empty means the bounds of the source terrains.
MinimumWorldHeight
Section titled “MinimumWorldHeight”public float MinimumWorldHeight { get; set; }The lowest height the expansion may reach in the world; lower terrain is reported on build.
SeparateViews
Section titled “SeparateViews”public bool SeparateViews { get; set; }Each world is drawn only while the camera is on its side, as if the other were not there: in the expansion the main world’s map is not drawn, in the main world the expansion is not drawn. The side changes in the middle of each connection’s built stretch, where neither end can be seen; the connections are always drawn. For an expansion whose source had its own backdrop, such as a ring of distant mountains, that would stand in the other world. Colliders, characters and vehicles stay as they are.
MainViewRoots
Section titled “MainViewRoots”public List<string> MainViewRoots { get; }Root objects of the main scene that are not drawn in the expansion with SeparateViews. Nothing that can move between the worlds may lie under them; objects under a rigidbody are always drawn.
SharedViewObjects
Section titled “SharedViewObjects”public List<string> SharedViewObjects { get; }Main-world objects drawn on both sides with everything under them, by name prefix; the sea lies under both worlds.
public LayerSource Layer { get; set; }Type: LayerSource
The JSON layer a map editor wrote for this expansion, laid over this definition each time the world is built. A file Mods/<Id>/map.json wins over it. Null means no layer.
Methods
Section titled “Methods”UseLayer
Section titled “UseLayer”public ExpansionDefinition UseLayer( System.Reflection.Assembly assembly, string resourceName)Sets Layer to an embedded resource of the given assembly.