PAPI Lighting Tutorial

arno

Administrator
Staff member
FSDevConf team
Resource contributor
Hi,

1. The boxes appear as black although they are red in gmax. I am using FS2004-Gmax and there were no SF2004 export options to select colour or material for export so I assume they are automatic and the export options are only in FSX-Gmax. Any idea why they come out black (I've exported the .mdl, edited elevation planes, BGLC9'd a new .mdl, imported to my FS2004lib and compiled it, all twice, no change). Similar thing with no options for setting GUID and Friendly name, is that right?
Which FSX version are you using? Before SP2 there was a bug that made all FS2004 non-textured polygons black. So that could be the issue you are seeing.

The GUID and friendly name are new for FSX, for FS2004 that information is not included in the MDL file itself. That is why you can not set it. So nothing wrong with that :).

2. When I attach my library FS2004lib.bgl to ADE the contents (only the PAPI_04_064) shows as FS2004lib.bgl_001 not PAPI_04_064. Is that what I should expect? It places and shows ok.
I guess Jon can best answer that one, but as the BGL file contains no friendly name I think that is how Jon decided to name them. From the BGL file there is no way to know the MDL filename anymore.
 
Thanks arno,

I have FSX SP1, I read somewhere that SP2 could create problems with add-ons (I have Horizon photo scenery, Just Flght Spitfire etc) so I didn't install it. Unless you know different I'll stick with that and add textures to my models.

Hopefully Jon can give more detail on the model names, if not I suppose I'll just have to catalogue them.

klem
 
Hello! I think that anybody help me.

I try create red and green light at end runway over SEPARATION_PLANE, but i have some problem.

When I do coordinate Y=0 in GMAX and convert to mdl with this code. I have normal work light.
Code:
IFIN1 nolgt_1, 028ch, 2, 6
    BGL_ZBIAS 1
    SEPARATION_PLANE WrongSide, -32052, 0, -6813, 32768     
    BGL_LIGHT LIGHT_NAV, -14.500, 0.472, -0.067, 20, 0.60, 0.40, 0FF40BF40h, 0.000000, 0.000000, 1.000000; source poly num = 344
WrongSide label BGLCODE
    SEPARATION_PLANE WrongSide1, 32052, 0, 6813, 32768
BGL_LIGHT LIGHT_NAV, 13.000, 0.472, 0.066, 20, 0.60, 0.40, 0FFFF0000h, 0.000000, 0.000000, 1.000000; source poly num = 2997
    WrongSide1 label BGLCODE
    nolgt_1       label BGLCODE
But if I do Y=-1250 in GMAX, my light only green.
Code:
IFIN1 nolgt_1, 028ch, 2, 6
    BGL_ZBIAS 1
    SEPARATION_PLANE WrongSide, -32052, 0, -6813, 32768     
    BGL_LIGHT LIGHT_NAV, -14.500, 0.472, [b]-1250.000[/b], 20, 0.60, 0.40, 0FF40BF40h, 0.000000, 0.000000, 1.000000; source poly num = 344
WrongSide label BGLCODE
    SEPARATION_PLANE WrongSide1, 32052, 0, 6813, 32768
BGL_LIGHT LIGHT_NAV, 13.000, 0.472, -1250.050, 20, 0.60, 0.40, 0FFFF0000h, 0.000000, 0.000000, 1.000000; source poly num = 2997
    WrongSide1 label BGLCODE
    nolgt_1       label BGLCODE

Why??? I don't undestend. Maybe I do something wrong, I just want set light on end runway.
 

arno

Administrator
Staff member
FSDevConf team
Resource contributor
Hi,

The SEPARATION_PLANE command will still check around the origin, so if you move your light the "virtual" plane that separates the two colours is still at the original location.

I think it is best to try to keep your light location near the origin of the scene, as that makes the math easier. Then you can place the MDL at the right coordinates in the XML code.

Alternatively you can also set the fourth argument of the SEPARATION_PLANE to a different value than 32768. Multiply 32768 by the length of the vector you want to use to define the location of the test plane.

Hopefully this makes sense to you,
 
Hi,
I have followed the tutorial but have now run into problems with BGLC9. I try and create a BGL but nothing happens!! I dont even get an error report? I have run the non edited asm file with success but as soon as I edit it as per the tutorial nothing happens! Please can you help this is driving me up the wall:confused:
 

arno

Administrator
Staff member
FSDevConf team
Resource contributor
Hi,

How are you compiling? If you just drop the files on the BGLC9 icon it is not going to work indeed. To see the error messages you need to compile from the command prompt. Another option is to try my CompileHelper tool that allows drag-and-drop compilation with error reports.
 
Thanks for that, works a treat now, but just a quick question. How do you change the file extention from BGL to MDL when the file wont let you. In other words when i go to rename it i can only see the file name not the extention ie BGL? Its OK found out how to, thanks.
 
Last edited:

arno

Administrator
Staff member
FSDevConf team
Resource contributor
Hi,

That is a Windows setting, sounds like you have it set to hide known extensions. You can change that in the option of Explorer.
 
Hi,
I got a problem with creating PAPI . I created the PAPI lights as the tutorial and tweaked the *_0.asm file . Next, I used BGLC_9 to recompile the asm files to create BGL file and rename the extension BGL to .MDL file .
Now I want to use EZ-scenery to add the PAPI to my scenery . How do I do that ? Do I must to edit the coordinate in XML file ?
 
Hi, I get the error when I compile BGL file from two files (my filenames are PAPI.mdl and PAPI.XML) :
Code:
F:\Flight Simulator 9\Addon Scenery\scenery>bglcomp.exe papi.xml
ERROR C2471: Unrecoverable error loading schema!
INTERNAL COMPILER ERROR C1010: Failed to load XSD (bglcomp.xsd)!
ERROR C2003: Failed to process file: papi.xml
What's wrong ???
 

arno

Administrator
Staff member
FSDevConf team
Resource contributor
Hi,

Did you move BGLComp.exe to another folder? The message indicates that the file BGLComp.xsd could not be found. This file should be in the same folder as BGLComp.exe (by default it is).
 
Hi,

Did you move BGLComp.exe to another folder? The message indicates that the file BGLComp.xsd could not be found. This file should be in the same folder as BGLComp.exe (by default it is).
Hi Arno,
Thanks a lot, you were right . It worked :D
But a new problem . Please watch my photos . The position of PAPI is not exactly (near the touchdown point of the runway) . And when I coming close to it, the lights are gone .
I create it for runway 17L (172 degree) . When I below the glideslope 4 lights are White and against. RED apprear...

Code:
PAPI_MasterScale_2 label BGLCODE
       BGL_ZBIAS 1   
    SEPARATION_PLANE WrongSide, -4560, 0, 32449, 32768  
    SEPARATION_PLANE below1, 199, 32737, -1415, 32768
    BGL_LIGHT LIGHT_NAV, -55.284, 1.133, 1216.580, 20, 0.60, 0.40, 0FFD30F0Fh, 0.000000, 0.000000, 1.000000 ; source poly num = 217
 BGL_JUMP_32 above1 
	below1 label BGLCODE 
    BGL_LIGHT LIGHT_NAV, -54.799, 1.133, 1216.580, 20, 0.60, 0.40, 0FFFFFFFFh, 0.000000, 0.000000, 1.000000 ; source poly num = 218
	above1 label BGLCODE
   SEPARATION_PLANE below2, 225, 32728, -1604, 32768 
    BGL_LIGHT LIGHT_NAV, -53.513, 1.133, 1216.580, 20, 0.60, 0.40, 0FFD30F0Fh, 0.000000, 0.000000, 1.000000 ; source poly num = 447
 BGL_JUMP_32 above2 
	below2 label BGLCODE  
    BGL_LIGHT LIGHT_NAV, -53.028, 1.133, 1216.580, 20, 0.60, 0.40, 0FFFFFFFFh, 0.000000, 0.000000, 1.000000 ; source poly num = 448
	 above2 label BGLCODE
   SEPARATION_PLANE below3, 252, 32718, -1792, 32768
    BGL_LIGHT LIGHT_NAV, -51.742, 1.133, 1216.580, 20, 0.60, 0.40, 0FFD30F0Fh, 0.000000, 0.000000, 1.000000 ; source poly num = 677
  BGL_JUMP_32 above3 
	below3 label BGLCODE
    BGL_LIGHT LIGHT_NAV, -51.256, 1.133, 1216.580, 20, 0.60, 0.40, 0FFFFFFFFh, 0.000000, 0.000000, 1.000000 ; source poly num = 678
	 above3 label BGLCODE
   SEPARATION_PLANE below4, 278, 32707, -1981, 32768
    BGL_LIGHT LIGHT_NAV, -49.971, 1.133, 1216.580, 20, 0.60, 0.40, 0FFD30F0Fh, 0.000000, 0.000000, 1.000000 ; source poly num = 907
 BGL_JUMP_32 above4 
	below4 label BGLCODE
    BGL_LIGHT LIGHT_NAV, -49.485, 1.133, 1216.580, 20, 0.60, 0.40, 0FFFFFFFFh, 0.000000, 0.000000, 1.000000 ; source poly num = 908
	above4 label BGLCODE 
WrongSide label BGLCODE 

    BGL_RETURN

Edit : Solved
 
Last edited:
Ok, I solved it :p
I calculated X, Y and I thought the calculation in the tutorial had a wrongway as :
Hi

Great tutorial, Is there anyway to make the lights show further from the airport? They seem to fade pretty quick.

I also think the X and Y are the wrong way round in the tutorial, unless I've understood wrong.

Early in the tutorial you say;

SEPARATION_PLANE nolgt_2, <X component>, <Z component>, <Y component>, <vector>

But later in the final X, Y calculations you've have the X & Y calc the wrong way round

eg:

sin (78) x 1429 = Y,
1398 = Y

I think it should be

sin (78) x 1429 = X,
1398 = X

and the same for the Cos

cos (78) x 1429 = X
297 = X

should be

cos (78) x 1429 = Y
297 = Y

I think the other final calculations are the wrong way also.

It took me a few hours head scratching to figure out why it didnt work, and it was as simple as have the X in the Y and the Y in the X.

Stevo ;)

Thanks a lot
 

jtanabodee

Resource contributor
Hi,
This is a great tutorial but I cannot make the light visible by using FS2004 gamepack to export. I just tried to test it first by not to tweak at all, but light still invisible. If I export with FS2002, I can see the light but the *0_asm code don't look the same in tutorial. Do you use FS2002? No mention about this in tutorial.:confused:
Best Regards,
jtanabodee
 

arno

Administrator
Staff member
FSDevConf team
Resource contributor
Hi,

In the FS2004 ASM files you will see a line IFMSK just before the actual BGL_LIGHT command. You need to remove this line to make them visible. It is checking some variable that is not valid for scenery MDL files, it only works in aircraft MDL files. This is a bug in MakeMDL.
 

jtanabodee

Resource contributor
Oh, this is excellent piece of work. Please skip mine. Yours is much better. Why I didn't see this before? BTW, I made a document to explain the concept of separation plane in layman term and 3d box to let dump guy like me to understand this. It is difficult to understand if you do not use to caculation and mathematic everyday. Here is the link http://www.4shared.com/file/87408409/6748ddcf/PAPI_Tutorial_Separate_Plane_Concept.html
 
Top