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

FSX DSD_xml_sound - extra sim status variables/volume control?

Heretic

Resource contributor
Messages
6,830
Country
germany
I'm trying to make a looped sound play in spot view only, but I can't get a return from the (L:ViewSystemStatus, number) variable built into dsd_xml_sound.

Same thing with (L:FSSimIsPaused, number) for stopping sounds when FSX is paused.

Both variables always return zero, regardless of view or sim state. :confused:

The gauge version is v5.2.0 (jul/aug 2014)*. FSX version is the Steam Edition. All SimConnect versions (RTM, SP1, SP2/Acc, SE) are installed.

Not sure whether this is a gauge bug or a remotely possible incompatibility with the Steam Edition, but can anyone confirm this? o_O


*http://douglassdawson.ca/
 
Messages
495
Country
austria
FSX Gold Both variablen work with me!

For the view-status you could use
Code:
(C:SIMVARS:Current View Mode,Number)

// (L:ViewSystemStatus,number) ** 0 – Outside (spot) view. ** 1 – 2D cockpit view ** 2 – 3D VC view ** 4 – Orthogonal (map) view

Some for the simvar
 

Heretic

Resource contributor
Messages
6,830
Country
germany
Yep, Simvars would work for me. Thanks, Edi!


This leaves the "pause" issue.
 
Last edited:

ddawson

Resource contributor
Messages
862
Country
canada
What is the (L:SimConnected, bool) variable returning?
If I get a chance in the next day or two, I'll try loading the thing in SE myself.

Doug
 
Messages
240
Country
germany
I use this to determine if the sim is paused:

Code:
0 1 (P:ABSOLUTE TIME,seconds) (G:Var1,number) == ? (>L:SimRunning,bool)
(P:ABSOLUTE TIME,seconds) (>G:Var1,number)
 

Heretic

Resource contributor
Messages
6,830
Country
germany
What is the (L:SimConnected, bool) variable returning?
If I get a chance in the next day or two, I'll try loading the thing in SE myself.

"1", weirdly enough.


I use this to determine if the sim is paused:

Code:
0 1 (P:ABSOLUTE TIME,seconds) (G:Var1,number) == ? (>L:SimRunning,bool)
(P:ABSOLUTE TIME,seconds) (>G:Var1,number)

Genial einfach - einfach genial. Danke!
 
Last edited:

taguilo

Resource contributor
Messages
1,585
Country
argentina
It's even more simple:

Code:
(P:ABSOLUTE TIME,seconds) (G:Var1,number) == ! (>L:SimRunning,bool)
..or...
(P:ABSOLUTE TIME,seconds) (G:Var1,number) == (>L:SimPaused,bool)
....
(P:ABSOLUTE TIME,seconds) (>G:Var1,number)

All comparisons place a bool 1 (equal) or 0 (different) value on the stack.

Tom.
 
Last edited:

Heretic

Resource contributor
Messages
6,830
Country
germany
I've amended the thread title because I'm expanding my inquiry a bit.

First, Tom's pause detection code somehow only does after toggling pause at least once. Steven's always works.


Second, I need an example or help for/with volume control via XML_sound. Or I think I ran into a bug.

While there's a few threads on the subject, none of the solutions proposed there work for me and the readme for DSD_XML_sound doesn't contain any working examples and too little info on required syntax, limitations and other caveats.

Below is a working example for an APU sound environment.
Code:
  (A:APU PCT RPM, percent) 5 >
  (L:APU State, number) 0 == and
  if{ 1 (>L:APU_Start, number) 1 (>L:APU State, number) }
  
  (A:APU PCT RPM, percent) 98 >
  (L:APU State, number) 1 == and
  if{ 0 (>L:APU_Start, number) 2 (>L:APU_Run, number) 2 (>L:APU State, number) }
  
  (A:APU PCT RPM, percent) 98 <
  (L:APU State, number) 2 == and
  if{ 0 (>L:APU_Run, number) 1 (>L:APU_Stop, number) 3 (>L:APU State, number) }
  
  (A:APU PCT RPM, percent) 5 <
  (L:APU State, number) 3 == and
  if{ 0 (>L:APU_Stop, number) 0 (>L:APU State, number) }

The sounds play just fine, but I want them to be quieter in the VC, so I'm using the default volume control variable to set the volume depending on the view.

Code:
(C:SIMVARS:Current View Mode,Number) 2 ==
  if{ -2000 (>L:dsd_xml_sound_volume_in, number) }
  (C:SIMVARS:Current View Mode,Number) 0 ==
  if{ 0 (>L:dsd_xml_sound_volume_in, number) }

The play/loop mode number for volume (and pan) controlled sounds is 7 and 8 respecively, so (without posting the entire code above):
Code:
...
  if{ 7 (>L:APU_Start, number) 1 (>L:APU State, number) }

...
  if{ 0 (>L:APU_Start, number) 8 (>L:APU_Run, number) 2 (>L:APU State, number) }
  
...
  if{ 0 (>L:APU_Run, number) 7 (>L:APU_Stop, number) 3 (>L:APU State, number) }
  
...
  if{ 0 (>L:APU_Stop, number) 0 (>L:APU State, number) }

Since the script is processed linearly, all APU sounds should inherit the volume setting specifed above. With the slight difference that they don't, because I'm can't hear a thing.

One variation I've tried, without success, is this one:
Code:
(C:SIMVARS:Current View Mode,Number) 2 ==
  if{ -2000 (>L:dsd_xml_sound_volume_in, number)
  3 (>L:APU_Start, number)
  3 (>L:APU_Run, number)
  3 (>L:APU_Stop, number) }
  (C:SIMVARS:Current View Mode,Number) 0 ==
  if{ 0 (>L:dsd_xml_sound_volume_in, number)
  3 (>L:APU_Start, number)
  3 (>L:APU_Run, number)
  3 (>L:APU_Stop, number) }


Also a very simple one like this one...
Code:
(C:SIMVARS:Current View Mode,Number) 2 ==
if{ -2000 (>L:dsd_xml_sound_volume_in, number) }
(C:SIMVARS:Current View Mode,Number) 0 ==
if{ 0 (>L:dsd_xml_sound_volume_in, number) }

(A:APU PCT RPM, percent) 98 >
if{ 8 (>L:APU_Run, number) }

...or this one...
Code:
(A:APU PCT RPM, percent) 98 >
if{ (C:SIMVARS:Current View Mode,Number) 2 == if{ -2000 (>L:dsd_xml_sound_volume_in, number) } (C:SIMVARS:Current View Mode,Number) 0 == if{ 0 (>L:dsd_xml_sound_volume_in, number) } 8 (>L:APU_Run, number) }

...does not work.

The config says:
Code:
...
VolumeVarIn=dsd_xml_sound_volume_in
...
Sound19=Sounds\xapu_starter.wav
Sound20=Sounds\xapu.wav
Sound21=Sounds\xapu_shutdown.wav
...
Lvar19=APU_Start
Lvar20=APU_Run
Lvar21=APU_Stop



What am I doing wrong?
Or is this a bug at work?
 
Messages
495
Country
austria
In my understanding Doug introduced a new volume and pan control separately for any soundvariable since version 5 (5.20)
Explanation in the zip file "new for version 5.txt" Also "dsd_fsx_xml_sound.ini"
I 'm also interested in this. But had no time to play around with this.
Otherwise Doug hopefully will help us.

Edi
 

Heretic

Resource contributor
Messages
6,830
Country
germany
Still won't work.

Code:
(C:SIMVARS:Current View Mode,Number) 2 ==
if{ -1000 (>L:APU_Volume,number) }
(C:SIMVARS:Current View Mode,Number) 0 ==
if{ 0 (>L:APU_Volume,number) }

The sound variable correctly changes values based on the current view mode.

Test code:
Code:
(A:APU PCT RPM, percent) 98 >
if{ 8 (>L:APU_Run, number) }

.ini:
Code:
Lvar19=APU_Start
Lvar20=APU_Run
Lvar21=APU_Stop

[Volume_Variables]
Lvar19=APU_Volume
Lvar20=APU_Volume
Lvar21=APU_Volume
 

taguilo

Resource contributor
Messages
1,585
Country
argentina
First, Tom's pause detection code somehow only does after toggling pause at least once. Steven's always works.

Actually my code and Steven's give the same result, hence both always work the same. There must be no difference in FSX performance.

Tom
 
Top