• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

Issues with LUA scripts

Walter Almaraz

Resource contributor
Hello,

I'd been working on a LUA script for Runway and Taxilights. This is the script:

!lua
local visibility = varget("O:Weather.AmbientVisibility", "Meters")

if visibility < 8001 then
varset("T:DiffuseTexture","String","lights_lm.dds")
varset("T:EmissiveTexture","String","lights_lm.dds")
else
varset("T:DiffuseTexture","String","lights.dds")
varset("T:EmissiveTexture","String","lights_lm.dds")
end


I have this simple script that basically works when visibility is less than 8001 meters.

When I use default or less complex aircraft looks like these:

Wby2Ido.jpg


3ki4yDo.jpg


No problem with default aircraft, but when I choose PMDG or even the Aerosoft Airbus this situation happens:

hsoyAPb.jpg


12vvR1c.jpg


Someone encountered this issue? How can I solve it? or should I choose another option for my lights? Thanks in advance

Regards,
Walter Almaraz
 
I used your LUA script example with success and saw no problems also with PMDG aircraft. So I think it was a system specific or texture setting issue in your case.
It is a good example for practical day-time low visibility/fog runway and taxi lights activation.
 
I used textures for my ground lights (where the lua script was necessary for daylight activation of the emissive texture during fog). Texture light solution may not give the perfect visuals but for my case the method is efficient, since I have a large airport and using effects or LOD based light mdls seemed more heavy on the system. Normally effects may supply a better visual experience but it depends.
 
Top