Arma 3
Flickering Lights
 This topic has been pinned, so it's probably important
STARMAN  [developer] 24 Aug, 2021 @ 5:47pm
Bug Reports & Suggestions
Please use this discussion if you want to report a bug or suggest something regarding the composition.
Thanks in advance.
< >
Showing 1-6 of 6 comments
Hypoxic 24 Aug, 2021 @ 11:17pm 
This will not work for multiplayer. The init fields in an object are executed every time a client loads the game which will create stacks upon stacks of your script leading to severe performance issues and destruction of your effect.

You need to have a server check if you are going to use the init fields. A simple:

if (isServer) then { //code here };

and changing your while condition to something like:

this spawn {
while {alive _this} do { //code here };
};


will make this multiplayer compatible.

You can also do something like:

sleep (random 1) to get even more variation and randomness

Also, keep in mind, you are spawning a new scheduled environment for every object that is placed. If 100 lamps are placed, you now have 100 environments that are running which is not very fun for anyone performance wise. Its best to add the objects to an array and iterate through the whole array on the server to save on performance.
Last edited by Hypoxic; 25 Aug, 2021 @ 3:47pm
STARMAN  [developer] 26 Aug, 2021 @ 7:32am 
Fixed.
Delta Pepe 19 Sep, 2021 @ 6:45am 
Works perfectly well on locally hosted servers, but unfortunately doesn't run well at all on dedicated servers. Just in case, i've also tried changing the sleep commands a bit, but to no avail. Can't tell you what's wrong if you ask me, but I may be able to provide a video showcasing the difference if requested!
STARMAN  [developer] 19 Sep, 2021 @ 11:32am 
@Delta Pepe - What's happening when it's run on dedicated servers? Does it not work at all or do the lights go nuts to butts or something? A video of the problem will do fine, if it's not a problem of course.
Delta Pepe 19 Sep, 2021 @ 4:34pm 
Originally posted by STARMAN:
@Delta Pepe - What's happening when it's run on dedicated servers? Does it not work at all or do the lights go nuts to butts or something? A video of the problem will do fine, if it's not a problem of course.
I will post a video tomorrow slightly detailing the problem! But to TL;DR it
I set the interval to be strictly 2 seconds apart, ON and OFF. Meaning it's ON for 2 seconds, and OFF for 2 seconds. It works fine locally hosted, but on dedicated servers, it's around ON for 20+ seconds, and OFF for maybe 0.1? I quadruple checked to see if the code is written properly, and it does seem to be working in order. We'll see how it goes tomorrow :)
Hypoxic 23 Oct, 2021 @ 6:04pm 
The issue is you are using switchlight which is local. Use setDamage 0.9 to shut off and setDamage 0 to turn back on on the server loop.
< >
Showing 1-6 of 6 comments
Per page: 1530 50