Conditional light display

#3
Thanks for advice but I dont know where I put this code

Code:
IfVarRange( :nolight 28C 2 4 )



:nolight
I use this code

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

; 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, 0FFABABABh, 0.000000, 0.000000, 0.000000 ; Color is AB AB AB (rgb)
    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
 

arno

Administrator
Staff member
FSDevConf team
Resource contributor
#4
Just put it around your BGL_LIGHT command. So the IFIN1 command before it and the label behind it.
 
#5
I try this but sorry it did not work. bglc_9 compiler did not make any mdl.

Code:
LIGHT_NAV_beta_MasterScale_1 label BGLCODE
    IfVarRange( :nolight 28C 2 4 )
    BGL_LIGHT  LIGHT_NAV, 0.0, 0.0, 0.0, 0, 0.0, 0.0, 0FFABABABh, 0.000000, 0.000000, 0.000000 ; Color is AB AB AB (rgb)
    BGL_RETURN
    :nolight
 
#7
I'm sorry but I still not understand where I put this code because gmax 2004 sdk did not make any *.asm file

Code:
IFIN1, labelname, tod, 2, 4 

labelname label word
 

arno

Administrator
Staff member
FSDevConf team
Resource contributor
#8
skv said:
I'm sorry but I still not understand where I put this code because gmax 2004 sdk did not make any *.asm file
You should put it in the same place as the SCASM commands before (in the code you posted), so around the BGL_LIGHT command. It is BGLC code.
 
#9
arno said:
You should put it in the same place as the SCASM commands before (in the code you posted), so around the BGL_LIGHT command. It is BGLC code.
:banghead:

I take that "big code" and modify this middle of code

Code:
LIGHT_NAV_beta_MasterScale_1 label BGLCODE
    IFIN1, labelname, tod, 2, 4
    BGL_LIGHT LIGHT_NAV, 0.0, 0.0, 0.0, 0, 0.0, 0.0, 0FFABABABh, 0.000000, 0.000000, 0.000000 ; Color is AB AB AB (rgb)
    BGL_RETURN
    labelname label word
Then I save that navlight.asm name. Then I take it and drop top of bglc.exe file and it should make navlight.bgl but no nothing happen. If I take "IFIN1, labelname, tod, 2, 4" and "labelname label word" away it works.

I give up. Thanks for help
 

arno

Administrator
Staff member
FSDevConf team
Resource contributor
#10
Try this:

Code:
IFIN1 nolight, tod, 2, 4
BGL_LIGHT LIGHT_NAV, 0.0, 0.0, 0.0, 0, 0.0, 0.0, 0FFABABABh, 0.000000, 0.000000, 0.000000 ; Color is AB AB AB (rgb)
nolight label word
BGL_RETURN
You had a comma in the wrong place and the label should be before the BGL_RETURN command.

If you compile the ASM file from the command prompt, you would be able to see any errors that occur during the compilation.

One last note, you should rename the BGL file you get to MDL, as it is a MDL object that you should place with BGLComp.
 

arno

Administrator
Staff member
FSDevConf team
Resource contributor
#12
skv said:
It seems that this thread last hint is wrong. There is same comma.
Thanks, fixed. Two lines above the example it showed correct, without the comma :).
 
Top