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

Rotate to User and Conditional Display Tweaks

Messages
272
Country
ca-saskatchewan
ASM tweaking is new for me and as much as I have tried to follow the tutorials and various forum threads I just can't seem to figure what I am doing wrong -- so I am appealing for help!

I am attempting to construct a taxiway light usinga BGL light LIGHT_NAV for application to a FS9 scenery I am working on. The model is a simple plane with a DTX 3 texture of the lamp applied with a black background, which is rendered invisible using alpha channel. Using Tweaker II I can get the light model to rotate to user and for the LIGHT_NAV to shine properly. I don't want the light to display during day but as far as I know the Tweaker II is unable to set this condition to the LIGHT_NAV apart from the other part of the model. So that lead me to some self education on tweaking the ASM files so the condition could be set just to the LIGHT_Nav part of the model. This is the part where despite earnest effort I just can't get the thing to work. Hence this appeal to those of you who are experts at this.

These are the bits I attempted to modify in my ASM_0 file.

bgl_riff_start_CYVC_Taxi_BL label BGLCODE
db 'B','G','L',' '
dd bgl_riff_end_CYVC_Taxi_BL - $ - 4
LOD_0_CYVC_Taxi_BL label BGLCODE

; NonAlpha
CYVC_Taxi_BL_NonAlpha label BGLCODE
SPRITE_VICALL CYVC_Taxi_BL_MasterScale_1, 0, 0, 0, 0, 0, 0, 0, 1, 0
BGL_END
BGL_RETURN

; Alpha
CYVC_Taxi_BL_Alpha label BGLCODE
SPRITE_VICALL CYVC_Taxi_BL_MasterScale_2, 0, 0, 0, 0, 0, 0, 0, 1, 0
BGL_END
BGL_RETURN


CYVC_Taxi_BL_MasterScale_1 label BGLCODE
MATERIAL 0,0 ; <255,255,255,255> TAXI_LIGHT_BLUE.BMP;TAXI_LIGHT_BLUE_LM.BMP;;
DRAW_TRI_BEGIN 0, 4
DRAW_TRI 2, 0, 3 ; poly=2 part=1 (double sided)
DRAW_TRI 2, 3, 0 ; poly=2 part=1
DRAW_TRI 1, 3, 0 ; poly=1 part=1 (double sided)
DRAW_TRI 1, 0, 3 ; poly=1 part=1
DRAW_TRI_END
BGL_RETURN


CYVC_Taxi_BL_MasterScale_2 label BGLCODE

IFIN1 nolight, tod, 2, 4
BGL_LIGHT LIGHT_NAV, 0.011, 0.388, -0.013, 20, 0.60, 0.40, 0FF2C2CDFh, 0.000000, 0.000000, 1.000000 ; source poly num = 3
nolight label WORD
BGL_RETURN


bgl_riff_end_CYVC_Taxi_BL label BGLCODE


I feel slightly foolish for not being able to figure this out for myself, given the wealth of information but I have admit failure and throw in the towel. Can some one let me know what I am doing wrong and set me straight.

Greg Putz
Regina, Saskatchewan
Canada
 

arno

Administrator
Staff member
FSDevConf team
Resource contributor
Messages
32,883
Country
netherlands
Hi Greg,

You were almost there. I don't know how your original code looked, but I would try it like this:

Code:
bgl_riff_start_CYVC_Taxi_BL label BGLCODE
db 'B','G','L',' '
dd bgl_riff_end_CYVC_Taxi_BL - $ - 4
LOD_0_CYVC_Taxi_BL label BGLCODE

CYVC_Taxi_BL_NonAlpha label BGLCODE
SPRITE_VICALL CYVC_Taxi_BL_MasterScale_1, 0, 0, 0, 0, 0, 0, 0, 1, 0
BGL_END
BGL_RETURN

CYVC_Taxi_BL_MasterScale_1 label BGLCODE
MATERIAL 0,0 ; <255,255,255,255> TAXI_LIGHT_BLUE.BMP;TAXI_LIGHT_BLUE_LM.BMP;;
DRAW_TRI_BEGIN 0, 4
DRAW_TRI 2, 0, 3 ; poly=2 part=1 (double sided)
DRAW_TRI 2, 3, 0 ; poly=2 part=1
DRAW_TRI 1, 3, 0 ; poly=1 part=1 (double sided)
DRAW_TRI 1, 0, 3 ; poly=1 part=1
DRAW_TRI_END

IFIN1 nolight, tod, 2, 4
BGL_LIGHT LIGHT_NAV, 0.011, 0.388, -0.013, 20, 0.60, 0.40, 0FF2C2CDFh, 0.000000, 0.000000, 1.000000 ; source poly num = 3
nolight label WORD
BGL_RETURN

bgl_riff_end_CYVC_Taxi_BL label BGLCODE
 
Messages
272
Country
ca-saskatchewan
Hi Arno

Thanks for your suggestion. I tried the script you provided but unfortunately no joy. I get my model but it neither rotates to user and the BGL LIGHT_NAV does not show up at all. I am attaching the original asm files so you can see how the original code looks.

Greg
 

Attachments

  • CYVC_Taxi_BL_0.asm
    4.1 KB · Views: 468
  • CYVC_Taxi_BL.asm
    2.4 KB · Views: 446

arno

Administrator
Staff member
FSDevConf team
Resource contributor
Messages
32,883
Country
netherlands
Hi,

Please be aware that your polygon must be facing to the negative Y axis direction for it to work with the rotation. If it is facing differently you are quite likely looking to the back or side of it all the time.

For the light, it does not show at night anymore? With this code it should.
 
Messages
272
Country
ca-saskatchewan
Hi Arno,

I checked and the plane is properly faced. And, the light does not show up at all -- at night or at any time (even though we are trying to make it appear only at night). The odd thing is that when I tweak the model using your Tweaker II it does rotate properly and the light shows up nicely, just all the time -- not at night only, which is the effect I am trying to achieve. Perhaps my problem is with recompiling the asm to mdl?? I am using your CompileHelper using the BGLC_9, which does give me a mdl after tweaking -- mind you one that does not work. I am putting the mdl into a library and then placing with EZ-Scenery.

If it is not too much trouble would you mind properly tweaking the asm file I posted and compiling for me. I realize you must get hundreds of requests like this so don't worry if it is too much of a nuisance.

cheers

Greg
 

arno

Administrator
Staff member
FSDevConf team
Resource contributor
Messages
32,883
Country
netherlands
Hi Greg,

Glad to hear you fixed it. I did not have time yet to tweak and test it for you.
 
Messages
272
Country
ca-saskatchewan
I know you are busy answering many questions everyday. Just knowing you are around to put rank amateurs like me in the right direction is comforting!

It was a good challenge and solving it myself gave me a lot of self satisfaction.

Cheers

Greg
 
Top