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

FS2004 XML animation script

Messages
246
Country
southafrica
What is wrong with this script?


Code:
 <part>
      <name>tankanimate01</name>
       <AnimLength>100</AnimLength>
      <animation>
         <parameter>
            <code>
if{(A:FUEL TANK EXTERNAL2 QUANTITY, gallons) 3  &gt; }  els{ 0 }
			</code>
				<lag>50</lag>
         </parameter>
      </animation>
   </part>

What I want to do is to animate my droptank to fall. so this tiny part need to animate from 0 to 100 once the external tank reaches 3 gallons. The droptank is attached to this tiny part, then I use another script that hide the tank once it reached 2 gallons. this way you can see the tank fall, and is hidden after a few sec's.
 
That script really won't do anything - the format of an if statement is that the expression to evaluate goes before the if, and the two possible results afterwards:

(L:Something, bool) if{ (result for true) } els{ }

Something like this:

3 (A:FUEL TANK EXTERNAL2 QUANTITY, gallons) &gt; if{ 100 } els{ 0 }

Animate it so that keyframe 0 is in the attached position, then 100 is fully fell away. Adjust the lag value to control how long it takes to fall.
 
That script really won't do anything - the format of an if statement is that the expression to evaluate goes before the if, and the two possible results afterwards:

(L:Something, bool) if{ (result for true) } els{ }

Something like this:

3 (A:FUEL TANK EXTERNAL2 QUANTITY, gallons) &gt; if{ 100 } els{ 0 }

Animate it so that keyframe 0 is in the attached position, then 100 is fully fell away. Adjust the lag value to control how long it takes to fall.

The only problem with the above is that "bool" is binary: 1 or 0
To use correctly, the units specified should be "enum" or "number." :cool:
 
Learning ......again

what does the * and the 2 0 1 1 4 mean in the following?

Code:
   <code>2 0 1 1 4 (A:FUEL TANK SELECTOR:1, enum) case 25 *</code>
 
The star (*) is the multiplication operator, as is explained in the SDK... :D

What it does in this statement is take the returned value of the case (0, 1, or 2) and multiply it by 25.

This is done so that the animation will be scaled to match the keyframes used by the object in the model:

0 * 25 = frame 0
1 * 25 = frame 25
2 * 25 = frame 50
 
Thank you very much! I guess I have to spend more time reading the SDK's and not just jump into something :)
 
Back
Top