Tankbuster 1731 Posted March 17, 2018 Guys, One of my secondary missions tasks players with sling loading a 20 foot ISO container to a given location on the map. When I made and tested the mission it worked faultlessly - the client machine is in the same room as the server box. But when remote clients tried to lift the box and slungload invariably breaks the ropes and falls to the ground, or bounces up and collides with the underside of the lifter. I'm pretty sure this is a latency/locality issue. The helicopter is local to it's pilot and the underslung load is local to the server. And when I tested it, there was little latency between the two, but now the mission is in the wild and remote clients with longer latency cause the underslung load to rubberband and warp, usually with catastrophic results. Is it possible to force the slung load to be moved from the server and to be local to the pilot of the lifter? I'm hoping this will cure this problem. Thanks in advance, Tankbuster -Paul- Share this post Link to post Share on other sites
HazJ 1288 Posted March 17, 2018 @Tankbuster - Are you able to show your current code? Share this post Link to post Share on other sites
Tankbuster 1731 Posted March 17, 2018 Sort of. I've changed to code because I'm altering the mission from slingload to ViV helicopter, so the current code doesn't describe the problems shown above. The code for this secondary mission might not make much sense outside of the wider mission - there's loads of function calls and use of global variables that are defined elsewhere. You're aware of the issue with this mission - you've played it! :) You've seen the warping and stuff first hand. I was hoping for a belt-and-braces approach to moving an object from the server to a known client Share this post Link to post Share on other sites
Tankbuster 1731 Posted March 17, 2018 setOwner appears to do everything I need! Can it be that simple? https://community.bistudio.com/wiki/setOwner Share this post Link to post Share on other sites
HazJ 1288 Posted March 17, 2018 Maybe. Can't say for sure without seeing the code. Sorry for late reply. I'm having issues loading the forums, etc... Just me? All other websites are loading fine. Share this post Link to post Share on other sites
fn_Quiksilver 1633 Posted March 17, 2018 I dont have this problem effectively i do this: <helicopter> addEventHandler [ 'RopeAttach', { params ['_vehicle','_rope','_attachedObject']; if (!local _attachedObject) then { [_attachedObject,clientOwner] remoteExecCall ['setOwner',2]; }; } ]; ^ the event has to be added on the client/pilots machine https://github.com/auQuiksilver/Apex-Framework/blob/master/Apex_framework.terrain/code/functions/fn_clientVehicleEventRopeAttach.sqf#L36-L38 4 Share this post Link to post Share on other sites
Tankbuster 1731 Posted March 17, 2018 21 minutes ago, fn_Quiksilver said: I dont have this problem effectively i do this: <helicopter> addEventHandler [ 'RopeAttach', { params ['_vehicle','_rope','_attachedObject']; if (!local _attachedObject) then { [_attachedObject,clientOwner] remoteExecCall ['setOwner',2]; }; } ]; ^ the event has to be added on the client/pilots machine https://github.com/auQuiksilver/Apex-Framework/blob/master/Apex_framework.terrain/code/functions/fn_clientVehicleEventRopeAttach.sqf#L36-L38 Yeah - you don't have this problem because you are way ahead of me and have done what I am talking about! :) Share this post Link to post Share on other sites
fn_Quiksilver 1633 Posted March 17, 2018 11 minutes ago, Tankbuster said: Yeah - you don't have this problem because you are way ahead of me and have done what I am talking about! :) haha well you already figured out the key setowner bit. BIS never bothered to make sling loading MP compatible so left it up to us to finish off also with that rope event, it fires for each rope, lot of entities have 4 ropes so it would fire 4 times, which may not be convenient to catch the last rope (and have only 1 execution) i put this in the code _count = count (getArray (configFile >> 'CfgVehicles' >> (typeOf _attachedObject) >> 'slingLoadCargoMemoryPoints')); if ((count (ropes _vehicle)) isEqualTo _count) then { One more note... this method isnt foolproof to fix the desync issue. an example is a medical taru pod with another player in it, you wont be able to transfer ownership to yourself (setOwner will fail). this is mainly for cargo like crates and stuff 2 1 Share this post Link to post Share on other sites
Tankbuster 1731 Posted March 17, 2018 6 hours ago, fn_Quiksilver said: haha well you already figured out the key setowner bit. BIS never bothered to make sling loading MP compatible so left it up to us to finish off also with that rope event, it fires for each rope, lot of entities have 4 ropes so it would fire 4 times, which may not be convenient to catch the last rope (and have only 1 execution) i put this in the code _count = count (getArray (configFile >> 'CfgVehicles' >> (typeOf _attachedObject) >> 'slingLoadCargoMemoryPoints')); if ((count (ropes _vehicle)) isEqualTo _count) then { One more note... this method isnt foolproof to fix the desync issue. an example is a medical taru pod with another player in it, you wont be able to transfer ownership to yourself (setOwner will fail). this is mainly for cargo like crates and stuff 7 Yes, I'm only using Huron containers which can't have a driver so should always be able to move their ownership to the pilot of the lifter. Share this post Link to post Share on other sites
Tankbuster 1731 Posted March 17, 2018 Pilots report much less warping and rubber banding of underslung loads. Great work @fn_Quiksilver. Thank you very much! Share this post Link to post Share on other sites