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

FSXA pilot activated lighting problem

Messages
10
Country
germany
Hi,


I'm working on a pilot activated lighting which should switch off after a fixed period of time.
But the light stays on all the time, which it shouldn't.The code is based on the wiki.


I checked the code pretty much times but actually it's not working.

I would say the problem is the counter itself it doesn't count up so the target which is checked by IFIN1 is never reached.
I don't have a clue where the fault is in detail located. It's getting so frustrating so I decided to ask you guys.



thank you very much in advance :)


P.S.
if you need the asm or asm_0 file just let me know



Trinity
Code:
test_MasterScale_1 label BGLCODE
    BGL_FTAG "MasterUnitConve", 0.00               ; Node 2

    ; Node 2 - MasterUnitConversion transform:

     BGL_SET_MATRIX_INDIRECT    1
    BGL_FTAG "RotateAroundX", 0.00               ; Node 3

    ; Node 3 - RotateAroundX transform:

     BGL_SET_MATRIX_INDIRECT    2
    BGL_FTAG "LIGHT_NAV", 0.00               ; Node 4

    ; Node 4 - LIGHT_NAV transform:

     BGL_SET_MATRIX_INDIRECT    3

     


test_MasterScale_2 label BGLCODE

BGL_JUMP_32 skiptables

light_table_localvars label word
   dw  0  ; switch
   dw  0  ; flag
   dw  0  ; counter

light_table_addone label word
   dw  2
   dw  0,1,999,1000

skiptables label BGLCODE



LOCAL_BASE_32 light_table_localvars

VAR_BASE_32 VAR_BASE_GLOBAL

IFIN1 timelights, 07C0h, 1400h, 1400h    ;  NAV1 on 114.0
VAR_BASE_32 VAR_BASE_LOCAL
SETWRD 0h, 1                    ; turn the light switch on
SETWRD 2h, 0                    ; reset the flag
SETWRD 4h, 0                    ; reset the counter
BGL_JUMP_32 lightson
timelights label BGLCODE


LOCAL_BASE_32 light_table_localvars
IFIN1 nolights, 0h, 1, 1        ; check the light switch
VAR_BASE_OVERRIDE VAR_BASE_GLOBAL ; switch to the local variable space for one command only
IFMSK holdlights, 05FCh, 0010h  ; add one to the count every 1.78 seconds
IFIN1 skipcount, 2h, 0, 0       ; flag skips the counter until tick18 completes cycle
BGL_INTERPOLATE VAR_BASE_LOCAL,4h,\
                VAR_BASE_LOCAL,4h,\
                VAR_BASE_LOCAL, (offset light_table_addone - light_table_localvars)
SETWRD 2h, 1

skipcount label BGLCODE
IFIN1 lightson, 4h, 80, 1000   ; should count to 80
SETWRD 0h, 0                    ; turn the switch off
SETWRD 2h, 0                    ; reset the flag
SETWRD 4h, 0                   ; reset the counter
BGL_JUMP_32 nolights

holdlights label BGLCODE
SETWRD 2h, 0                    ; reset the flag

lightson label BGLCODE

VAR_BASE_32 VAR_BASE_GLOBAL

BGL_LIGHT LIGHT_NAV, 10.0, 0.5, 0.0, 40, 0.60, 0.40, 0FFFFFFFFh, 0.0, 0.0, 1.0

nolights label BGLCODE

BGL_RETURN

bgl_riff_end_test    label    BGLCODE
 
Back
Top