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

Trick Code for no-local planes

Recommended Posts

Hi,

In my code i set a plane pylon armament but not allways the plane is local, this is why i use:

 

[_plane,[_pylonIdx,_mag]] remoteExecCall ["setPylonLoadout",_plane];

 

The problem is that if the plane is not local the pylon change doesn't reflect imediatilly...

 

I don't want to wait for the change to conclude, this is why i created this solution:

 

_plane setPylonLoadout [_pylonIdx,_mag];

[_plane,[_pylonIdx,_mag]] remoteExecCall ["setPylonLoadout",_plane];

 

This garantee the change is imediatilly with plane local or not local.

 

I can cause any trouble with that solution?

 

Thanks Gugu!

 

Just before people here call me idiot, some more explanation.

 

If you run this code on a nom-local plane

 

_plane setPylonLoadout [_pylonIdx,_mag];

 

The pylon will have the mag set in the code but if you enter the plane and fire the pylon it will fire the old weapon, not the one set in the code, this is because setPylonLoadout needs local arguments. But this code on a nom-local plane is usefull because code run after it will detect the change as ok, and you don't need to for remoteExecCall to take effect before continue the code.

Share this post


Link to post
Share on other sites

If BIKI is right, setPylonLoadout is EL. So, in such case, you need to remote exec it everywhere:

[_plane,[_pylonIdx,_mag]] remoteExecCall ["setPylonLoadout"];

if your code runs on server only.

Share this post


Link to post
Share on other sites

Pierre, i believe BIKI is wrong. If plane is local, the change happens on all machines.

 

With plane hosted in server, i changed the pylon on server and it changed to me, a client.

 

I never tested with the plane hosted in another client (2 clients).

  • Like 1

Share this post


Link to post
Share on other sites

×