• 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 display problems

Messages
14
Country
germany
Hi!
I wanted to make a hangar with doors that open depending from distance.
Now my doors only work partially. They are displayed open and half open but not closed. here is the code:

;-> Animations
; ----------
;

;
IfVarRange( :Anim000 033b 0 49 )
:Anim000




IfVarRange( :Anim001 033b 50 99 ) TransformCall( :part002 -15 0 -14 0 0 0 0 0 0 ) ;Wall 3
TransformCall( :part002 15 0 -14 0 0 0 0 0 0 ) ;Wall 3_02
:Anim001



IfVarRange( :Anim002 033b 100 500 ) TransformCall( :part001 0 0 -14 0 0 0 0 0 0 ) ;Wall 2
:Anim002





Return

;-------
:part000
; cube - Cube 1
Points( 0
-20 0 -14 ; 0
20 0 -14 ; 1
20 0 14 ; 2
-20 0 14 ; 3
-20 20 -14 ; 4
20 20 -14 ; 5
20 20 14 ; 6
-20 20 14 ; 7
)
RGBSColor( EF 0 0 0 )
Poly( 0 0 -32767 -14 3 7 6 2 ) ;Inside back
Poly( 32767 0 0 -20 0 4 7 3 ) ;Inside left
Poly( -32767 0 0 -20 2 6 5 1 ) ;Inside right
Poly( 0 -32767 0 -20 5 6 7 4 ) ;Inside top
Poly( 0 32767 0 0 0 3 2 1 ) ;Inside bottom
Poly( 0 0 32767 14 2 6 7 3 ) ;Back
Poly( -32767 0 0 20 3 7 4 0 ) ;Left
Poly( 32767 0 0 20 1 5 6 2 ) ;Right
Poly( 0 32767 0 20 4 7 6 5 ) ;Top
Poly( 0 -32767 0 0 1 2 3 0 ) ;Bottom
Return


;-------
:part001
; wall - Wall 2
Points( 8
-20 0 0 ; 0
-20 20 0 ; 1
20 20 0 ; 2
20 0 0 ; 3
)
RGBSColor( EF 253 46 47 )
Poly( 0 0 -32767 0 8 9 10 11 ) ;Front
Poly( 0 0 32767 0 11 10 9 8 ) ;Back
Return


;-------
:part002
; wall - Wall 3
Points( 12
-5 0 0 ; 0
-5 20 0 ; 1
5 20 0 ; 2
5 0 0 ; 3
)
RGBSColor( EF 253 46 46 )
Poly( 0 0 -32767 0 12 13 14 15 ) ;Front
Poly( 0 0 32767 0 15 14 13 12 ) ;Back
Return


EndA




Do you know the problem?

Thanks in advance
Hekto
 
Last edited:
Hi again!
I now found the problem.
After the first query that is shown correctly, FS does not continue with the second one.

IfVarRange( :RET1 33b 50 100 )
Jump( :GO1 )
:RET1
Return
:GO1
TransformCall( :part002 0 0 -14 0 0 0 0 0 0 ) ;Wall 2
Return




IfVarRange( :RET0 33b 30 50 )
Jump( :GO0 )
:RET0
Return
:GO0
TransformCall( :part002 -15 0 -14 0 0 0 0 0 0 ) ;Wall 3
TransformCall( :part002 15 0 -14 0 0 0 0 0 0 ) ;Wall 3_02
Return


What is the missing command that makes FS jump to the second query?
Sorry for asking that but im very new to manual scasm editing.
Hope somebody can help me.
Thanks
Hekto
 
Just thought the problem might be in the precedent code (Here the whole code):




;macrodesc t (EOD)
;defaultscale 1
;designshape -5,-4,-5,3,5,3,5,-4
;--------------------------------------------
; Filename: t.api
; Directory: \Programme\EOD\
; Project:
; Designer:
; Date: 2005-06-05
; Update: 2005-06-05
; Credits:
; Macro generated using EOD 2.2.84
; Any commercial distribution or use of this file is prohibited
;--------------------------------------------
; %1 = Latitude
; %2 = Longtitude
; %4 = Not used [RefpointScale=1, ObjectScale=0.25]
; %5 = Rotation
; %6 = Not Used
; %7 = Not Used
; %8 = Not Used
; %9 = Not Used
; %10 = Visibility range
; %11 = Altitude
; %12 = Detail level
; 12 = Radial visibility range (x 1.5)
; %15 = User defined


Area( B %1 %2 22 )
mif( %12 )
IfVarRange( : 0346 %12 5 )
mifend
PerspectiveCall( :pos )
ShadowCall( :pos )
Jump( : )

:pos
mif( %11 )
RefPoint( 3 :End %1 %2 E= %11 V1= %10 V2= 12 )
melse
RefPoint( 7 :End 1 %1 %2 V1= %10 V2= 12 )
mifend
SetScaleX( :End 0 0 14 ) ; Scale=0.25
mif( %5 )
RotatedCall( :Begin 0 0 %5 )
melse
Call( :Begin )
mifend
:End
Return
:Begin

Call( :part000 ) ;Cube 1
;-> Animations
; ----------
;

;
IfVarRange( :RET1 33b 50 100 )
Jump( :GO1 )
:RET1
Return
:GO1
TransformCall( :part002 0 0 -14 0 0 0 0 0 0 ) ;Wall 2
Return




IfVarRange( :RET0 33b 30 50 )
Jump( :GO0 )
:RET0
Return
:GO0
TransformCall( :part002 -15 0 -14 0 0 0 0 0 0 ) ;Wall 3
TransformCall( :part002 15 0 -14 0 0 0 0 0 0 ) ;Wall 3_02
Return









Return

;-------
:part000
; cube - Cube 1
Points( 0
-20 0 -14 ; 0
20 0 -14 ; 1
20 0 14 ; 2
-20 0 14 ; 3
-20 20 -14 ; 4
20 20 -14 ; 5
20 20 14 ; 6
-20 20 14 ; 7
)
RGBSColor( EF 0 0 0 )
Poly( 0 0 -32767 -14 3 7 6 2 ) ;Inside back
Poly( 32767 0 0 -20 0 4 7 3 ) ;Inside left
Poly( -32767 0 0 -20 2 6 5 1 ) ;Inside right
Poly( 0 -32767 0 -20 5 6 7 4 ) ;Inside top
Poly( 0 32767 0 0 0 3 2 1 ) ;Inside bottom
Poly( 0 0 32767 14 2 6 7 3 ) ;Back
Poly( -32767 0 0 20 3 7 4 0 ) ;Left
Poly( 32767 0 0 20 1 5 6 2 ) ;Right
Poly( 0 32767 0 20 4 7 6 5 ) ;Top
Poly( 0 -32767 0 0 1 2 3 0 ) ;Bottom
Return


;-------
:part001
; wall - Wall 2
Points( 8
-20 0 0 ; 0
-20 20 0 ; 1
20 20 0 ; 2
20 0 0 ; 3
)
RGBSColor( EF 26 253 26 )
Poly( 0 0 -32767 0 8 9 10 11 ) ;Front
Poly( 0 0 32767 0 11 10 9 8 ) ;Back
Return


;-------
:part002
; wall - Wall 3
Points( 12
-5 0 0 ; 0
-5 20 0 ; 1
5 20 0 ; 2
5 0 0 ; 3
)
RGBSColor( EF 253 46 46 )
Poly( 0 0 -32767 0 12 13 14 15 ) ;Front
Poly( 0 0 32767 0 15 14 13 12 ) ;Back
Return


EndA
 
Last edited:
Hi Hekto,

I will take a good look at your full code later (too late now :)), but the first code you posted looks correct. If the first code fails, a jump is made to the label and the second condition is checked. The same happens for the other conditions. And if the last two are true, something is drawn.

But as I said, I will take a closer look at the total code later.
 
Hi Hekto,

I now took a good look at your code and the jump labels are set wrong. After the first check is made you always ended up at a Return command, so the second check was never reached. This code should work fine though:

Code:
:Begin

Call( :art000 ) ;Cube 1

;-> Animations
IfVarRange( :RET1 33b 50 100 )
TransformCall( :art002 0 0 -14 0 0 0 0 0 0 ) ;Wall 2
:RET1

IfVarRange( :RET0 33b 30 50 )
TransformCall( :art002 -15 0 -14 0 0 0 0 0 0 ) ;Wall 3
TransformCall( :art002 15 0 -14 0 0 0 0 0 0 ) ;Wall 3_02
:RET0

Return

;-------
:art000
 
You are a real guru, Arno!
Thank you very much!
I just testedyour version and it works qhite fine.
I dont know why i put the returns in there. :banghead:
Greets
hekto
 
Back
Top