PAPI Lighting Tutorial

Hi

A slightly different question to I posted above.

The PAPI lights I made from the tutorial work great. At night and you can see the lights from about 6 miles away, but during the day they disappear just short of 2 miles which is not much use, is it something I've done wrong or is this known about?

Cheers
Stevo ;)
I have been trying to solve this problem as well, I have tweaked every variable there is and still the light only displays at 2 km during the day.

Reading this post on Distant Lighting, I have come to the conclusion that is the way to go. Check out post 11 for and explanation of doing it in gmax.

My idea is to LOD different size spheres down to the 2 km mark, then have them disappear so that the LIGHT_NAV lights take over.

I guess there is going to be a lot of code tweaking to get it to work. :yikes:

David
CanUK Scenery
 
asm

Hello all,

I've exported my gmax PAPI, but unfortunately, I didnt get any asm files in my folder... can someone help me on this?
 
problem with bgl comp

hello,
I've done all in the tutorial but when I take the asm file after editing it and put it in the bgl compiler, it doesnt create a bgl file but gives me an error msg.

ERROR C2034: XML Parse Fatal Error <line, column, error>

ERROR: 1, 1, Incorrect document syntax.
ERROR C2470: Unrecoverable error parsing XML!
ERROR C2006: Parse failed <0x80004005>
ERROR C2003: Failed to process file: C:\Program Files\Microsoft Games\Flight Simulator 9\gmax\gamepacks\fs2004\scenes\papi.asm


Please help
 
Sounds like you're trying to compile the .asm with bglcomp.exe? You need to use BGLC_9.exe to compile .asm which will produce a .mdl with a .bgl file extension. This extension needs to be changed to ".mdl" and then the .mdl needs to be added to an object library .bgl in the same manner you would normally add any other .mdl exported from Gmax.

If you need BGLC_9.exe, see the sticky thread at the top of this "BGLC tweaking" forum.

Jim
 
Compile problems

Hi all

Thank you very much for the tutorial, hopefully I get the PAPIs working too ;)

When I made the changes in the _0.asm file and want to compile a Model with BGLC_9, I get a few errors:
Code:
E:\Project Zurich\FreeZ\Projektdaten\Arbeitspakete\AIRFIELD\Z6\Model\PAPI>bglc_9
 -mdl PAPI_10.asm
Microsoft (R) Flight Simulator BGL Compiler Version 8.00
Copyright (C) Microsoft Corp 1981-2002.  All rights reserved.

 Assembling: PAPI_10.azm
E:\Project Zurich\FreeZ\Projektdaten\Arbeitspakete\AIRFIELD\Z6\Model\PAPI\PAPI_1
0_0.asm(290) : error A2006: undefined symbol : bgl_animation_command_end_PAPI_10
_0
 BGL_SCENEGRAPH_ENTRY(4): Macro Called From
  E:\Project Zurich\FreeZ\Projektdaten\Arbeitspakete\AIRFIELD\Z6\Model\PAPI\PAPI
_10_0.asm(290): Include File
E:\Project Zurich\FreeZ\Projektdaten\Arbeitspakete\AIRFIELD\Z6\Model\PAPI\PAPI_1
0_0.asm(290) : error A2006: undefined symbol : bgl_animation_command_end_PAPI_10
_0
 ERRS16(1): Macro Called From
  BGL_SCENEGRAPH_ENTRY(9): Macro Called From
   E:\Project Zurich\FreeZ\Projektdaten\Arbeitspakete\AIRFIELD\Z6\Model\PAPI\PAP
I_10_0.asm(290): Include File
E:\Project Zurich\FreeZ\Projektdaten\Arbeitspakete\AIRFIELD\Z6\Model\PAPI\PAPI_1
0_0.asm(292) : error A2006: undefined symbol : bgl_animation_command_end_PAPI_10
_1
 BGL_SCENEGRAPH_ENTRY(4): Macro Called From
  E:\Project Zurich\FreeZ\Projektdaten\Arbeitspakete\AIRFIELD\Z6\Model\PAPI\PAPI
_10_0.asm(292): Include File
E:\Project Zurich\FreeZ\Projektdaten\Arbeitspakete\AIRFIELD\Z6\Model\PAPI\PAPI_1
0_0.asm(292) : error A2006: undefined symbol : bgl_animation_command_end_PAPI_10
_1
 ERRS16(1): Macro Called From
  BGL_SCENEGRAPH_ENTRY(9): Macro Called From
   E:\Project Zurich\FreeZ\Projektdaten\Arbeitspakete\AIRFIELD\Z6\Model\PAPI\PAP
I_10_0.asm(292): Include File
E:\Project Zurich\FreeZ\Projektdaten\Arbeitspakete\AIRFIELD\Z6\Model\PAPI\PAPI_1
0_0.asm(294) : error A2006: undefined symbol : bgl_animation_command_end_PAPI_10
_2
 BGL_SCENEGRAPH_ENTRY(4): Macro Called From
  E:\Project Zurich\FreeZ\Projektdaten\Arbeitspakete\AIRFIELD\Z6\Model\PAPI\PAPI
_10_0.asm(294): Include File
E:\Project Zurich\FreeZ\Projektdaten\Arbeitspakete\AIRFIELD\Z6\Model\PAPI\PAPI_1
0_0.asm(294) : error A2006: undefined symbol : bgl_animation_command_end_PAPI_10
_2
 ERRS16(1): Macro Called From
  BGL_SCENEGRAPH_ENTRY(9): Macro Called From
   E:\Project Zurich\FreeZ\Projektdaten\Arbeitspakete\AIRFIELD\Z6\Model\PAPI\PAP
I_10_0.asm(294): Include File
E:\Project Zurich\FreeZ\Projektdaten\Arbeitspakete\AIRFIELD\Z6\Model\PAPI\PAPI_1
0_0.asm(296) : error A2006: undefined symbol : bgl_animation_command_end_PAPI_10
_3
 BGL_SCENEGRAPH_ENTRY(4): Macro Called From
  E:\Project Zurich\FreeZ\Projektdaten\Arbeitspakete\AIRFIELD\Z6\Model\PAPI\PAPI
_10_0.asm(296): Include File
E:\Project Zurich\FreeZ\Projektdaten\Arbeitspakete\AIRFIELD\Z6\Model\PAPI\PAPI_1
0_0.asm(296) : error A2006: undefined symbol : bgl_animation_command_end_PAPI_10
_3
 ERRS16(1): Macro Called From
  BGL_SCENEGRAPH_ENTRY(9): Macro Called From
   E:\Project Zurich\FreeZ\Projektdaten\Arbeitspakete\AIRFIELD\Z6\Model\PAPI\PAP
I_10_0.asm(296): Include File
E:\Project Zurich\FreeZ\Projektdaten\Arbeitspakete\AIRFIELD\Z6\Model\PAPI\PAPI_1
0_0.asm(298) : error A2006: undefined symbol : bgl_animation_command_end_PAPI_10
_4
 BGL_SCENEGRAPH_ENTRY(4): Macro Called From
  E:\Project Zurich\FreeZ\Projektdaten\Arbeitspakete\AIRFIELD\Z6\Model\PAPI\PAPI
_10_0.asm(298): Include File
E:\Project Zurich\FreeZ\Projektdaten\Arbeitspakete\AIRFIELD\Z6\Model\PAPI\PAPI_1
0_0.asm(298) : error A2006: undefined symbol : bgl_animation_command_end_PAPI_10
_4
 ERRS16(1): Macro Called From
  BGL_SCENEGRAPH_ENTRY(9): Macro Called From
   E:\Project Zurich\FreeZ\Projektdaten\Arbeitspakete\AIRFIELD\Z6\Model\PAPI\PAP
I_10_0.asm(298): Include File
BGLC: Error!
 
That's a part of the code of the _0.asm:

Code:
PAPI_10_MasterScale_2 label BGLCODE

    BGL_ZBIAS 1
    SEPARATION_PLANE horizontal, -32588, 0, 3425, 32768
      SEPARATION_PLANE below1, -179, 32723, 1706, 32768
        BGL_LIGHT LIGHT_NAV, -13.806, 1.090, 0.969, 20, 0.60, 0.40, 0FFFFFFFFh, 0.000000, 0.000000, 1.000000 ; source poly num = 37
        BGL_JUMP_32 above1
      below1 label BGLCODE
        BGL_LIGHT LIGHT_NAV, -13.411, 1.090, 0.969, 20, 0.60, 0.40, 0FFFF0000h, 0.000000, 0.000000, 1.000000 ; source poly num = 38
      above1 label BGLCODE
      SEPARATION_PLANE below2, -199, 32713, 1895, 32768
        BGL_LIGHT LIGHT_NAV, -4.316, 1.090, 0.969, 20, 0.60, 0.40, 0FFFF0000h, 0.000000, 0.000000, 1.000000 ; source poly num = 39
        BGL_JUMP_32 above2
      below2 label BGLCODE
        BGL_LIGHT LIGHT_NAV, -4.711, 1.090, 0.969, 20, 0.60, 0.40, 0FFFFFFFFh, 0.000000, 0.000000, 1.000000 ; source poly num = 40
      above2 label BGLCODE
      SEPARATION_PLANE below3, -219, 32701, 2085, 32768
        BGL_LIGHT LIGHT_NAV, 4.390, 1.090, 0.969, 20, 0.60, 0.40, 0FFFFFFFFh, 0.000000, 0.000000, 1.000000 ; source poly num = 41
        BGL_JUMP_32 above3
      below3 label BGLCODE
        BGL_LIGHT LIGHT_NAV, 4.784, 1.090, 0.969, 20, 0.60, 0.40, 0FFFF0000h, 0.000000, 0.000000, 1.000000 ; source poly num = 42
      above3 label BGLCODE
      SEPARATION_PLANE below4, -239, 32688, 2273, 32768
        BGL_LIGHT LIGHT_NAV, 13.894, 1.090, 0.969, 20, 0.60, 0.40, 0FFFF0000h, 0.000000, 0.000000, 1.000000 ; source poly num = 43
        BGL_JUMP_32 above4
      below4 label BGLCODE
        BGL_LIGHT LIGHT_NAV, 13.500, 1.090, 0.969, 20, 0.60, 0.40, 0FFFFFFFFh, 0.000000, 0.000000, 1.000000 ; source poly num = 44
      above4 label BGLCODE
    horizontal label BGLCODE
    BGL_RETURN


bgl_riff_end_PAPI_10	label	BGLCODE
;
; STATIC ANIMATION BLOCK
;
static_matrix_list_riff_start_PAPI_10	label	word
    db  'T','R','A','N'   
    dd  static_matrix_list_riff_end_PAPI_10 - $ - 4

; Static matrix parameters for transform: 0
    real4      1.000000,     0.000000,     0.000000,     0.000000  
    real4      0.000000,     0.000000,     1.000000,     0.000000  
    real4      0.000000,    -1.000000,     0.000000,     0.000000  
    real4      0.000000,     0.000000,     0.000000,     1.000000  

; Static matrix parameters for transform: 1
    real4      0.800000,     0.000000,     0.000000,     0.000000  
    real4      0.000000,    -0.048839,    -0.798508,     0.000000  
    real4      0.000000,     0.798508,    -0.048839,     0.000000  
    real4    -13.767978,    -0.007596,    -0.771863,     1.000000  

; Static matrix parameters for transform: 2
    real4      0.800000,     0.000000,     0.000000,     0.000000  
    real4      0.000000,    -0.048839,    -0.798508,     0.000000  
    real4      0.000000,     0.798508,    -0.048839,     0.000000  
    real4     -4.668326,    -0.017149,    -0.771863,     1.000000  

; Static matrix parameters for transform: 3
    real4      0.800000,     0.000000,     0.000000,     0.000000  
    real4      0.000000,    -0.048839,    -0.798508,     0.000000  
    real4      0.000000,     0.798508,    -0.048839,     0.000000  
    real4      4.431326,    -0.022346,    -0.771864,     1.000000  

; Static matrix parameters for transform: 4
    real4      0.800000,     0.000000,     0.000000,     0.000000  
    real4      0.000000,    -0.048839,    -0.798508,     0.000000  
    real4      0.000000,     0.798508,    -0.048839,     0.000000  
    real4     13.530978,    -0.018554,    -0.771864,     1.000000  
static_matrix_list_riff_end_PAPI_10 label word       

;
; ANIMATION PARAMETER BLOCK
;
animation_parameters_riff_start_PAPI_10	label	word
    db  'A','N','I','P'   
    dd  animation_parameters_riff_end_PAPI_10 - $ - 4
animation_parameters_riff_end_PAPI_10 label word       

;
; ANIMATION COMMAND BLOCK
;
animation_commands_riff_start_PAPI_10	label	word
    db  'A','N','I','C'   
    dd  animation_commands_riff_end_PAPI_10 - $ - 4

; Animation command for transform: 0  output index: 0
bgl_animation_command_start_PAPI_10_0	label	BGLCODE

     BGL_TRANSFORM_INDIRECT  0, 0


; Animation command for transform: 1  output index: 1
bgl_animation_command_start_PAPI_10_1	label	BGLCODE

     BGL_TRANSFORM_INDIRECT  1, 1


; Animation command for transform: 2  output index: 2
bgl_animation_command_start_PAPI_10_2	label	BGLCODE

     BGL_TRANSFORM_INDIRECT  2, 2


; Animation command for transform: 3  output index: 3
bgl_animation_command_start_PAPI_10_3	label	BGLCODE

     BGL_TRANSFORM_INDIRECT  3, 3


; Animation command for transform: 4  output index: 4
bgl_animation_command_start_PAPI_10_4	label	BGLCODE

     BGL_TRANSFORM_INDIRECT  4, 4

animation_commands_riff_end_PAPI_10 label word       

;
; SCENE GRAPH RIFF BLOCK
;
scene_graph_riff_start_PAPI_10	label	word
    db  'S','C','E','N'   
    dd  scene_graph_riff_end_PAPI_10 - $ - 4

    dw 5
bgl_scene_graph_entry_PAPI_10_0	label	byte
BGL_SCENEGRAPH_ENTRY	0, 1, -1, bgl_animation_command_end_PAPI_10_0 - bgl_animation_command_start_PAPI_10_0, bgl_animation_command_start_PAPI_10_0 - bgl_scene_graph_entry_PAPI_10_0
bgl_scene_graph_entry_PAPI_10_1	label	byte
BGL_SCENEGRAPH_ENTRY	1, -1, 2, bgl_animation_command_end_PAPI_10_1 - bgl_animation_command_start_PAPI_10_1, bgl_animation_command_start_PAPI_10_1 - bgl_scene_graph_entry_PAPI_10_1
bgl_scene_graph_entry_PAPI_10_2	label	byte
BGL_SCENEGRAPH_ENTRY	2, -1, 3, bgl_animation_command_end_PAPI_10_2 - bgl_animation_command_start_PAPI_10_2, bgl_animation_command_start_PAPI_10_2 - bgl_scene_graph_entry_PAPI_10_2
bgl_scene_graph_entry_PAPI_10_3	label	byte
BGL_SCENEGRAPH_ENTRY	3, -1, 4, bgl_animation_command_end_PAPI_10_3 - bgl_animation_command_start_PAPI_10_3, bgl_animation_command_start_PAPI_10_3 - bgl_scene_graph_entry_PAPI_10_3
bgl_scene_graph_entry_PAPI_10_4	label	byte
BGL_SCENEGRAPH_ENTRY	4, -1, -1, bgl_animation_command_end_PAPI_10_4 - bgl_animation_command_start_PAPI_10_4, bgl_animation_command_start_PAPI_10_4 - bgl_scene_graph_entry_PAPI_10_4
scene_graph_riff_end_PAPI_10 label word       

attachpoint_riff_start_PAPI_10	label	word
    db  'A','T','T','A'   
    dd  attachpoint_riff_end_PAPI_10 - $ - 4
	dd	4		; Attach point count 
BGL_ATTACHPOINT_ENTRY 1, attachpoint_name_PAPI_10_0
BGL_ATTACHPOINT_ENTRY 2, attachpoint_name_PAPI_10_1
BGL_ATTACHPOINT_ENTRY 3, attachpoint_name_PAPI_10_2
BGL_ATTACHPOINT_ENTRY 4, attachpoint_name_PAPI_10_3
attachpoint_name_PAPI_10_0	label	byte
	db	'P','A','P','I','_','1',0
attachpoint_name_PAPI_10_1	label	byte
	db	'P','A','P','I','_','2',0
attachpoint_name_PAPI_10_2	label	byte
	db	'P','A','P','I','_','3',0
attachpoint_name_PAPI_10_3	label	byte
	db	'P','A','P','I','_','0','5',0
attachpoint_riff_end_PAPI_10 label word       

attached_object_riff_start_PAPI_10	label	word
    db  'A','T','T','O'   
    dd  attached_object_riff_end_PAPI_10 - $ - 4

db	0, 16, 4, 0, 2, 0, 60, 0, 44, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
db	0, 0, 0, 0, 0, 0, 0, 0, 41, 253, 236, 171, 215, 71, 25, 77, 185, 139, 153, 166
db	128, 69, 172, 72, 0, 0, 0, 63, 97, 116, 116, 97, 99, 104, 112, 116, 95, 98, 111, 120
db	120, 49, 50, 0, 1, 16, 4, 0, 0, 16, 4, 0, 2, 0, 60, 0, 44, 0, 0, 0
db	0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 41, 253, 236, 171
db	215, 71, 25, 77, 185, 139, 153, 166, 128, 69, 172, 72, 0, 0, 0, 63, 97, 116, 116, 97
db	99, 104, 112, 116, 95, 98, 111, 120, 120, 49, 53, 0, 1, 16, 4, 0, 0, 16, 4, 0
db	2, 0, 60, 0, 44, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
db	0, 0, 0, 0, 41, 253, 236, 171, 215, 71, 25, 77, 185, 139, 153, 166, 128, 69, 172, 72
db	0, 0, 0, 63, 97, 116, 116, 97, 99, 104, 112, 116, 95, 98, 111, 120, 120, 49, 52, 0
db	1, 16, 4, 0, 0, 16, 4, 0, 2, 0, 60, 0, 44, 0, 0, 0, 0, 0, 0, 0
db	0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 41, 253, 236, 171, 215, 71, 25, 77
db	185, 139, 153, 166, 128, 69, 172, 72, 0, 0, 0, 63, 97, 116, 116, 97, 99, 104, 112, 116
db	95, 98, 111, 120, 120, 49, 51, 0, 1, 16, 4, 0
attached_object_riff_end_PAPI_10 label word
I followed the tutorial line for line, but after a few hours without any progress, I need your help again...



Best Regards

Marc Läderach
 
I could solve the problem, there was something wrong with the gmax-file.
But now I have another problem. The axis are wrong, there are always 4 white lights. But when I pass them, they change to red.

Here's an image:


It's the PAPI for runway 10 in Zurich, the heading is 096 and the angle 3.5°.
Here are the calculations I made:
sin($angle)*32768= temp X/Y
cos($angle)*32768= final Z
4.0°: 2286 / 32688
3.6667°: 2096 / 32701
3.3333°: 1905 / 32713
3.0°: 1715 / 32723

sin(96°)*temp X/Y= final Y
cos(96°)*temp X/Y= final X
4.0°: -239 / 2273
3.6667°: -219 / 2085
3.3333°: -199 / 1895
3.0°: -179 / 1706

And finally the code:
Code:
PAPI_new_test_MasterScale_2 label BGLCODE

    BGL_ZBIAS 1
    SEPARATION_PLANE horizontal, -32588, 0, 3425, 32768
      SEPARATION_PLANE below1, -179, 32723, 1706, 32768
        BGL_LIGHT LIGHT_NAV, -1.592, 0.640, 0.327, 20, 0.60, 0.40, 0FFFFFFFFh, 0.000000, 0.000000, 1.000000 ; source poly num = 25
        BGL_JUMP_32 above1
      below1 label BGLCODE
        BGL_LIGHT LIGHT_NAV, -1.432, 0.640, 0.327, 20, 0.60, 0.40, 0FFFF0000h, 0.000000, 0.000000, 1.000000 ; source poly num = 26
      above1 label BGLCODE
      SEPARATION_PLANE below2, -199, 32713, 1895, 32768
        BGL_LIGHT LIGHT_NAV, -0.597, 0.640, 0.327, 20, 0.60, 0.40, 0FFFFFFFFh, 0.000000, 0.000000, 1.000000 ; source poly num = 39
        BGL_JUMP_32 above2
      below2 label BGLCODE
        BGL_LIGHT LIGHT_NAV, -0.438, 0.640, 0.327, 20, 0.60, 0.40, 0FFFF0000h, 0.000000, 0.000000, 1.000000 ; source poly num = 40
      above2 label BGLCODE
      SEPARATION_PLANE below3, -219, 32701, 2085, 32768
        BGL_LIGHT LIGHT_NAV, 0.402, 0.640, 0.327, 20, 0.60, 0.40, 0FFFFFFFFh, 0.000000, 0.000000, 1.000000 ; source poly num = 53
        BGL_JUMP_32 above3
      below3 label BGLCODE
        BGL_LIGHT LIGHT_NAV, 0.561, 0.640, 0.327, 20, 0.60, 0.40, 0FFFF0000h, 0.000000, 0.000000, 1.000000 ; source poly num = 54
      above3 label BGLCODE
      SEPARATION_PLANE below4, -239, 32688, 2273, 32768
        BGL_LIGHT LIGHT_NAV, 1.406, 0.640, 0.327, 20, 0.60, 0.40, 0FFFFFFFFh, 0.000000, 0.000000, 1.000000 ; source poly num = 79
        BGL_JUMP_32 above4
      below4 label BGLCODE
        BGL_LIGHT LIGHT_NAV, 1.566, 0.640, 0.327, 20, 0.60, 0.40, 0FFFF0000h, 0.000000, 0.000000, 1.000000 ; source poly num = 80
      above4 label BGLCODE
    horizontal label BGLCODE
    BGL_RETURN


bgl_riff_end_PAPI_new_test	label	BGLCODE

Best Regards

Marc Läderach
 
Last edited:

arno

Administrator
Staff member
FSDevConf team
Resource contributor
Hi Marc,

You mixed up in the first part already. The Z component is the sine, not the cosine. And also for the final X and Y I think you have the sine and cosine reversed.
 

arno

Administrator
Staff member
FSDevConf team
Resource contributor
Hi Marc,

No, you are right. I confused the direction of the plane for this kind of check.

Put check your heading, you should remember that the PAPI light is pointing 180 degrees difference from the heading your plane has when approaching.
 
After a few more hours I got it:

Three bgl-light entries were wrong, I just had to change 6 lines of code.
So all six PAPIs are fully working now, thanks for your support!!!! :)


Best Regards

Marc Läderach
 
Hi all,

I did the tut, but have run into a small, but crucial problem: The lights are seen from the oposite side and the lights are reversed, so if you are too low it's white, if you are too high it's red.

Kindly,

Blazer
 
I know most people will enjoy working on this and are grateful for the info but I am not sure I have the time to do it.

Is there an 'object'(?) I can download that gives the PAPI-4 (and/or PAPI-2) a proper boxed up look instead of the floating balls of light that I get when I use ADE to add them to my runway?

Thanks

klem
 
As you are useing ADE, just add a Library Object and look under Airport Objects for PAPI 01.

This is the model only, you still need to add the papi lights to the runway.



David
 
Last edited:
No .asm files

Well, I decided to take on the PAPI project. I have a nice set of 4 boxes and I managed to export them as a single file per the tutorial.

However I did not get any .asm files, only the .mdl. How do I get them please? I can't find anything in the help file to explain that.

klem
PS thanks to everyone on various thread aspects for their help.
 

arno

Administrator
Staff member
FSDevConf team
Resource contributor
Actually the only line needed in the cfg file is:

Code:
[Options]
Keep=1
See this Wiki artile for more information on working with ASM files if you are new to that.
 
Top