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

Day Night Switching from an API

Messages
454
Country
england
I've been trying to adapt an api macro to display a different model at night. The problem I'm having is I cannot get the model to switch.

Code:
IfVarAnd( :night 28c 6 )
callLibobj( 0 F6E365F2 4C5E34B1 BBE759B4 6E7556B3 )
Jump( :further )
:night
callLibobj( 0 CCE9F4ED 43B7A7AC 963EAFA6 812A1CEC )
:further

  Call( :Lamps )
  VectorJump( :West 32767 0    0  0 )
  VectorJump( :SouthEast 0   0   32767  0 )
:NorthEast

  Return
:SouthEast

  Return
:West
  VectorJump( :SouthWest 0  0  32767 0 )
:NorthWest

  Return
:SouthWest

  Return

:Lamps

  IfVarAnd( :EndofLamp0 28c 6 )
  RGBLcolor( BF  0 0 245 ) 
  Dot( 0 2 0 )
:EndofLamp0
 Return


Regards
David
 

arno

Administrator
Staff member
FSDevConf team
Resource contributor
Messages
30,647
Country
netherlands
Hi David,

That code looks fine (although the VectorJump commands do nothing and can be deleted).

Maybe you can try the IfVarRange command instead of the IfVarAnd command? That's the only thing I would do different if I made the code myself.
 

Luis_Sá

Resource contributor
Messages
326
Country
portugal
Hello,

This is what I used to do:

Code:
;
IfVarAnd ( :isnight 28C FFFE )
:isday
; put here your model for day
Return 

:isnight
; put here your model for night
Return

Regards,

Luis
 
Messages
454
Country
england
Thanks Luis,

Sadly even this is not working for me.

Basically I have one model which has a highly detailed texture on it for day time, and another for night time that uses a gmax transparency on it to show the light within a glass bowl.

Regards
David
 

arno

Administrator
Staff member
FSDevConf team
Resource contributor
Messages
30,647
Country
netherlands
Hi David,

That is weird. I guess I would have to try it myself to be able to give a better answer.
 
Messages
611
Country
switzerland
I tried this and it seems not to work!
Once the first LibObj has been called and loaded by FS, it remains in the scene no matter what you do!
The switching works (tested it with bgl lights), but the library object doesn't change. Very weird indeed!
 
Top