Page MenuHomeFeedback Tracker

[MP] - Objects adding with [add###Cargo] are not accessible once player lost locality
New, NormalPublic


In Multiplayer, when wishing to add particular objects for only one player in a crate but permit the access to all players, we have to keep crate's locality to this player.
Problem start when we wish to add particular objects for several players: if a player lost the locality, he can't take his particular objects.


Operating System
Windows 8 x64
Operating System Version
Steps To Reproduce

Only create several playable units.
Have console access for all players.
Launch the game in a Dedicated Server.

The following code create a box with a weapon inside that is only accessible for the player that has executed the code. Other players see all others objects.
If a box is pointing during code execution, the code will only add a weapon accessible for the player that has executed the code.
Each times box locality is given to the server.

Code to execute :

private _crate = cursorObject;
if (typeOf _crate != "Box_IDAP_Equip_F") then {
	_crate = "Box_IDAP_Equip_F" createVehicle (player getRelPos [3,0]);
[_crate] spawn {
	params ["_crate"];
	[_crate, clientOwner] remoteExecCall ["setOwner", 2];
	waitUntil {local _crate};
	_crate addWeaponCargo ["SMG_03_camo", 1];
	[_crate, 2] remoteExecCall ["setOwner", 2];
	waitUntil {!local _crate};
	systemChat "Weapon created into the crate.";
Additional Information

In order to player be able to take the particular object, crate has to be local.
But this will cause problems when several players open the crate in same time.

We should permit player to have access to all of his items even if crate is not local.

Event Timeline

1- A wish would be that we could put negative numbers at add###Cargo functions just like this example:

supplyBox addItemCargo ["optic_ARCO", -5];

And it generaly be a good update for all similar functions like add###CargoGlobal.

2- Another wish would be to be able to add###Cargo (that to say in local way) with a global argument, because if I wish to update a copter's cargo thank's a remoteExec with JIP option, I have to forced the owner to a JIP player when copter could be in flight with a player pilot, that occurs freeze for him. To permit copter to keep non-local to the client we could avoid this unnecessary freeze.

Tequiller edited Additional Information. (Show Details)Jul 24 2020, 1:42 AM