-
-
Notifications
You must be signed in to change notification settings - Fork 314
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
Custom event system and Action management #420
Conversation
Store event handlers on namespace object, don't use BIS scripted handlers. Slightly faster 🐎
if(_local) then { | ||
_arguments call _x; | ||
} else { | ||
[_arguments, _x] remoteExecCall ["call", _targets]; |
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.
This is completely wrong as it will fire Local handlers on all Remote clients. Remote clients should be notified about event and fire their own handlers.
Do not code when tired 😒
It works! (For real this time 🐛)
Needs refactoring but it works. Still experimenting with how this should be done. Only inFob event for now.
Also remove unused function and global defines file.
@@ -299,14 +299,14 @@ while {KPLIB_intro_started} do { | |||
// Get the name of the sector we're looking at | |||
private _sectorName = ""; | |||
if (_actualTargetPos distance KPLIB_eden_startbase < 300) then { | |||
_sectorName = "BEGIN OF OPERATION"; | |||
_sectorName = "BEGIN OF OPERATION"; // Should this be localized? |
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.
👍
["player_fob", { | ||
params ["_player", "_fob"]; | ||
|
||
private _redeployActionId = _player getVariable ["KPLIB_redeployActionId", nil]; |
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.
Just a small thing:
I think KPLIB_actionId_redeploy
(or similar) would be better concerning the project_category_specify convention instead of the project_specifyCategory which is used currently.
@@ -24,13 +24,16 @@ | |||
// Read the module globals | |||
call compile preprocessFileLineNumbers "modules\01_core\globals.sqf"; | |||
|
|||
// Initialize actions | |||
call KPLIB_fnc_core_setupPlayerActions; |
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.
I thought about putting the "stuff for everyone" at the end and not at the start. So it'll executed after the locality specific things. Can't say "this is better because of ....", it's just a initial thought. Any opinion? 🤔
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.
We need to add event handlers that add actions to vehicles before actual vehicle spawning happens. Otherwise initially spawned vehicles will have no actions available.
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.
Very good point, of course 👍
Missionframework/stringtable.xml
Outdated
@@ -1254,7 +1254,7 @@ | |||
</Key> | |||
</Package> | |||
<Package name="Actions"> | |||
<Key ID="STR_FOB_DEPLOY"> | |||
<Key ID="STR_FOB_DEPLOY_ACTION"> |
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.
Same as mentioned above.
What about STR_ACTION_FOB_DEPLOY
and STR_ACTION_REDEPLOY
?
0: BOOL - Should created namespace be global | ||
|
||
Returns: | ||
BOOLEAN - TRUE if removed, FALSE if didn't exist |
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.
Copy/Paste Typo?
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.
Yup. 😒
EDIT: Closed by accident. Wrong PR. |
Description:
Event system that allows to subscribe to mission events, foundation for more extensible framework.
Content:
Create spreadsheet with available events and their arguments as initial documentationGist with examples should be enough for now
Tested on:
Local MP ACEDedicated MP ACE