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.")```
2 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