-
Notifications
You must be signed in to change notification settings - Fork 148
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
Added team color synchronization #185
Conversation
In my opinion, checking each frame might be overkill, 1-3 seconds should be fine. Why not have the group leader call This doesn't throw script error, so nothing probably needs to be done, just an oddity to be aware of.
Debug:
|
Because then if I call the event through another addon the setVariable would never be called with the third parameter being true, thus it wouldn't be JIP safe. Unless I missed something? |
Start Local MP Server What I am thinking of is changing remote to |
Fixed. I also set the PFH to run every second instead of every frame, but I could increase the delay further. ACE3 synchs them every 5 seconds, however I think that is a bit too much. It's not a very demanding function. |
{ | ||
if ((assignedTeam _x) != (_x getVariable [QGVAR(synchedTeam), "MAIN"])) then { | ||
//Local team != currently synched team, so we need to synchronize them again | ||
["CBA_teamColorChanged", [_x, assignedTeam _x]] call CBA_fnc_globalEvent; |
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.
Why a globalEvent
and not a targetEvent
? Is this color necessary to be synced on all clients?
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.
Yes, in case another player joins the squad he needs to know the assigned colors as well.
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.
Doesn't that mean you want to sync them up upon joining the team instead?
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.
That's possible too, but would require extension of the PFH (unless there's a CBA event for it? there's no doc for default events and I didn't see any either) and it would ofc have a delay. Without that delay it would be great for triggering a CBA event though.
Either options aren't perfect in my opinion. Choose your poison...
Added team color synchronization
This synchronizes fireteam colors across the network. Other addons can either call the
"CBA_teamColorChanged"
event or indirectly trigger that event by remote callingassignTeam
on the squad leaders machine.See issue #94.