Jump to content
Sign in to follow this  
Azza FHI

cant get flashing light to work on dedi

Recommended Posts

so game logic is called Hlight with this in its init, null = [this] execVM "scripts\flashingLZ.sqf";

flashinglz.sqf

_light2 = "#lightpoint" createVehicle getpos Hlight;

_light2 setLightBrightness 0.0028;

_light2 setLightAmbient[64, 23, 23];

_light2 setLightColor[64, 23, 23];

_light2 lightAttachObject [Hlight, [0,0,1]];

if (isServer) then

{

while {true} do

{

_light2 setLightBrightness 0.0028;

sleep 1;

_light2 setLightBrightness 0;

sleep 1;

};

};

it works nice when previewing on my machine but as soon as it goes dedicated the light just stays on. is it just a locality issue? its just for a paradrop LZ marker, anyone got any other ways to do it?

simply just need some sort of flashing light on the ground, not too bright.

Share this post


Link to post
Share on other sites

This should probs fix it, the problem was that you spawned a light on every client but only the server did the code to switch it off.

_light2 = [];

if (isServer) then

{

_light2 = "#lightpoint" createVehicle getpos Hlight;

_light2 setLightBrightness 0.0028;

_light2 setLightAmbient[64, 23, 23];

_light2 setLightColor[64, 23, 23];

_light2 lightAttachObject [Hlight, [0,0,1]];

while {true} do

{

_light2 setLightBrightness 0.0028;

sleep 1;

_light2 setLightBrightness 0;

sleep 1;

};

};

Share this post


Link to post
Share on other sites

hmm didn't seem to work. it worked on my machine in preview but not on dedicated. on dedi the light wasn't even static. im not the best at this but I would say it is working for the server but the clients cant see it...?

saying that when using the debug console i executed null = [this] execVM "scripts\flashingLZ.sqf"; on the server and then the client and neither worked.

Share this post


Link to post
Share on other sites

I just quickly tried that in the editors and there seems to be no errors, but nothing happens. I'll look at it latter if I get some time.

Share this post


Link to post
Share on other sites

Well i have a workaround although not ideal. I have spawned a light for each client and then have a loop deleting and creating the light again. Hopfully the performance hit isnt too bad

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  

×