Skip to content

R2API.Director: add enabling/disabling stage Combat Directors event - #692

Merged
xiaoxiao921 merged 3 commits into
risk-of-thunder:masterfrom
Brynzananas:enabledisablestagecombatdirectors
Sep 3, 2026
Merged

R2API.Director: add enabling/disabling stage Combat Directors event#692
xiaoxiao921 merged 3 commits into
risk-of-thunder:masterfrom
Brynzananas:enabledisablestagecombatdirectors

Conversation

@Brynzananas

Copy link
Copy Markdown
Contributor

Adds an event that allows easily enabling or disabling stage Combat Directors for solving potential incompatibilities. Solution is a bit hacky but it works and shouldn't cause issues (Tested in big modpack).

If int activationCount from GetCombatDirectorActivityCountDelegate(CombatDirector combatDirector, ref int activityCount) _getCombatDirectorActivityCount event is higher than 0, then stage Combat Directors will always run even when they are disabled from something like teleporter, if less than 0 Combat Directors will never run and if equals 0 they will act as usual

@xiaoxiao921

Copy link
Copy Markdown
Member

Why is currentStageCombatDirectorsHashSet needed?

@Brynzananas

Copy link
Copy Markdown
Contributor Author

Why is currentStageCombatDirectorsHashSet needed?

To ignore Combat Directors that are not part of Director Core object

@xiaoxiao921

Copy link
Copy Markdown
Member

Wasn't aware there was combat directors outside of it. If the point is compat shouldn't they should all be passed to the delegate? Also activity should be documented

@Brynzananas

Copy link
Copy Markdown
Contributor Author

I was thinking to limit it to only stage combat directors, however now I think how I could make it affect all combat directors while making an extension method to check if combat director is the stage one. One minute

@Brynzananas
Brynzananas marked this pull request as draft September 1, 2026 18:06
@Brynzananas
Brynzananas marked this pull request as ready for review September 1, 2026 18:27
@Brynzananas

Brynzananas commented Sep 1, 2026

Copy link
Copy Markdown
Contributor Author

Made it affect all combat directors, everything seems to work fine. Though I have some dislikes like removing null Combat Directors only in RunCombatDirectorsFixedUpdate.FixedUpdate and having this feature having issues with getting stage combat directors and running disabled combat directors if stage doesn't have DirectorCore component. I don't think these issues will actually cause problems but still

@xiaoxiao921
xiaoxiao921 merged commit f539511 into risk-of-thunder:master Sep 3, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants