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

XML creation and placement

Messages
52
Hi all,

Have been looking through all the threads to find out where you place the .xml file? Many folks say you need to create this .xml file, but no one says where it needs to be placed :) As I understand it, you need to create a .fx file, a .wav file (for a sound effect) an .xml file and a cntrl.fx. file to place one sound effect in FSX. Do you need a cntrl.fx file for only one sound effect

I have been trying to add a sound effect, creating all of the above files, naming them correctly, but will still not play in FSX when I get near the source of the effect (ENV slider set to MAX) so it must be something to do with this .xml file not being where it should be

I am using the latest version of Dev MCX

Many thanks,

Chris
Perth, Western Australia
 
Messages
1,510
Country
unitedstates
You need to compile the XML with bglcomp.exe which will generate a .bgl that you place in your scenery folder. Find bglcomp.exe in your SDK installation, for FSX it's in Microsoft Flight Simulator X SDK\SDK\Environment Kit\BGL Compiler SDK, open that folder and also open the folder that contains your XML in another window. Left click your XML and hold the button down, drag it into the SDK folder and position it over bglcomp.exe, release the left mouse button ("drag & drop the xml on bglcomp", which is apparently the most difficult concept in the world statistically because I have yet to successfully explain it to anyone without pi$$ing them off in 15 years of trying, lol). Assuming your code is correct and there are no syntax errors bglcomp will create a .bgl in the same folder as your XML bearing the same filename (ie "my_fx.xml" generates "my_fx.bgl). Move that .bgl into your active scenery folder.

Sounds .fx are weird, yes I think you'll need a cntrl.fx file but it's been forever since I've done it so I'm afraid I'm not much help in that respect.
 
Messages
52
Hey there, and thanks for your quick reply! aaaah, now we are getting somewhere :) I also understand that there is an option in MCX that when you export your modified (effect already placed in object) as a scenery file, and select fsx.bgl (in type) point it to your active addon scenery folder within FSX, you can also export the created xml at the same time?

In other words, when you have created the effect in MCX and export it, as an **fsx.bgl, does MCX take care of the xml file in the process or do I need to add 2 files to the scenery folder, the one created by bglcomp.exe (as you outlined above) AND the one exported from MCX?

So confusing for a noob.....I did get the drag the xml onto the bglcomp thing tho :)
 
Messages
1,510
Country
unitedstates
I did get the drag the xml onto the bglcomp thing tho :)

Thank god!

I don't know what you mean by "effect already placed in object ". Are you saying you've attached the effect to a .mdl in some modeling program? If that's the case then you need to write an XML that places the object itself rather than the effect and the attached effect will follow along with the model.
 
Messages
52
A bit of background may help here and what I have done so far :) I have created a terminal announcemet and saved it as announcements_1970.wav in the FSX Sound folder. I then created a .fx file pointing to announcemets_1970.wav. The terminal building I want to place the effect in, is in a library of objects, which I firstly imported into MCX, selected the Main terminal building. After selecting ADD/EFFECT then positioned the 'Yellow dot" via the co-ordinates fields, pointed the FX file name to announcemets_1970.fx (in FSX/Effects folder) selected DAY=1 and clicked add. I can now hear the effect playing in MCX

I then exported the selected object (Main terminal building) to FSX/Addon Scenery/DM_EGCC_1962/Scenery folder, so now I have DM_EGCC_1962Lib. bgl and a newly created by MCX, DM_EGCC_1962_22. bgl amongst all the other files in that scenery folder

No .xml files created, thus far
I'm obviously missing the big picture here somewhere, LoL

The airport in question is David Maltbys 1962 EGCC DM_EGCC_1962.zip

Thanks,

Chris
 
Last edited:
Messages
1,510
Country
unitedstates
To me it seems much easier to leave the scenery as it is (I see no need for the custom DM_EGCC_1962_22. bgl containing apparently a 2nd copy of the terminal building(?) but maybe I'm missing something).

I would simply place an effect where you want the sound to be heard. This is an excerpt from one I did that should accomplish that, with the sound playing in daytime but not at night. You'll of course need to modify the coordinates to suit your location and you'll also need to change effectName= to whatever your custom effect is named. You would paste this code into Notepad and save it as "place_my_effect.xml" (or whatever.xml) and then drag/drop it on bglcomp as outlined above to produce a .bgl. Then just put that .bgl in the DM_EGCC_1962\scenery folder (or any active scenery folder) and you should be good to go.

Code:
<?xml version="1.0" encoding="ISO-8859-1"?>

<FSData
   version="9.0"
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xsi:noNamespaceSchemaLocation="bglcomp.xsd">

<SceneryObject
   lat="48.7303864"
   lon="-116.2925164"
   alt="0.5M"
   altitudeIsAgl="TRUE"
   pitch="0"
   bank="0"
   heading="0"
   imageComplexity="NORMAL">
   <Effect
      effectName="Sound_Ambient_Airport_su_controller.fx"
      effectParams="DAY=1;NIGHT=0"/>
</SceneryObject>

</FSData>

That should take care of the placement but I'm skeptical about whether you'll be able to do this without a controller. Here is the effect I made that actually calls out the .wav file:

Code:
[Library Effect]
Lifetime=5
Version=2.00
Display Name=Sound_Ambient_Airport_su
Radius=800
Priority=0
[Sound]
FileName=Sound_Ambient_Airport_su.wav
MinAttenuationDistance=500.00
Looping=FALSE

[Properties]

[Emitter.0]
Lifetime=119.00, 119.00
Delay=0.00, 0.00
Bounce=0.00
Rate=1.00, 1.00
X Emitter Velocity=0.00, 0.00
Y Emitter Velocity=0.00, 0.00
Z Emitter Velocity=0.00, 0.00
Drag=0.00, 0.00
X Particle Velocity=0.00, 0.00
Y Particle Velocity=0.00, 0.00
Z Particle Velocity=0.00, 0.00
X Rotation=0.00, 0.00
Y Rotation=0.00, 0.00
Z Rotation=0.00, 0.00
X Offset=0.00, 0.00
Y Offset=0.00, 0.00
Z Offset=0.00, 0.00
Pitch=0.00, 0.00
Bank=0.00, 0.00
Heading=0.00, 0.00

[Particle.0]
Lifetime=119.00, 119.00
Type=19
X Scale=1.00, 1.00
Y Scale=1.00, 1.00
Z Scale=0.00, 0.00
X Scale Rate=0.00, 0.00
Y Scale Rate=0.00, 0.00
Z Scale Rate=0.00, 0.00
Drag=0.00, 0.00
Color Rate=0.00, 0.00
X Offset=0.00, 0.00
Y Offset=0.00, 0.00
Z Offset=0.00, 0.00
Fade In=0.00, 0.00
Fade Out=0.00, 0.00
Rotation=0.00, 0.00
Face=0, 0, 0

[ParticleAttributes.0]
Blend Mode=0
Bounce=0.00
Color Start=0, 0, 0, 0
Color End=0, 0, 0, 0
Jitter Distance=0.00
Jitter Time=0.00
uv1=0.00, 0.00
uv2=0.00, 0.00
X Scale Goal=0.00
Y Scale Goal=0.00
Z Scale Goal=0.00
Extrude Length=0.00
Extrude Pitch Max=0.00
Extrude Heading Max=0.00

And this is the controller that I actually placed with the XML above:

Code:
[Library Effect]
Lifetime=5
Version=2.00
Radius=800
Priority=0

[controller.0]
lifetime=0.00, 0.00
type=3
distance=1000.00, 1000.00
delay=119.00, 119.00
x offset=0.00, 0.00
y offset=0.00, 0.00
z offset=0.00, 0.00
effect.0=Sound_Ambient_Airport_su.fx, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 2.00, 3.00

At one time I understood most of what that all means but I've long forgotten at this point. IIRC you can play with MinAttenuationDistance=xx and Radius=xx to change the distance the at which the sound becomes audible and how it fades in and out as you move around in relation to the placement.

That's the way I'd go about a 1st attempt anyway. :)
 
Messages
1,510
Country
unitedstates
I guess if you're generally happier hearing it from someone besides me this is the post I followed:

 
Messages
52
Hey thanks for that! Im away from FS PC atm (on a weekend break)so carnt try it out, but will do when i get home. Cheers Chris
 
Messages
52
Hi, sorry for my delayed reply...a bit going on atm. Finally managed to get some FS time! Good news, I FINALLY got it to work. I had an issue with the FSX co-ordinates as I was using FSX style ones (In the View/Top Down/Shift ZZ format, and yours appeared to be a different format, so a bit of googling revealed you need to use a decimal format. Another post on here showed how to change FSX.cfg to show those. Once I had done that and recompiled it, IT FINALLY played :) on cue

Thanks again for your help in all this, another lesson learned!

Cheers Chris
 
Last edited:
Top