-
Notifications
You must be signed in to change notification settings - Fork 149
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
add 'CBA_fnc_addPlayerEventHandler' #328
Conversation
Mmm, I celebrate that these are getting added to CBA. However, I'm not really fond of the way it's executed for two reasons: 1- Most of the events are trivially cheap to evaluate, but instead of adding them to a single loop that always run (like in ACE), each one is tucked in it's own EH function, making them slower. This is specially true if you want to use many or all of them (like in ACE). I would instead recommend that either all of them are installed by default, or all are installed when the first is. 2- That a new installer function is required |
All checks could certainly be moved in one EachFrame event. I don't want to have this loop running by default though. Most mods won't make use of any of these, so I want to avoid being critiqued for adding 'pointless' checks every frame. Imagine a community using CBA only for JR and CUP (Life + CUP) or even a mil sim comm with only CBA + TFAR. |
How about running everything in one loop and have developers "opt-in" to the events? |
We could dynamically build up the polling function with |
Using the
Sure. That would mean compiling 8 functions at mission start though (because if you use all, they are all added after another) I kinda like |
Thanks @commy2 👍 |
|
||
Description: | ||
Returns the currently controlled unit. | ||
Different from "player" when remote controlling units via zeus. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Either shorten to one sentence or separate with empty line for possible future improvements to documentation generation.
Port (?) from ACE.
This is a framework to add event handlers based around properties of the players avatar that are pretty usefull, but unfortunately require polling.
Possible events:
-
"unit"
- player controlled unit changed-
"weapon"
- currently selected weapon change-
"loadout"
- players loadout changed-
"vehicle"
- players current vehicle changed-
"turret"
- position in vehicle changed-
"visionMode"
- player changed to normal/night/thermal view-
"cameraView"
- camera mode changed ("Internal", "External", "Gunner" etc.)-
"visibleMap"
- opened or closed map