Page MenuHomeFeedback Tracker

"assignedVehicleRole" is [] on server while server owns the vehicle
Assigned, WishlistPublic

Description

Yet another MP/locality/vehicle related issue. This time assignedVehicleRole command fails to report correct in vehicle position on the server while vehicle is owned by the server. Client side assignedVehicleRole works on the same vehicle just fine. If locality of the vehicle transferred to client, serverside assignedVehicleRole also starts working.

Details

Legacy ID
166371067
Severity
None
Resolution
Open
Reproducibility
Always
Category
Multiplayer
Steps To Reproduce

Start dedicated server
log in
on the CLIENT execute

playerServer = player;
publicVariable "playerServer";
"test" addPublicVariableEventHandler {hint str (_this select 1)};

create helicopter on ther SERVER

heli = "B_Heli_Transport_01_camo_F" createvehicle position playerServer;

Get in cargo for example then execute on the SERVER

test = assignedVehicleRole playerServer;
publicVariable "test";

hint shows []

now execute the same on the CLIENT

hint str assignedVehicleRole player;

hint shows ["Cargo"]

Now get out of the heli and change helicopter locality to client, execute on the SERVER

heli setOwner owner playerServer;

Get in Cargo seat again and execute on the SERVER

test = assignedVehicleRole playerServer;
publicVariable "test";

hint now shows ["Cargo"] and it works for any seat

NOTE: Getting in driver seat does not immediately make assignedVehicleRole work on the server even though the locality of the heli changed. You need to get out and hget in before it starts working. The same happen if you manually change locality while player is in cargo seat for example. It is not enough for the heli to be local to player, change of locality has to happen when player is out of the heli.

Event Timeline

Killzone_Kid edited Additional Information. (Show Details)
Killzone_Kid set Category to Multiplayer.
Killzone_Kid set Reproducibility to Always.
Killzone_Kid set Severity to None.
Killzone_Kid set Resolution to Open.
Killzone_Kid set Legacy ID to 166371067.May 7 2016, 5:45 PM
sms added a comment.Oct 7 2014, 12:48 PM

I've seen similar behaviour for two players - driver sees ["Driver"] for himself and [] for passenger. While passenger sees ["Driver"] for driver and ["Cargo",[whatever]] for himself.