Page 1 of 1

Splittable Party

Posted: Fri Mar 07, 2008 10:23 pm
by Sophia
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.

Anyway, 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_set_exviewinst(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 dsb_party_coords 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. :)

Posted: Sat Mar 08, 2008 2:12 pm
by ian_scho
Like the way when you teleport on top of a monster, we splat it. Probably had that before anyway, but I had to try to break it. Also noted that when you move the party around when separated, it doesnt break it either.

Need some images of the party members now :P

Nice addition.

Posted: Sat Mar 08, 2008 3:59 pm
by Parallax
I am very curious about this new feature. Can you break to more than 2 parties? Do monsters attack the 'inactive' parties? Do the inactive parties regenerate health/mana over time? Are they affected by spells (including party spells like magic shield, for instance), thrown items, etc? So many questions. I have to download and test this!

Posted: Sat Mar 08, 2008 7:43 pm
by Sophia
Parallax wrote:Can you break to more than 2 parties?
Yes.
Parallax wrote:Do monsters attack the 'inactive' parties?
Yes.
Parallax wrote:Do the inactive parties regenerate health/mana over time?
Not currently. I'm not sure which way this one will go (and I'm open to persuasion)-- if you want to try it the other way, you can add "VARIABLE" to the appropriate call to dsb_ppos_char to tell DSB to operate on any party rather than just the "current" one. To do this, change line 671 of system.lua to

Code: Select all

local who = dsb_ppos_char(ppos, VARIABLE)
Parallax wrote:Are they affected by spells (including party spells like magic shield, for instance), thrown items, etc?
Yes. Thrown objects and magic spells will hit them normally (and cause damage); party effect spells like magic shield and light will affect all parties regardless of distance, because to do otherwise stretched my sanity. ;)