Jump to content
Sign in to follow this  
roguetrooper

Is "#lightpoint" createVehicle local or global?

Recommended Posts

When you create a lightpoint on the server by

_o = "#lightpoint" createVehicle _pos;

are they global or have they to be created on every client to be visible?

"CreateVehicle" might imply that it is created on all clients as well, but in Arma 2 those lightpoints were only local.

For the case they are not global in A3, how could they be globalised by the server?

Share this post


Link to post
Share on other sites

createVehicle is always global.

use createVehicleLocal to create a vehicle local. :D

---------- Post added at 16:46 ---------- Previous post was at 16:42 ----------

with the special vehicle #lightpoint might be only local.

Share this post


Link to post
Share on other sites

Well, are you doing anything fancy with them like turning them on/off or destroying them? If not, simply execute the command on all machines. Global dat.

If you are wanting to turn them on/off/destroyed, I suggest the use of publicVariables and publicVariableEventHandlers, as that is a simple way to broadcast local activity. For instance, create a light point on all machines that is attached to a pole or something, and whenever that pole is destroyed you will have a script sitting at waitUntil {!alive pole}, which will then define a publicVariable as true, indicating the pole is dead. That publicVariable will be linked to a PVEH, which broadcasts the change to, say, another script run by the server that is waitingUntil {thatvar == 1}, and can then hint "The demon pole is gone!";. Just an idea.

Share this post


Link to post
Share on other sites

I know for sure, in A2 createVehicle"GLOBAL" created those lightpoints only locally (quite strange, since a light can be seen by everybody like a physical object).

They have random positions and they are quite a lot so that it would be too clumsy to publicVariable the positions and have every client create the lights according to the broadcasted positions...

Is it possible to publicVariable a whole object?

lgt = "#lightpoint" createVehicle _pos;
publicVariable "lgt";

Share this post


Link to post
Share on other sites

Oh, I see. You want to place them at random, but if you did that all locally, clients would see them all differently. Here's how I would go about doing that.

Do the randomized locations on one machine (ie, the server) then broadcast that array of randomized locations via PV/PVEH to all machines. Then simply createVehicle forEach PVArray.

Make sense?

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×