Bric-a-brac Tutorials

Bric-a-brac (map items) Tutorials

`Bric-a-brac', or `map items' are a vast assortment of entities providing objects that players can acquire, push around, destroy or otherwise interact with. Their basic use is pretty straightforward, and the different types are enumerated and described in these reference pages.

In this tutorial I'll look at the following topics:

Basic fields and Spawnflags

Brac-a-brac divides naturally into two types, stuff the player acquires when they bump into it ( weapons, mana, artifacts, items), and stuff they don't, objects.

The acquireable stuff is rather easy, because there is only one basic field, spawnflags, where a value of 1 means that the item floats exactly where you put it in the map, rather than dropping down to a convenient distance off the floor. So you can test this by putting an item such as greenmana in your map, and noting the effect of the spawnflag. That's all the basics for this stuff, tho there is a bit more to it in the triggering and spawning sections.

There's a bit more to the objects; their most important field is angle, which specifies the direction the object is facing, in the same style as with doors and buttons. Some objects, such as corpes and books, can also usefully be given 3d angle fields, which can be used to tilt the object in any direction (so that a book can sit on a slanted lecturn, a corpse on a slope, or a sword stick out of a body at an artistic angle).

Objects can also take a health field, which determines how much damage it takes to destroy them (the destructible ones also have a default health, so you don't actually have to specify one unless you want a special effect), and there are also mass and abslight fields, as discussed on the reference page.

So if you haven't done it yet, you should put a few random objects into a test map, and experiment with these fields. Some objects have additional fields, such as skin, or automatically take on different skins in different `worldtypes', see the reference page for more on these topics when you actually want to use the relevant objects in a map..

Triggering and targetting

Map items can participate in triggering and targetting. Both acquirables and objects can have targets, which acquirables trigger when they are acquried, and objects trigger when they are destroyed (so in both cases, the targets are triggered when the item disappears from the map). Destructible objects can furthermore be targetted; when they are triggered, they are destroyed.

So you can try all this out by putting, say, a Krater of Might (art_manaboost) and a cauldron (obj_cauldron) in your map, putting the cauldron where you can see it from the position of the Krater. Now run the map, and take the Krater, watching the cauldron explode. Anything that can be triggered at all can be triggered by the taking of an takeable item