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

Please, need little help with GPS map drawing

Messages
201
Hello!
I would like to change the color in the gps map, for example, of the water when a light switch is pressed.

<CustomDrawParam id="WaterColor" Name="WaterColor">
<Value>
(A:LIGHT PANEL, bool) if{ 0x0000FF } els{ 0xFF0000 }--></Value>
</CustomDrawParam>

This actually works, but in order to make the water color change, i have to turn off terrain display and turn on it again.
I would like that when the light switch is pressed, the water color changes automatically.
Maybe an UPDATE tag? or maybe something in the switch code?
Thanks for any help!!!
 
There is a remnant of a comment in your code "-->"..

An update tag isn't the worst idea, with something like this for code:
Code:
(A:LIGHT PANEL, bool) (L:Display Refresh, bool) != if{ [Turn off terrain display] [Turn on terrain display] (A:LIGHT PANEL, bool) (>L:Display Refresh, bool) }

You need to find the variables or events used for turning the display off and on.
 
Thanks Eretic,
almost there...
If the [turn on terrain] is L:EICAS TERR, boolean
What can i do? there aren't 2 variables, one "on" and one "off".
I tried
Code:
(A:LIGHT PANEL, bool) (L:Display Refresh, bool) != if{ (L:EICAS TERR, boolean) ! (>L:EICAS TERR, boolean) (A:LIGHT PANEL, bool) (>L:Display Refresh, bool) }
but the result is not what expected.
Thanks again for your preciuos help
 
I think the only way to make water change color is to switch off the terrain mode and turn it on again.
So i got a switch to turn terrain disp on or off,

Code:
<Script>
(L:EICAS TERR, boolean) ! (&gt;L:EICAS TERR, boolean)
</Script>

and i got the panel light switch.
I assing a "L:Water_Color" variable,

Code:
<Update>
<Frequency>1</Frequency>
<Script>
(A:LIGHT PANEL, bool) if{ 0x0000FF (>L:Water_Color) } els{ 0xFF0000 (>L:Water_Color) }
</Script>
</Update>

...Then inside the Map Display Element:

<CustomDrawParam id="WaterColor" Name="WaterColor">
<Value>(L:Water_Color, string)</Value>
</CustomDrawParam>

blue if panel lights are off, red if panel lights are on.
Now the problem is that i have to make terrain display to cycle everytime i switch the lights, so it can refresh with the new color.
But in the same time, if the terrain disp is off, it must stay off.

So basically:
I have two display states:
0 = Terrain off
1 = Terrain on
if i am in state 0, switching panel lights must change the color variable in background, but not the terrain state. (so when i switch terrain on, the color is ready)
if i am in state 1, with terrain on, switching the panel lights must assign the new color and switch terrain OFF and then quickly ON again.


im afraid i was not exactly clear :) sorry
 
Last edited:
Another way to refresh the terrain and water colors is to momentarily change map zoom. This will leave the LayerTerrain variable unchanged so you will not need to know what state it is in.

Bob
 
Ahhhh thats a nice solution Bob, thanks!
Now i only miss how to change the range and then put it back. I mean, i know what is the variable, but i still dont know how to make an action, wait 1 second and make another one in one script :/
 
(L:EICAS TERR, number) ! (>L:EICAS TERR, number)
(>K : PANEL_LIGHTS_ON) <--- i put spaces here to avoid smiley to appear
(L:EICAS TERR, number) ! (>L:EICAS TERR, number)

In this script, why the second EICAS TERR toggle does not work???

I mean, look like it works couse the variable stays inaltered. I think i just need a "TIME PAUSE".
i dont know how to make it.
 
Last edited:
I am not even able to insert a simple delay for the light switch :(

<CallbackCode>
!!!!DELAY HERE!!!! (>K: PANEL_LIGHTS_TOGGLE)
</CallbackCode>

After :K i put space to dont display the smiley here in the forum, naturally there is no space in the code.

Please help me :)
 
If you use the "Insert / Code" function, you won't need to worry about the smilie faces!

yMs1G.png

Code:
<CallbackCode>
     !!!!DELAY HERE!!!! (>K:PANEL_LIGHTS_TOGGLE)
 </CallbackCode>
 
Ahhhh thats a nice solution Bob, thanks!
Now i only miss how to change the range and then put it back. I mean, i know what is the variable, but i still dont know how to make an action, wait 1 second and make another one in one script


This is a way to refresh terrain by momentarily changing zoom:
Code:
<Update Frequency="18">
   (L:Terrain_Refresh, bool)
       if{
           (L:ZFactor, number) (>L:ZFactorTemp, number)
           2699 (>L:ZFactor, number)
           0 (>L:Terrain_Refresh, bool)
           1 (>L:Refresh_Timer, bool)
       }
       
   (L:Refresh_Timer, bool)
       if{
           (L:Cycle_Counter, enum) ++ (>L:Cycle_Counter, enum)
           (L:Cycle_Counter, enum) 2 ==
               if{
                   (L:ZFactorTemp, number) (>L:ZFactor, number)
                   0 (>L:Cycle_Counter, enum)
                   0 (>L:Refresh_Timer, bool)               
               }
       }
</Update>

where (L:ZFactor, number) is the zoom setting: <Zoom>(L:ZFactor, number) 1852.0 *</Zoom>

IIRC, you can also force a terrain refresh by changing <LayerTerrain> or <DetailLayerTerrain> ... experiment with those too.

Bob
 
Thanks a lot Bob!
I do not have a <Zoom> number </Zoom>
I got a
Code:
L:Display Scale
variable for the range zoom level.
So i tried:

Code:
<Update Frequency="18">
    <Script> <--- I think this is mandatory
   (L:Terrain_Refresh, bool)
       if{
           (L:Display Scale, number) (>L:ZFactorTemp, number)
           1 (>L:Display Scale, number)
           0 (>L:Terrain_Refresh, bool)
           1 (>L:Refresh_Timer, bool)
       }
     
   (L:Refresh_Timer, bool)
       if{
           (L:Cycle_Counter, enum) ++ (>L:Cycle_Counter, enum)
           (L:Cycle_Counter, enum) 2 ==
               if{
                   (L:ZFactorTemp, number) (>L:Display Scale, number)
                   0 (>L:Cycle_Counter, enum)
                   0 (>L:Refresh_Timer, bool)              
               }
       }
       </Script>
    </Update>

But terrain doesnt refresh and zooming doesnt change nor change back.
I also tried initializing L:Terrain_Refresh and L:Refresh_Timer with a value of 1 in another initializing <update> that do things one time only.
Nothing.

I am going crazy with this :(
 
We're all just guessing at the moment because we don't know what your gauge XML is.

Please post your entire gauge code here, and I'm sure you will get MUCH better suggestions.

Bob
 
Another way to refresh the terrain and water colors is to momentarily change map zoom. This will leave the LayerTerrain variable unchanged so you will not need to know what state it is in.

Bob
Hi Bob,

still same topic.
How about if make 2 map with different color and control by visibility variable?
is it possible?
is it could give impact to frame rate? I remember use 2 map and get huge frame rate drop.
 
Hi Bob,

still same topic.
How about if make 2 map with different color and control by visibility variable?
is it possible?
is it could give impact to frame rate? I remember use 2 map and get huge frame rate drop.
Selamat malam. Selamat Tahun Baru!

Sure, <Visibility> would be a solution in this case. I would have to test it to see impact on frame rate.

Bob

[edit] perhaps by using two maps controlled by two, toggled <Visible>'s, there is no impact on frame rate. My initial thought was that this was a brute force solution, but on the other hand, for this particular case, it might be the best (if no fps impact).

Great idea Pak!
 
Last edited:
Selamat pagi, selamat tahun baru.

Yes, I think this brute solution, the map code still being read, just not render/display.
 
Bob,

Isn't there a non-documented GPS variable/attribute that responds when the GPS needs/doing a redraw?
I got this similar code from a forum post that had TAWS color updates done to the map. (From our F-111 Radar - we could change colors and contrast)
The var is - (C:fs9gps:setup_ColorTerrain)
This was done so long ago I forgot all the particulars, just know that it works...

Note - no GPS index is given!!, for clarity.
Adapted for original post question.
Code:
<!-- ADJUSTMENT FOR TIMING Pick a value less than 25 and greater than 2 -->
<Macro Name="TRIGGER"><MacroValue>17</MacroValue></Macro>

<!-- ADJUSTMENT FOR TIMING The total timer range -->
<Macro Name="TOTAL"><MacroValue>27</MacroValue></Macro>

<!-- TIMER, TRIGGERED WHEN  (L:Map_Refresh) IS NOT ZERO -->
<Update>
<Script>
(L:Map_Refresh, number) 0 != if{ (L:Map_Refresh, number) -- 0 max (>L:Map_Refresh, number) }
(L:Map_Refresh, number) @TRIGGER &lt; if{ 1 (>C:fs9gps:setup_ColorTerrain) } els{ 0 (>C:fs9gps:setup_ColorTerrain) }
</Script>
</Update>


<!-- MAP/GPS ATTRIBUTE(S) -->
<CustomDrawParam Name="DetailLayerTerrain">
<Value>(C:fs9gps:setup_ColorTerrain) 0 == if{ 1 } els{ 2 }</Value>
</CustomDrawParam>

<CustomDrawParam Name="WaterColor">
<Value>(A:LIGHT PANEL, bool) if{ 0x0000FF } els{ 0xFF0000 }</Value>
</CustomDrawParam>


<!-- TRAP THE PANEL LIGHTS EVENT -->
<Keys>
<On Event="PANEL_LIGHTS_TOGGLE">@TOTAL (>L:Map_Refresh, number)</On>
</Keys>
 
Last edited:
Thanks Roman ... I did not know about it. Checking it out now! Bob

[edit] - Sure enough, something's happening, but I'm going to have to play with it to dial it in correctly.

Thanks again for the suggestion!!

You don't happen to know of any more undocumented map or gps vars, do you ...??? :)

Bob
 
Last edited:
Back
Top