Trigger exvars as tables

This forum is for the Lua scriptable clone of DM/CSB called Dungeon Strikes Back by Sophia. Use DSB to build your own highly customised games.

Moderator: Sophia

Forum rules
Please read the Forum rules and policies before posting. You may Image to help finance the hosting costs of this forum.
Post Reply
User avatar
Parallax
DMwiki contributor
Posts: 424
Joined: Mon Aug 28, 2006 7:56 pm
Location: Back in New Jersey

Trigger exvars as tables

Post by Parallax »

I was reading the documentation on the wiki for RTC users and I have a question about this:
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} }
The question is: can I use a table for the delay exvar as well, so the various messages are fired each with their own, taylored delay? For instance:
exvar[trigger_id] = { target = {id1, id2, id3}, msg = {M_ACTIVATE, M_TOGGLE, M_DEACTIVATE}, delay = {10, 3, 0} }
User avatar
Sophia
Concise and Honest
Posts: 4307
Joined: Thu Sep 12, 2002 9:50 pm
Location: Nowhere in particular
Contact:

Post by Sophia »

Yes you can.
Post Reply