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

Conditional Objects

Messages
454
Country
england
I have two objects one is to be display during the day and the other at night. I know it goes something like this:
Code:
IfVarRange( :night 28C 2 4)
CallLibObj( 0 C9B43C4C 1C31CD13 E3F2ADCA 8D7C9BF9 ) ;Day object

:night
CallLibObj( 0 C9B43C4C 1C31CD13 E3F2ADCA 8D7C9BF8 ) ;Night object

:end
Return
EndA
Could someone fill in the missing parts for me.

Cheers
David
 
Hi David,

Code:
IfVarRange( :night 28C 2 4)
CallLibObj( 0 C9B43C4C 1C31CD13 E3F2ADCA 8D7C9BF9 ) ;Day object
Jump32( :nonight )

:night
CallLibObj( 0 C9B43C4C 1C31CD13 E3F2ADCA 8D7C9BF8 ) ;Night object

:nonight

:end
Return
EndA
 
Arno,
Thanks for the reply, unfortunatly it doesn't work. If you have anymore suggestions they would be most appreciated. I'm tying to make a custom beacon by placing them into a library file and calling it from an API.

Best of luck in your new job.

David
 
Hi David,

Can you post the total API code in that case? I guess the error must be somewhere else then.
 
Hi Arno,

Due to a change in my real life working schedule I had to put everything FS on the back burner.

Anyway the API was created with Library Creater XML.

Code:
; API created with XML2API
; to get the same size as when placed with XML scale 1.0
; use scale 0.5 when placing the API
mif(0)
Area( 5 %1 %2 1 )
RotatedCall( :symbol 0 0 %5 )
Jump( :endsymbol )
:symbol
RefPoint( 7 : 0.1 %1 %2 )
Points( 0
-7 0 -2
-7 0 2
7 0 2
7 0 -2
0 0 0
)
Poly( a 0 1 2 3 )
Poly( a 0 4 3 )
Return
:endsymbol
EndA
mifend

Area( 5 %1 %2 22 )
PerspectiveCall( :obj )
ShadowCall( :obj )
jump( : )
:obj
mif( %11  )
  RefPoint( 2 :end %4 %1 %2 E= %11 v1= %10 %13 %14 )
melse
  RefPoint( 7 :end %4 %1 %2 v1= %10 %13 %14 )
mifend
RotatedCall( :rot 0 0 %5 )
Return
:rot

IfVarRange( :night 28C 2 4)
CallLibObj( 0 C9B43C4C 1C31CD13 E3F2ADCA 8D7C9BF8 ) ;Night object
Jump32( :nonight )

:nonight
CallLibObj( 0 C9B43C4C 1C31CD13 E3F2ADCA 8D7C9BFA ) ;Day object

:end
Return
EndA

Cheers
David
 
Hi David,

The labels where to jump to got mixed up. Try it like this:

Code:
; API created with XML2API
; to get the same size as when placed with XML scale 1.0
; use scale 0.5 when placing the API
mif(0)
Area( 5 %1 %2 1 )
RotatedCall( :symbol 0 0 %5 )
Jump( :endsymbol )
:symbol
RefPoint( 7 : 0.1 %1 %2 )
Points( 0
-7 0 -2
-7 0 2
7 0 2
7 0 -2
0 0 0
)
Poly( a 0 1 2 3 )
Poly( a 0 4 3 )
Return
:endsymbol
EndA
mifend

Area( 5 %1 %2 22 )
PerspectiveCall( :obj )
ShadowCall( :obj )
jump( : )
:obj
mif( %11  )
  RefPoint( 2 :end %4 %1 %2 E= %11 v1= %10 %13 %14 )
melse
  RefPoint( 7 :end %4 %1 %2 v1= %10 %13 %14 )
mifend
RotatedCall( :rot 0 0 %5 )
Return
:rot

IfVarRange( :nonight 28C 2 4)
CallLibObj( 0 C9B43C4C 1C31CD13 E3F2ADCA 8D7C9BF8 ) ;Night object
Jump32( :endnight )
:nonight
CallLibObj( 0 C9B43C4C 1C31CD13 E3F2ADCA 8D7C9BFA ) ;Day object
:endnight

:end
Return
EndA
 
Conditional animation

Hy Arno

A bit off topic i ask your pardon

i'd like to add conditiona animations to a couple of my PLANE could you help out?


cheers


luca davide
 
Hi Luca,

If you want to add a condition to some polygons only, then you will have to find them in the source code first. After that you can place the IfVarRange command and the label to jump to, around these lines of code.
 
animations

Hy Arno

I'll try to explain better.

i have a plane part (foe example and antenna) and i want to animate it only if certain conctios apply.

Now i make 2 parts 1 still and one animated the first disappear when condition is true the second appear.

I'd like to have the part still or animated without duplicating it

i hope is a bit clearer
cheers

luca davide
 
Hi Luca,

For animated parts that would work the same. You would still have to put the conditional checks around the static and animated parts.

Which tool do you use to make the object?
 
Conditional parts

hy Arno

I use FSDS V 2.24
it quite easy to add conditions with it so i am eager to learn


cheers
 
Hi Luca,

I don't know if you can condition animations from FSDS yourself, I think you will have to tweak the SCASM code for that manual. The technique would be about the same as described in my conditional animation tutorial for GMax/ASM files.
 
Back
Top