User Tools

Site Tools


world_setup:building_types_reference

Building Types Reference

As covered in the Buildings & Interactions overview, most building types share common behaviours (standard UI for purchasing & selling items, regular production cycles on items defined in the building editor, etc). In most cases, the only effect of different types is to group buildings so they can be limited differently. (e.g. There's no intrinsic difference between a 'Retail' and a 'Store' building type, but you could have a setup that only allows 'Retail' buildings in one part of the world and 'Store' buildings in another).

There is a separate group of 'Scripted' building types that in general require you to write scripts to control their interaction behaviours. (As above, theres also no intrinsic difference between a 'Scripted' building and a 'Scripted_Retail' building - that just allows them to be identified and grouped differently).

Some building types do have specific behaviours, these are listed here:

Ornamental

The Ornamental building type is a frequently used one for background objects and decoration; Ornamental buildings can't be interacted with and don't run any of the usual production cycle updates.

Home

The Home building type is mostly relevant on worlds that have hunger, thirst and health decay settings. Home buildings don't run the usual production cycles and have a custom interface that allows the building owner to 'go home' and access an extended storage area that allows them to store any items from their inventory. If the player is in their home while offline, they will automatically eat and drink from the home stores as needed. The 'At rest' modifiers on the *settingsLife settings can be used to slow down the player's rate of health decay when they're at home.

Pub

This special building type replaces the usual building UI with an 'Enter Pub' button, inside the pub are various sometimes-functional minigames that your players can access.

School

This building type allows the owner to add lessons, from their list of skills they currently possess. In the past, we've often used this as a sysop-only building, not available for players to construct, where you grant yourself skills and add them to the school, so you can control which skills are available in the world. Alternatively, you can allow players to build schools and add the skills they've learnt elsewhere.
More detail on setting up Schools can be found here

Fixed School

Gov Bank

Town Plinth

Farm

Storage

Flag Base

(FIXME: This appears to be a deprecated type but need to look into this more..)

Coastal

Automated Turret

Special building type that implements a basic automated turret, that will fire at appropriate players when they get near to it.

More details here

Starport

Trading Post

Port

Garage

Skill Exchange

Item Source

Level Exchange

Residential Block

Multi-Trade Post

Pickup

Pickup 'buildings' can be used for implementing a static bonus/pickup collection system. When the user collides with the 'building' they trigger the pickup system on the server. This first checks to ensure that someone else hasn't just triggered the process, and if all looks ok, triggers the “PickupBuilding” event in script. The script can choose to award items (or whatever) and call 'CancelTransaction' to finalise the process. If 'CancelTransaction' isnt used (or theres no PickupBuilding script defined for this building code) then the server automatically attempts to give the player a random item from the sale items specified in the buildings editor for this building. (Default behaviour uses the sales Max Storage capacity as the item quantity. i.e If you set the pickup building sales list to have only 'Gold' with a max storage of '50', then every time the pickup is collected, the player would get 50 gold).

In addition, the Trigger Code for the building in the building editor is used to control the behaviour of the pickup :
0: No effect
1: Pickup disappears for a period once collected
2: As 1, and the 'building' rotates while it is in view.

FIXME: (Not sure if the disappearing bit works properly atm.. needs investigation)

Instead of the normal building display, the Weblink building type displays an HTML page downloaded from an url specified in the building. The HTML page is displayed within the frame of the usual building display and rendered using the very primitive in-game browser. This browser offers only very basic HTML tag support (Image, Table, basic formatting), and your page won't look anything like what it looks like in a proper browser, but displaying info from your web server could provide some interesting options. (e.g. Page updated with data from external sources..)

You set the URL you wish to display on the building screen by modifying the building message.. Server admins can do that using the console command .buildingmessage [URL] while accessing the building or you can set it from script using the sysBuildingSetMessage( [URL] ) function, within a building context event.

Billboard

Workhouse

Exports

Warehouse

Portal

Scripted Building Types

Of the scripted building types, the only major distinction is between the 'Scripted-NoWindow' type and everything else. As you'd expect, the 'Scripted-NoWindow' type means that you're expected to script its interaction behaviour AND it does not bring up a 'Building' UI when the user interacts with the building. (This is therefore a useful type for doing little scripted behaviours for things like 'the tree that gives a coconut' example given elsewhere).

Worth noting that all the scripted building types still run the regular production cycles (so will still automatically produce and manufacture items if you've set them up to do so in the Buildings Editor) unless you specifically configure them not to.

'Advanced' Building Types

In the building editor displays you may notice the 'Advanced' building types. This is another grouping that has no intrinsic behavioural difference, but can be used to allow a range of different buildings to be constructable in particular locations in the world. (Primarily this is done through the Town Zones system.

Other types

The following building types are not currently supported or are under construction :
Hotel, New Bank, Target, Command Centre, Noticeboard, Trigger

world_setup/building_types_reference.txt · Last modified: 2023/07/15 16:33 by mit

Except where otherwise noted, content on this wiki is licensed under the following license: Public Domain
Public Domain Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki