Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhancement: Recognize combat tracker groups as mobs #40

Open
MrPotatoZed opened this issue Sep 22, 2021 · 10 comments
Open

Enhancement: Recognize combat tracker groups as mobs #40

MrPotatoZed opened this issue Sep 22, 2021 · 10 comments
Assignees
Labels
enhancement New feature or request

Comments

@MrPotatoZed
Copy link

The new combat tracker groups module greatly simplifies creating groups/mobs in the initiative tracker and in particular is helpful for handling groups where the members don't all share the same name. I was excited to see the "skip turns of next mob combatants" option already works with CTG such that when we make a mob attack it automatically moves to the next group of enemies in the initiative tracker. Having to select the members of tracker groups isn't the end of the world and the select saved mobs option helps a lot after round 1 but it would be amazing if the mob attack tool could automatically populate the next group of enemies in the initiative tracker as a mob. This is similar to #24 but specific to the combat tracker groups module.

Stendarpaval added a commit that referenced this issue Sep 23, 2021
- Re-added final full stop removal in multiattack parsing algorithm
- Made a method accessible for other modules (and macros) to save mobs directly. Related to Issue #40.
@Stendarpaval Stendarpaval self-assigned this Sep 23, 2021
@Stendarpaval Stendarpaval added the enhancement New feature or request label Sep 23, 2021
@Stendarpaval
Copy link
Owner

Thanks for requesting that feature! I agree that such functionality would be great for making Mob Attack Tool and Combat Tracker Groups work together more fluently. CTG's developer, arcanist, has contacted me about this on Discord and asked me if there was a way for CTG to create saved mobs.

As of the newly released v0.3.9, there indeed is such a function accessible. I'll let arcanist know so that they can update CTG. In case further enhancements are necessary for making this work, let me know! This patch was pretty quick because I'm a little light on time, so I may not have tested enough / done enough research. 😅

@MrPotatoZed
Copy link
Author

Awesome; thanks for your response and for the super fast update. I'll be happy to test and report back once it's implemented on the CTG side. I'm prepping for a massive combat in my game and the MAT/CTG combo is going to make things so much easier.

@Stendarpaval
Copy link
Owner

The newly released v0.3.11 implements some changes that should complete the final step (that arcanist and I discussed) in making CTG and MAT compatible.

@MrPotatoZed
Copy link
Author

MrPotatoZed commented Nov 11, 2021

After some testing the interaction between MAT and CTG appears to work beautifully in .3.11. Super impressive and a really fast workflow. However, in .3.12 it appears some interaction with combat tracker groups .3 and perhaps something in my world is causing my browser window to freeze up with the scene stuck at 100% whenever I try to load certain scenes with combats being tracked. The browser also freezes up when I try to roll initiative in combats with CTG and MAT active. This is probably a separate issue so I can raise it as such if you'd like.

I don't see any errors when the browser freezes but it looks like that's just because it's frozen up. Disabling either CTG or MAT fixes the issue and if I disable everything except CTG, libwrapper, and MAT the issue recurs. If I disable either CTG or MAT and then delete the combats in the scenes that got stuck I can access those scenes fine even with both CTG and MAT active. However, rolling initiative in those scenes (or any scenes) causes the browser to freeze and the scenes again get stuck on attempting to load. Downgrading MAT to .3.11 fixes the issue, updating back to .3.12 causes it to recur. Strangely, running only MAT .3.12, CTG, and libwrapper in a clean world works fine (hence the mention that it may be at least in part an interaction with my main game world).

v8.9, 5e 1.5.3, ctg .3. I'm seeing the same behavior in firefox and chrome, tested on two different computers. Hosted on the forge. I've let arcanistzed know about the situation via his discord.
unknown

@MrPotatoZed
Copy link
Author

After a chat with arcanist is looks like the specific cause is something with the autosave combat tracker group as mobs setting. Disabling it fixes the issue. His theory was that there was something which has circular dependency in the combat tracker render. If there's anything else I can do to help please just let me know.

@arcanistzed
Copy link

Some details on the loop that is being made:
Whenever the Combat Tracker is rendered, CTG's manageGroups method calls the ctgGroupUpdate hook. Then, MAT calls createSavedMobsFromCTGgroups which runs saveMob, or deleteSavedMob. Those methods both call the matMobUpdate hook which triggers a Combat Tracker re-render from CTG.

@arcanistzed
Copy link

arcanistzed commented Nov 12, 2021

I could remove the re-render (which is done in order to remake the groups) from my code, if you add ui.combat.render(true); whenever the mobs are updated, but not via createSavedMobsFromCTGgroups.

You could do this by passing an argument into saveMob/deleteSavedMob which you can check inside those functions and only re-render if it's not there.

You could add the re-render after this line and this one.

Otherwise, let me know how you think I can take care of this from my end.

@arcanistzed
Copy link

arcanistzed commented Nov 15, 2021

Latest version of CTG won't have this issue, but one of the fixes above is preferable, since the fix I used might lead to confusion when using that MAT setting.

@arcanistzed
Copy link

Any news on fixing this properly on your end?

@Stendarpaval
Copy link
Owner

Apologies for the late response, this issue kind of flew under my radar and I only noticed it now after releasing 0.3.13 (otherwise I'd have tried to address it as part of that release).

@arcanistzed I am open to fixing it using either of the two ways you suggested, but I don't quite see how that will stop causing issues if CTG's manageGroups still calls the ctgGroupUpdate hook when the combat tracker is rerendered. Maybe you changed something in that latest version of CTG you referred to, but I don't have access to that so I can't make sure I understand you properly. I'll PM you on Discord about that, might be easier to address there.

Stendarpaval added a commit that referenced this issue Dec 30, 2021
- Fixed bug that could freeze browser when combined with CTG module thanks to @arcanistzed's suggestion in issue #40.
- Took some additional measures (via a sneaky workaround) to ensure that few conflicts arise from CTG, Group Initiative and Mob Attack Tool each overriding Foundry's core initiative rolling functions.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants