DSB/DSB for RTC users

From DmWiki
Revision as of 05:50, 8 September 2008 by Gilles (talk | contribs) (corrected bad character conversion "_")
Jump to navigationJump to search

Here are some tips and tricks for using DSB if you're used to using RTC.

Floor Triggers

Unlike in RTC, DSB floor triggers need not be on the CENTER of the tile. By placing them on one of the other directions, you can respond only to objects that are in that position.

It may also be important to note that unlike in RTC (I think?), no guarantee is made as to the order that multiple triggers on one tile will execute. If you need to do a complex set of tasks in a specific order, use one trigger linked to multiple targets, or write some custom Lua code.

Alcoves

DSB alcoves are, in general, much simpler than RTC alcoves. To do complicated things in response to objects put into an alcove, put a floor trigger on the same square as the alcove and use that instead. In particular, DSB alcoves have no concept of constant weight; you will need to use a floor trigger. A CENTER'd floor trigger will respond to anything put in any alcove on that tile. To respond only to a single alcove on a tile with multiple alcoves, put the trigger on the same direction as the alcove. (That is, to respond only to the alcove on the NORTH side of the tile, put the floor trigger in the NORTH tile position, not in the CENTER)

WALLITEM_RELAY

A message chain (dsb_msg_chain) can also be used to emulate some of the simpler behavior of RTC's "WALLITEM_RELAY," but a more thorough implementation of this is given by the "x_relay" arch. For details, see base/objects.lua. For really complex relays, you're best off just converting their functionality to Lua code.

However, one of the most common applications of relays, increasing the number of targets and/or changing the message type, is not even needed in DSB: while RTC has a maximum of eight targets per trigger and they must all be sent the same message, DSB allows an effectively unlimited number, and in addition, each target can have a different message. For example :

exvar~trigger_id = { target = {id1, id2, id3}, msg = {M_ACTIVATE, M_TOGGLE, M_DEACTIVATE} }

This will cause trigger_id to send M_ACTIVATE to id1, M_TOGGLE to id2, and M_DEACTIVATE to id3.

Door Buttons

DSB door buttons are treated the same as any other button. Unlike RTC door buttons, they must be explicitly given a message and a target. Of course, the upside is that door buttons in DSB can do anything that any other button can do, not just open a door on the same tile.

Wallsets

RTC wallsets should work, unmodified, in DSB as "ext wallsets," using dsb_make_wallset_ext.

PNG and Alpha Channels

DSB currently does not support the PNG format. Convert your images to TGA (Targa). DSB does, however, support alpha channels.