Currently to broadcast some custom effects when a vehicle is destroyed I use this method:
_MPInit=Format ["[This,%1,%2,%3,%4,%5] ExecVM ""JTD_FireAndSmoke\Scripts\SmokeMain.sqf""",_SmokeStyle,_PrimaryLifetime,_SecondaryLifetime,_thisTime,_VehicleScale];
_Vehicle SetVehicleInit _MPInit;
ProcessInitCommands;
With "_vehicle" being the vehicle destroyed.
When destroying nearby trees, I use the same method but use a custom object and set the init on that:
_thisTreeMarker = "firemarkerinv" createVehicle _FirePos;
_MPInit=Format ["[_x,%1,%2,%3,%4] ExecVM ""JTD_FireAndSmoke\Scripts\ForestFireTree.sqf""",_SmokeStyle,_PrimaryLifetime,_SecondaryLifetime,_thisTime];
_thisTreeMarker SetVehicleInit _MPInit;
ProcessInitCommands;
where, as you can see, "_thisTreeMarker" is the "vehicle" having the init set this time.I need to use a custom object because I cannot set an init on a map object like a tree.
All the above works fine in SP, and I see all effects.
In MP, it's reported to me that the vehicle effects are seen by all clients, but that the tree effects are only seen by the client on which the code is executed.
Can anyone see why this would be from the examples provided? I'm tempted to think that maybe the vehicles aren't being created on any other machine. They're just small invisible cubes. Does createVehicle really create vehicles on ALL machines when used?
*****************************************************
Guys, will I be better served to use publicVariable to achieve this?