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

Onesided lights off during day time?

Messages
30
Country
germany
Hi all,

I'm trying to create onesided lights for my runways that are off during the day. I want to place them using EZScenery. This one is meant to be visible only if you approach with a heading of 231. The "onesidedness" works ok but it's visible at all times of the day. Interesting enough, when I first place it it is indeed off during the day but when I reload FS it stays on all the time.

Anyway, here is my asm-code. I'd really appreciate your help.

Code:
  db  'R','I','F','F'				; RIFF file identifier
    dd  bgl_data_end - $ - 4		    ; size of RIFF data
    db  'M','D','L','9'				; file identifire (FS9 model)

    db  'M','D','L','H'
    dd  visual_model_header_end - $ - 4
    dd  visual_model_header_end - $ - 4
    dd  0
    dd  0
    dd  2
    dd  0
    dd  0
    dd  156
    db  'F','S','8','0'
    dd  2304
visual_model_header_end  label dword

    db  'I','S','F','T'   
    dd  ver_end - $ - 4  
    db  "BGLC_9",0
ver_end label word       

bounding_box_riff_start	label	word
    db  'B','B','O','X'   
    dd  bounding_box_riff_end - $ - 4
    real4  -100.000, -100.000, -100.000  
    real4  100.000, 100.000, 100.000  
bounding_box_riff_end label word       


model_outside    label    BGLCODE
model_shadow label BGLCODE
model_inside  label    BGLCODE
exterior_riff_start_0 label BGLCODE
    db  'E','X','T','E'   
    dd  exterior_riff_end_0 - $ - 4
LOD_0L    label    BGLCODE

LIGHT_NAV_beta_top label BGLCODE

bgl_riff_start_LIGHT_NAV_beta	label	BGLCODE
    db	'B','G','L',' '
    dd	bgl_riff_end_LIGHT_NAV_beta - $ - 4
LOD_0_LIGHT_NAV_beta	label	BGLCODE

IFIN1 nolights, 028Ch, 2, 4

SEPARATION_PLANE wrong_direction, 20620, 0, 25463, 32767

; Alpha
LIGHT_NAV_beta_Alpha label BGLCODE
    BGL_CALL_32 LIGHT_NAV_beta_MasterScale_1        ; Node 1 - MasterScale
    BGL_END
    BGL_RETURN

LIGHT_NAV_beta_MasterScale_1 label BGLCODE

    BGL_LIGHT LIGHT_NAV, 0.0, 0.0, 0.0, 0, 0.0, 0.0, 0FFB60000h, 0.000000, 0.000000, 0.000000 ; Color is AB AB AB (rgb)
    BGL_RETURN

wrong_direction label word

bgl_riff_end_LIGHT_NAV_beta	label	BGLCODE
exterior_riff_end_0	label	BGLCODE


shadow_riff_start_0 label BGLCODE
  db 'S','H','A','D' 
  dd shadow_riff_end_0 - $ - 4
SHADOW_0L label BGLCODE

Kill_Shadow_top label BGLCODE
bgl_riff_start_Kill_Shadow label BGLCODE
  db 'B','G','L',' '
  dd bgl_riff_end_Kill_Shadow - $ - 4

LOD_0_Kill_Shadow label BGLCODE
  BGL_END
  BGL_RETURN

bgl_riff_end_Kill_Shadow label BGLCODE
shadow_riff_end_0 label BGLCODE

nolights label word

bgl_data_end label     BGLCODE

Thanks,

Matthias
 
Hi Matthias,

Let me say I am a little surprised this code did not crash FS completely :D. You have placed some of the destinations labels outside of the RIFF section you did the check in. This is not how it should work. I would try the code like this:

Code:
db  'R','I','F','F'				; RIFF file identifier
    dd  bgl_data_end - $ - 4		    ; size of RIFF data
    db  'M','D','L','9'				; file identifire (FS9 model)

    db  'M','D','L','H'
    dd  visual_model_header_end - $ - 4
    dd  visual_model_header_end - $ - 4
    dd  0
    dd  0
    dd  2
    dd  0
    dd  0
    dd  156
    db  'F','S','8','0'
    dd  2304
visual_model_header_end  label dword

    db  'I','S','F','T'   
    dd  ver_end - $ - 4  
    db  "BGLC_9",0
ver_end label word       

bounding_box_riff_start	label	word
    db  'B','B','O','X'   
    dd  bounding_box_riff_end - $ - 4
    real4  -100.000, -100.000, -100.000  
    real4  100.000, 100.000, 100.000  
bounding_box_riff_end label word       


model_outside    label    BGLCODE
model_shadow label BGLCODE
model_inside  label    BGLCODE
exterior_riff_start_0 label BGLCODE
    db  'E','X','T','E'   
    dd  exterior_riff_end_0 - $ - 4
LOD_0L    label    BGLCODE

LIGHT_NAV_beta_top label BGLCODE

bgl_riff_start_LIGHT_NAV_beta	label	BGLCODE
    db	'B','G','L',' '
    dd	bgl_riff_end_LIGHT_NAV_beta - $ - 4
LOD_0_LIGHT_NAV_beta	label	BGLCODE

IFIN1 nolights, 028Ch, 2, 4

SEPARATION_PLANE wrong_direction, 20620, 0, 25463, 32767

    BGL_LIGHT LIGHT_NAV, 0.0, 0.0, 0.0, 0, 0.0, 0.0, 0FFB60000h, 0.000000, 0.000000, 0.000000 ; Color is AB AB AB (rgb)

    wrong_direction label word
    nolights label word
    BGL_END
    BGL_RETURN

bgl_riff_end_LIGHT_NAV_beta	label	BGLCODE
exterior_riff_end_0	label	BGLCODE


shadow_riff_start_0 label BGLCODE
  db 'S','H','A','D' 
  dd shadow_riff_end_0 - $ - 4
SHADOW_0L label BGLCODE

Kill_Shadow_top label BGLCODE
bgl_riff_start_Kill_Shadow label BGLCODE
  db 'B','G','L',' '
  dd bgl_riff_end_Kill_Shadow - $ - 4

LOD_0_Kill_Shadow label BGLCODE
  BGL_END
  BGL_RETURN

bgl_riff_end_Kill_Shadow label BGLCODE
shadow_riff_end_0 label BGLCODE

bgl_data_end label     BGLCODE
 
Thanks so much, Arno! Now it works.

I wish someone could give me an "asm-tweaking for dummies" sort of introduction as I only copy and paste what I found on this site not really knowing what I'm doing. I.e. so far I wasn't aware of a "riff-section".

Once again thank you,

Matthias
 
Hi Matthias,

Glad to hear it worked.

I have thought about making a ASM tweaking tutorial, but I never really found the time for it. Now that ASM tweaking is no longer of using when using the FsX tools I am not sure if it would still be worth to put much time in it.

But if course forums like this should be able to help others :).
 
Back
Top