Full Config: Apartments
The complete configs/shared/apartments.lua for Advanced Housing (sd-housing): the towers, flat prices, starter flats, the front desk, the peephole and the admin command.
TIP
See the configuration guide for what each file controls. Download this file as a reference, and merge changes with the config shipped in your installed version.
Download shared/apartments.lua
lua
-- Apartments: the flats of an apartment tower (sd-housing-towers: the Dream Tower, Little Seoul - 13 floors of 10 flats
-- over a lobby with a front desk). Every flat is a property of its own, made from the tower's data/apartments.json the
-- first time the server starts with both running: its front door locked and unlocked as any house's, its home panel by
-- the door, decorated inside like a walk-in house. A flat is not on the market: the front desk sells them, a new
-- character is given one, and an admin hands them out (/apartment).
return {
Enabled = true,
Resource = 'sd-housing-towers', -- the towers resource (its data/apartments*.json list every flat)
-- Each tower's list of flats in that resource (a file that is not there is skipped).
Files = {
'data/apartments.json', -- the Dream Tower, Little Seoul
'data/apartments_eclipse.json', -- Eclipse Towers, Rockford Hills
'data/apartments_tinsel.json', -- Tinsel Towers, Rockford Hills
'data/apartments_delperro.json', -- Del Perro Heights
},
-- What a flat costs at the front desk: Price, plus PerFloor for every floor above the first (the views get better).
Price = 60000,
PerFloor = 2500,
RoundTo = 500,
-- A tower's own prices (by its id): Price / PerFloor as above, and PerSqm for every square metre of the flat - the
-- newer towers' flats differ in size on one floor. A tower not named here is priced by the three lines above.
Towers = {
eclipse = { Price = 90000, PerFloor = 3000, PerSqm = 700 },
tinsel = { Price = 85000, PerFloor = 3000, PerSqm = 700 },
delperro = { Price = 70000, PerFloor = 3000, PerSqm = 600 },
},
OnePerCharacter = true, -- a character has one flat at a time (moving out first to take another)
CountsTowardMax = false, -- a flat counts toward config.Properties.MaxOwned (false: a flat and up to that many houses)
-- A new character is given a free flat and wakes up in it. This answers qbx_core's starting-apartment step
-- (config.characters.startingApartment, the event apartments:client:setupSpawnUI) in qbx_properties' place, which
-- steps aside while this is on (sd-housing sets the convar it reads: sd-housing:apartments).
Starter = {
Enabled = true,
OnLogin = false, -- also give one to a character who logs in without one (true: everyone has a flat)
Welcome = true, -- a note on their panel: their number, how the door, the panel and the lift work
Towers = { 'dreamtower' }, -- the towers a starter flat is picked from (false: any tower)
},
-- Moving out: back to the front desk (or the panel), for this share of what the flat was bought for. A flat given
-- for free (a starter, an admin's) gives nothing back.
SellBack = 0.5,
-- The front desk in the tower's lobby: who stands there, and what she helps with.
Reception = {
Enabled = true,
Model = 'a_f_y_business_02', -- the receptionist
Scenario = false, -- what she does while she waits ('WORLD_HUMAN_CLIPBOARD'; false: stands ready at the desk)
Distance = 2.6, -- metres from her the option shows (or the prompt, without a target resource)
Blip = { Sprite = 475, Color = 3, Scale = 0.8 }, -- the tower on the map (false: no blip)
MarkSeconds = 180, -- how long your door is marked (and the lift shows your floor) after she tells you the way
},
-- What a flat's own walls, floor and ceiling show until their owner gives them a finish: the tower's own textures (its
-- texture dictionary, and the texture for each surface), by tower.
AsBuilt = {
dreamtower = { txd = 'sdt_dreamtower', walls = 'sdt_paint_white_d', floor = 'sdt_oak_boards_d', ceiling = 'sdt_ceiling_paint_d' },
},
-- Unsold flats stay locked (no open house in a tower: a flat is bought at the desk, not walked round first).
LockVacant = true,
-- Looking out through the front door's peephole: from the door inside (aim at it), or the panel's Home.
Peephole = {
Enabled = true,
Fov = 95.0, -- a wide, door-viewer lens
Look = 25.0, -- degrees you can look round, each way
Fisheye = true, -- the round, dark-edged view of a door viewer
},
-- What the home panel offers in a flat: its views (configs/shared/panel.lua is a house's). 'home' is always in.
-- Owner: everything here; a keyholder: these but 'activity' and 'house'.
PanelViews = { 'home', 'doors', 'keys', 'activity', 'house' },
-- Decorating a flat: what a walk-in house has, but held tight to the flat's own walls (its box, not the margin a
-- house gets), and only the decor of the flat you are in or at drawn - a tower is 130 flats within a few metres.
Decor = {
BoxMargin = 0.1, -- metres decor may reach past a flat's walls (its party walls are 0.2 thick)
StreamDistance = 14.0, -- metres from a flat's box its furniture is drawn (a house's: config.Decor.StreamDistance)
},
-- /apartment (admins): look a flat up, give one to a player, move someone out, go to a door or a tower's lobby.
Admin = {
Command = 'apartment',
Group = 'group.admin',
},
}