-
Notifications
You must be signed in to change notification settings - Fork 69
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
Events during campaign setup are "lost" regarding listener templates #869
Comments
i support the RegisterInStrategySetup solution since its the probably the most bc friendly way and would be consistent with the current implementation of register in strategy and register in tactical. |
This change adds an extra `RegisterInCampaignStart` boolean to CHL event listener templates (on top of the existing `RegisterInTactical` and `RegisterInStrategy` ones). Listeners registered for campaign start will now receive events that are fired during campaign initialization, which strategy listeners don't receive. Resolves X2CommunityCore#869.
This change adds an extra `RegisterInCampaignStart` boolean to CHL event listener templates (on top of the existing `RegisterInTactical` and `RegisterInStrategy` ones). Listeners registered for campaign start will now receive events that are fired during campaign initialization, which strategy listeners don't receive. Resolves X2CommunityCore#869.
When a campaign is first launched, the initial set of state creation is done in the shell map. Shell has no listener templates (see #297) and as such, mods cannot react to the events (hooks) triggered during that phase. Below are the events that get triggered when using just CHL (based on CI's latest development version, 3c3bdd5):
Source behind generating this list: 5fc965c
Full output + parser: https://gist.github.com/Xymanek/b8ac7021900d17ba417d2f7759151525
Note that the list above potentially does not include all events triggered, in case some events are triggered in response to other events (I had to practically disable all listeners to investigate)
An easy solution would be to register strategy listener templates before starting the process, since these are mostly strategy events. Downside is that the listeners might not expect to be called in not-ready-campaign state and might not expect to be called while a start state is opened.
An opt-in solution would be adding
RegisterInStrategySetup
toCHEventListenerTemplate
; obviously that would require mod authors to manually mark their listeners, so some bugs resulting from the above behaviour might remain.cc @Musashi1584 @pledbrook since I know some of these events are yours
The text was updated successfully, but these errors were encountered: