Refactor emissiveLights.sqf
Needs Review, Needs TriagePublic


Reproducable without other mods?
Cyruz created this task.Jan 20 2019, 4:06 PM

Needs to be evaluated of the function of that script (disabling the lights on a powerline post) can be moved to the Land_class/p3d/engine entirely.

jonpas claimed this task.Jan 20 2019, 4:08 PM

@NeoArmageddon Let me know how that goes, sometime in the next 2 months I will refactor this.

kju added a subscriber: kju.Apr 12 2019, 10:04 AM

My suggestions:

  1. should activate only when compatible lamps are present in terrain or mission (and module to manual activate it) - alternative would be init EH in the object class with isNil check for already running
  2. check sun state every 0.25s seems too much
  3. not checking for CUP_lampState change first
  4. positionCameraToWorld and pos check every 0.5s seems too much (could be made based on speed/vehicle type one is in)
  5. nearObjects check every 0.5s (relevant when flying fast) instead of caching relevant object positions
  6. (minor) not saving both texture paths to variable (instead _m = format ['ca\Structures\Misc_Powerlines\Data\powlines_%1.rvmat',['multi1','light1'] select CUP_lampState];)
  7. (minor) not saving damaged texture path to variable