vtt-lair / foundry-group-initiative

Module for Foundry VTT that allows you to roll grouped initiative.
MIT License
3 stars 4 forks source link

Starting with hidden actors messes up grouping for players #23

Closed kaelad02 closed 2 years ago

kaelad02 commented 2 years ago

I'm using version 2.0.3 and had a problem with a combat. I had 4 types of enemies, 3 of them had multiples. So for example:

  1. Type A (x3)
  2. Type B (x3)
  3. Type C (x2)
  4. Type D (x1)

In Type A, B, and C there was one or two of the actors I made invisible. Then I added everyone, including PCs, to the combat tracker. Everything looked fine on my end. I see all the PCs on their own, three grouped monsters, and one monster on their own. Some of the grouped monsters are hidden in the tracker, just like I intended. Perfect.

The problem is the players' view does not look like this. The players see 5 of the 6 PCs and one group of monsters of Type A. When they expand Type A, they see the two monsters of that type and then the Type B group appears below. Expanding the Type B group shows the one visible of Type B and the solo Type D monster. Also, below that is the group of Type C. Expanding that group shows the one visible Type C monster and the missing PC.

Rolling initiative didn't make it any better. In some cases, worse. While reproducing the issue now, after rolling initiative all four monster types show up correctly but I only see 2 of the 6 PCs. Some of the PCs are in the monster groups. They're in the right initiative order, but they were absorbed into the groups.

It only seems to happen when I add hidden monsters to the combat tracker. I often do this for waves of enemies, which was the case here.

vtt-lair commented 2 years ago

I'm going to release a version that wraps the grouping with a setting. This way you can disable the grouping while I try and refactor the code for this. Unfortunately the grouping code is inherited code from the original code repo.

This way you can opt-in for the grouping or opt-out (by default) while I try and sort this out.

Sorry for the inconvenience.

vtt-lair commented 2 years ago

I've created a new task to refactor the headers: #29