FSLTL lights in MSFS2024 - Workaround

Hi, this topic is likely relevant for VATSIM pilots that use the current FSLTL models in MSFS 2024.
I’ve posted in VATSIM discord but I guess it wasn’t the best channel to post it so here it’s again.
With the current sim patch 3 the FSLTL models and lights are mostly working but only the lightmap textures are shown, not the light bulb themselves. That causes aircraft to become invisible when they are far.
I’ve hacked my way around the .fx files to get some usable lights, it’s far from good or perfect but at least now it’s feasible to see traffic far away.
This is the issue before the fix:


And this is after the fix:



As you can see , the lights are small but very visible when the aircraft is far away.

To apply the fix, You will need Python installed.

  • place the fix.py in the fsltl-traffic-base folder.
  • run py fix.py
  • run py build.py ( already supplied in the fsltl package ) - needed to regenerate the manifest.jsons otherwise the sim will not reload the changes.

Sharing in case someone will find it useful too, good luck!

import os
import re

def replace_last_color_number(text):
    """Replaces the last number in "Color Start" or "Color End" lines with 255.

    Args:
        text: The input string.

    Returns:
        The modified string with the last number replaced.
    """

    lines = text.splitlines()
    modified_lines = []
    for line in lines:
        match = re.search(r"(Color Start|Color End)=(\d+), (\d+), (\d+), (\d+)", line)
        if match:
            color, a, b, c, _ = match.groups()
            modified_line = f"{color}={a}, {b}, {c}, 255"
        else:
            modified_line = line
        modified_lines.append(modified_line)
    return "\n".join(modified_lines)

def double_min_proj_size(text):
    """Doubles the value of MinProjSize.

    Args:
        text: The input string.

    Returns:
        The modified string with doubled MinProjSize value.
    """

    lines = text.splitlines()
    modified_lines = []
    for line in lines:
        match = re.search(r"MinProjSize\s*=\s*(\d+\.\d+)", line)
        if match:
            value = float(match.group(1))
            modified_line = f"MinProjSize={value * 2:.1f}"
        else:
            modified_line = line
        modified_lines.append(modified_line)
    return "\n".join(modified_lines)

def process_fx_file(file_path):
    """Processes a .fx file, replacing color numbers and doubling MinProjSize.

    Args:
        file_path: The path to the .fx file.
    """

    with open(file_path, 'r') as f:
        content = f.read()

    modified_content = replace_last_color_number(content)
    modified_content = double_min_proj_size(modified_content)

    with open(file_path, 'w') as f:
        f.write(modified_content)

# Find the "effects" directory
effects_dir = os.path.join(os.getcwd(), "effects")

if os.path.exists(effects_dir):
    # Process .fx files in the "effects" directory
    fx_files = [os.path.join(effects_dir, f) for f in os.listdir(effects_dir) if f.endswith('.fx')]

    for fx_file in fx_files:
        process_fx_file(fx_file)
else:
    print("Effects directory not found.")
4 Likes

are we supposed to create a text file insert that code and then rename it to fix.py and the run that? your instructions do not state this as it assumes we already have the fix.py on hand. I tried doing it this way and still only have light maps no visible lights on the models.

Yes, sorry, it’s a bit programmer orientated instructions. That should modify the sizes in the effects files. Don’t forget to make sure to regenerate the package jsons files with the build.py . One more caveat now that I think about it, make a backup of the effects folder and copy it back before re-running, otherwise it will just keep multiplying existing values. It was a quick’n’dirty solution for me, sorry for that. Let me know how it worked for you, will try to assist here if needed.

Hey we appreciate it! I work with a lot of programmers so I am used to the clear as mud instructions haha. I will give this ago again. Thank you

1 Like

Hello,

Unfortunately, it doesn’t work for me…

-I copied the code and pasted it on a txt file.
-Changed the txt extension to .py
-Renamed it fix.py
-Pasted the file in fsltl-traffic-base folder
-Copied a backup of effects folder
-Runned fix.py with python. (A window seems to open then close immediately)
-Then runned build.py with python.
-Copied back the effects folder to its original fstl-base folder.

No change with lights intensity.
Excuse my message, but as i’m not programmer, I’m trying to find my mistake.

Can you see something wrong ?

Cheers

Hi @Abergasse I will try to find another solution and will update you…

Thanks ! I appreciate a lot !

1 Like

This worked for me, and is an adequate mitigation until the root issue is addressed. Combined with the fact that SU1 beta has also addressed the landing lights issues w/ the aircraft that I fly (SF50, C700), and BeyondATC now injects traffic that I can see at night via the FSLTL models, I’m in a much better position now. Thank you

2 Likes

I tried the fix, but it also did not work for me. both fix.py and build.py ran successfully, but for whatever reason that didn’t fix the issue. either it’s dependent on some other graphics setting I don’t have, or FSLTL has changed since.

Testing in 2024 (not beta).

[UPDATE] Running the script a second time made a visible difference. Since the author said it’s cumulative, it could be some kind of scale limit that depends on display resolution as well as the fixed scalar to show up.

Tested at default zoom levels in the cockpit. Be aware that like other lighting, zooming in actually decreases the size of the bulb effects. Keep your scan normal without zooming for best effect.

1 Like

Glad it works for you :slight_smile: , yeah looks like something got changed in the beta a bit. For me that still works “as is” at least with the previous beta (didn’t checked the new release yet).
The mechanism of light effects in msfs is somewhat fiddle , mixing sprites, lights, resolution and now supposed to be photometric and still being changed.