DSB/Multiple Parties

From DmWiki
< DSB
Jump to: navigation, search

This is one of those weird things that has been bounced around for ages, and I myself even played with it a bit, trying to get it to work with dungeon mechanics-- first in RTC, then in DSB. I've come to the conclusion that there's no real sane way to do it without some help from the engine, so that's what this version of DSB offers. It's a little strange, and it's bound to be buggy at first, so it'll be interesting to see what comes of it. --Sophia

The basic idea is to use dsb_set__mpartyflag and set the flag MPARTY_SPLIT. At that point, the leader will "break off" from the rest of the party, and there will be two parties. Doing it this way was easier than trying to teleport people around and such-- see the test dungeon for a tricky way to make a teleporter appear to split the party up, though.

You can use dsb_setexviewinst(char, monster_id) to associate a given monster inst with a character. The monster must be in LIMBO. From then on, whenever that character is seen from a 3rd person perspective, that monster will be drawn to represent that character. Don't kill this monster or bad things will happen.

The game uses what I'm calling a "party stack" to keep track of which sub-party the various party-related commands affect. The currently viewed party is always at the bottom. When a party steps on a trigger, it is pushed onto the stack before the trigger is processed. This means things like dsbpartycoords will generally affect the "right" party. You can also directly specify a party as the last parameter of most party-related commands, and/or directly manipulate this stack directly via dsb_party_apush and dsb_party_apop.

The old method of checking whether something hits the party has also been changed. Rather than calling dsb_party_coords and checking the returns against your target, you should instead use the new command dsb_party_at(lev, x, y). It will return nil if there is no party there, or the number of the party that is there. The base code has some pretty clear examples, so look there, and feel free to ask if you need more help.

Have fun.