Rotate to User and Conditional Display Tweaks

#1
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
#2
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
 
#3
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

arno

Administrator
Staff member
FSDevConf team
Resource contributor
#4
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.
 
#5
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
#7
Hi Greg,

Glad to hear you fixed it. I did not have time yet to tweak and test it for you.
 
#8
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