Jump to content
🛡️FORUMS ARE IN READ-ONLY MODE Read more... ×
JVez

Sync Arty to player

Recommended Posts

 

Good evening. I'm trying to synchronize an artillery that comes from spawn to my commander

 

russianarty = [getMarkerPos "Russianzone10", 110.592, "LIB_US6_BM13", side player] call BIS_fnc_spawnVehicle; params[ "_veh", "_crew", "_group10" ];
_logicGroup = createGroup sideLogic;
SupportReq = _logicGroup createUnit ["SupportRequester",getpos player, [], 0, "FORM"];
ArtySupport = _logicGroup createUnit ["SupportProvider_Artillery",getMarkerPos "Russianzone10", [], 0, "FORM"];
ArtySupport synchronizeObjectsAdd [russianarty];
SupportReq synchronizeObjectsAdd [player];

It does not work can anyone help me?

Share this post


Link to post
Share on other sites

Bis_fnc_spawnVehicle returns an array. You just need the first element (select 0) for vehicle.

 

You create the logics, but the modules are not initialized, imho. you should place them in editor, (even link them to player already), then sync them with artillery when spawned.

 

example:

I just placed the two modules (no link at all) and the marker, then:


 

0 = [] spawn {
   _russianartyArray = [getMarkerPos "Russianzone10", 110.592, "B_MBT_01_arty_F", side player] call BIS_fnc_spawnVehicle;
   _russianarty = _russianartyArray select 0;
   sleep 0.3;
   ArtySupport synchronizeObjectsAdd [_russianarty];
   _russianarty synchronizeObjectsAdd [ArtySupport];
   [ player, SupportReq, ArtySupport] call BIS_fnc_addSupportLink;
};

Works fine.

 

Share this post


Link to post
Share on other sites

Thank you it works great

Share this post


Link to post
Share on other sites

×