• 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.

Basic dynamic light gauge?

Messages
23
Country
us-california
Hi all, I've been trying to delve into the world of creating dynamic lights for aircraft. I know there's the FSLabs tool, but I want to make it more streamlined by making a basic light control gauge. Most other developers (FSLabs, Leonardo, PMDG, QW, etc) all reference some gauge in the panel.cfg, in the [Vcockpit] section. The gauge is also accompanied by a lua script for controlling the light, however it's usually not longer than 5 ~ 10 lines of code, usually referencing some string inside the gauge (at least thats what I see when i disassemble the gauge). However most of these gauges are in C++, and I know next to nothing when it comes to programming for P3D. I do know a small amount of C++ ( i can create a basic console application, maybe a scientific calculator or basic spreadsheet program; nothing fancy) however I've tried reading up on the P3D SDK's C++ gauge overview, and it was next to useless for me as it wasn't really pointing me in any direction.

So while I am trying to take a page out of other developers books, how would you code up a basic light gauge? I know it ties in with .FX files and .lua scripts, but that's about the extent of my knowledge. Some other developers like FlySimWare I noticed used .XML to create their lighting system. However, it's packed in (usually a cabinet file) and paired with bitmaps of the light's texture, which isn't what I intend for. I intend to maybe do a similar system of what JustFlight has on their BAe 146, a separate gauge for controlling lights. Any basic tips or tutorials will help greatly.
 
learn about fx file (light), xml / C++ just matter of switch/knob to control light On/Off and Dim
there P3D PDK that give more control over fx light but this must use C++

try single data on fx light, insert fx file name to cfg or attach into model, change data inside fx file, see how it behave. use direct in sim test to give correct result. it quite easy and straight forward.
I can't tell how I done with dynamic light. it NDA to company I hired.
 
In p3d i used to add many duplicates of the same VC light effect with varying intensities , lets say from 0 to 100% and link them to nodes for each light level in the 3d model, then add a visibility tag that is controlled through code (could be XML if it is easy)
for example a pseudo code would be :
if((L:my lights controller) == 0 } { hide all nodes and show only node 0 }
else if ((L:my lights controller) == 1 ) { hide all nodes and show only node 1 }
else if ((L:my lights controller) == 2 ) { hide all nodes and show only node 2 }
etc.

you get lights of different intensities that way.
 
In p3d i used to add many duplicates of the same VC light effect with varying intensities , lets say from 0 to 100% and link them to nodes for each light level in the 3d model, then add a visibility tag that is controlled through code (could be XML if it is easy)
for example a pseudo code would be :
if((L:my lights controller) == 0 } { hide all nodes and show only node 0 }
else if ((L:my lights controller) == 1 ) { hide all nodes and show only node 1 }
else if ((L:my lights controller) == 2 ) { hide all nodes and show only node 2 }
While I do get the idea, what I don't really get is the syntax, or more specifically, how to actually write the gauge. What would the syntax be to the hide attachpoints and display one?
 
Back
Top