Page MenuHomeFeedback Tracker

Public variables set using setVariable sometimes not broadcasted
Closed, ResolvedPublic

Description

In multiplayer, when you set a variable on an map object (not created by script, and not created using editor), so let's say a building, some players do not have the variable broadcasted. Seems to happen only to JIP.

Details

Severity
Major
Resolution
Not A Bug
Reproducibility
Random
Operating System
Windows 7
Category
Multiplayer
Steps To Reproduce

1 - Create a mission in multiplayer
2 - In initServer.sqf, find a building using it's position or whatever you want
3 - Always in initServer, do a _building setVariable ["testVariable","TEST",true];
4 - Get in game with some friends
5 - Try to get the variable from every player on building, some will have the variable set, some will not.

Event Timeline

Mash6 created this task.Jun 6 2016, 11:38 PM
Mash6 updated the task description. (Show Details)Jun 6 2016, 11:40 PM
Mash6 added a comment.EditedJun 6 2016, 11:45 PM

Related to https://feedback.bistudio.com/T76478 (But marked as feature request)

reekoj added a subscriber: reekoj.Mar 23 2022, 12:27 AM

Still happening 6 years later in the latest version :
Launcher version: 1.5.149039
Game version: 2.08.149049
Branch: main

I set a public variable on multiple buildings of Altis when the server starts

_obj setVariable ["owner", _owner, true];

Then later when there is 80+ players , some players (~5 / 100) don't have the variable

			private _ownerID = _house getVariable ["owner", ""];
			if (_ownerID isEqualTo "") exitWith {
				diag_log format["DEBUG [%1, %2, %3, %4]",
					name player,
					str _house,
					typeOf _house,
					getPosATL _house]	;
			};

This is not a bug, map objects are streamed, basically deleted and created so there is no guarantee the variable set on these objects would exist let alone sync over network

BIS_fnc_KK closed this task as Resolved.Mar 23 2022, 12:39 AM
BIS_fnc_KK changed Resolution from Open to Not A Bug.
reekoj added a comment.May 2 2022, 5:59 PM

This is not a bug, map objects are streamed, basically deleted and created so there is no guarantee the variable set on these objects would exist let alone sync over network

Ok i see. But according to what you said, what would be a good workaround instead of setting variables to map objects ?
For example in my case where i want all clients to know who owns which building ?

you can use building position and store in hashmap as a key maybe in mission namespace and owner as value, so would be fast to pull owner based on position

BIS_fnc_KK added a comment.EditedMay 3 2022, 9:15 PM

Or use visitor id of the building (assuming the map is done and won’t be recompiled. still think the junk position is safer in the long run