1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Timed visibility parts (yes/no)

Discussion in 'Modeling' started by Xpand, 25 Feb 2011.

  1. Xpand

    Xpand

    Joined:
    10 Aug 2008
    Messages:
    549
    Country:
    portugal
    Hi!
    I have these hexagonal screens:
    glass.JPG

    I wanted to make them appear one by one in a timed sequence... The only problem is the number of objects that are going to be created by detaching the hexagons... The good thing is that I'll only need a code for the animation...
    I've thought of another way: visibility parts.
    Making groups of hexagons appear in a timed sequence... But I don't know if I can make only one code or several with time delays.
    So my doubt is: what's better: a huge amount of objects or numerous scripts?
    Ah, and how can I add a time delay to a script?
     
  2. Au-MaV

    Au-MaV

    Joined:
    9 Nov 2006
    Messages:
    520
    Country:
    australia
    Yes its doable :) as to the best method I have no Idea
    Wozza
     
    Last edited: 26 Feb 2011
  3. Flusirainer

    Flusirainer

    Joined:
    22 Mar 2010
    Messages:
    211
    Country:
    germany
    About an EXIT OPEN sequence?
    In the aircraft.cfg you regulates the duration.

    [exits]
    number_of_exits = 2
    exit_rate.0 = 0.4 ;Percent per second
    exit_rate.1 = 0.4 ;Percent per second

    The smaller the value, the longer the time (1/Value = time in secounds).


    (FS9)
    Code:
    <part>
    	<name>part1</name>
    	<visible_in_range>
    		<parameter>
    			<sim>
    				<variable>EXIT2 Open</variable>
    				<units>percent</units>
    			</sim>
    		</parameter>
    		<minvalue>1</minvalue>
            </visible_in_range>
      
    </part>
    
    <part>
    	<name>part2</name>
    	<visible_in_range>
    		<parameter>
    			<sim>
    				<variable>EXIT2 OPEN</variable>
    				<units>percent</units>
    			</sim>
    		</parameter>
    		<minvalue>2</minvalue>
            </visible_in_range>
      
    </part>
    
    <part>
    	<name>part3</name>
    	<visible_in_range>
    		<parameter>
    			<sim>
    				<variable>EXIT2 OPEN</variable>
    				<units>percent</units>
    			</sim>
    		</parameter>
    		<minvalue>3</minvalue>
            </visible_in_range>
      
    </part>
    
    <part>
    	<name>part4</name>
    	<visible_in_range>
    		<parameter>
    			<sim>
    				<variable>EXIT2 OPEN</variable>
    				<units>percent</units>
    			</sim>
    		</parameter>
    		<minvalue>4</minvalue>
            </visible_in_range>
      
    </part>
    
    <part>
    	<name>part5</name>
    	<visible_in_range>
    		<parameter>
    			<sim>
    				<variable>EXIT2 OPEN</variable>
    				<units>percent</units>
    			</sim>
    		</parameter>
    		<minvalue>5</minvalue>
            </visible_in_range>
      
    </part>
    etc

    That ought to work anyway.
     
    Last edited: 26 Feb 2011
  4. Xpand

    Xpand

    Joined:
    10 Aug 2008
    Messages:
    549
    Country:
    portugal
    Well, if I was to use the canopy code I just had to animate the parts myself by sequence (they have a see-through side, so I just had to flip them). I wouldn't need so many codes, but the number of parts would make the plane really "heavy"...
    My problem is that I'd like a single visibility code to make several parts appear by sequence. Can't I use keyframes to animate visibility?

    Anyway, I'm going to try that, thanks!
     
  5. Au-MaV

    Au-MaV

    Joined:
    9 Nov 2006
    Messages:
    520
    Country:
    australia
    Hi
    I would probable do it this way :) that's not saying its the right way ;)
    Use an L:var for the timer and control in a 2d xml gauge (could be 3d if you wanted to hide it).......
    Code:
    <Gauge Name="toc the tic" Version="1.0">
     <Update Frequency="6"/>
    <Element>
        <Select>
    	<Value>(L:trigger_switch_name,number) 1 ==  if{ (L:timer,keyframe) 1 + 1024 min (&gt;L:timer,keframe) } }
    	</Value>
        </Select>
     </Element>
    </Gauge>
    
    This is a very simple time function, max kf is 1024 in fs but can be set for any number of keyframes/parts up to 1024, the 1 + is the amount of kf added per cycle of the gauge, so that plus the <Update Frequency="#"/> can be modded to speed up/slow down the animation...down side it wont pause with the sim,this could be fixed with a bit more code ...

    Then each part would have vis code attached to it, this is where the fun bit starts :)
    Code:
    <PartInfo>
        <Name>Vis_part_one</Name>
        <Visibility>
          <Parameter>
            <Code>
             1 1024 (L:timer,keyframe) rng if{ 1 } els{ 0 } 
            </Code>
          </Parameter>
        </Visibility>
    </PartInfo>
    <PartInfo>
        <Name>Vis_part_two</Name>
        <Visibility>
          <Parameter>
            <Code>
             2 1024 (L:timer,keyframe) rng if{ 1 } els{ 0 } 
            </Code>
          </Parameter>
        </Visibility>
    </PartInfo>
    <PartInfo>
        <Name>Vis_part_thre</Name>
        <Visibility>
          <Parameter>
            <Code>
             3 1024 (L:timer,keyframe) rng if{ 1 } els{ 0 } 
            </Code>
          </Parameter>
        </Visibility>
    </PartInfo>
    and so forth to max of 1024 
    
    the above will make the part "not show" on aircraft load, but show up a part at a time when (L:trigger_switch_name,number) = 1
    if you want the reverse animation just reverse if and else statements.
    (could be typos in the above and Ive never tried it on a large scale)
    Cheers
    Wozza
     
  6. lionheart

    lionheart

    Joined:
    24 Oct 2005
    Messages:
    8,177
    Country:
    us-arizona
    XPand,


    Here is one I have. This causes a prop cover set to appear over the 'still' prop after shut down has occurred, and a certain amount of time has passed.

    The Gmax animation is the first block of code. The second code is for your planes panel file, and is a gauge XML code.

    Now, you could create say 20 or 50 parts, each with a unique name, and then stack their ID's in the panel gauge code block to turn on at a certain point for each part.

    Then create all the part codes for Gmax animation(Viz) code blocks, each with their own title, such as 'xpand_hexagon_five_01' 'xpand_hexagon_nine_01' 'xpand_hexagon_twentytwo_01' etc....

    Then, you could run the timer based on an A: factor and or timer like exit opening, then wait 20 seconds, and then bing, bing, bing, the tiles start appearing, disappearing, etc. I think you want yours to show up one at a time, so each one would be timed differently, adding 1 or 2 or 5 seconds to each one. So part one appears in 5 seconds, then part two in 7 seconds, then part three in 9 seconds, etc..



    Code;

    Prop animation / viz code in Gmax parts list

    Code:
    <part> 
     <name>lhc_prop_cover</name>
      <visible_in_range>
       <parameter>
        <code>(L:lhc_prop_cover,enum) 1 ==</code>
       </parameter>
        <minvalue>1</minvalue>
       </visible_in_range>
    </part>


    Gauge code XML for hidden gauge (timer appearance command module?)

    Code:
    <Gauge Name="prop cover" Version="1.0">
     <Update Frequency="6"/>
    
    <Element>
        <Select>
          <Value>(A:SIM ON GROUND, bool) 1 == (A:General eng rpm:1,RPM) 0 == &amp;&amp; if{ (G:Var1) 0 == if{ 1 (&gt;G:Var1) (P:Local Time, seconds) 20 + 
    
    (&gt;G:Var2) } } els{ (G:Var1) 0 &gt; if{ 0 (&gt;G:Var1) } }
          </Value>
        </Select>
     </Element>
    
      <Element>
        <Select>
          <Value>(G:Var1) 1 == if{ (P:Local Time, seconds) (G:Var2) &gt; if{ 1 (&gt;G:Var3) } }
          </Value>
        </Select>
     </Element>
    
      <Element>
        <Select>
          <Value>(G:Var3) 1 == if{ (L:lhc_prop_cover,enum) 0 == if{ 1 (&gt;L:lhc_prop_cover,enum) } } els{ (L:lhc_prop_cover,enum) 1 == if{ 0 (&gt;L:lhc_prop_cover,enum) } } 
          </Value>
        </Select>
     </Element>
    
    </Gauge>
     
    Last edited: 28 Feb 2011
  7. Xpand

    Xpand

    Joined:
    10 Aug 2008
    Messages:
    549
    Country:
    portugal
    Uau, thanks guys, gotta try that when I have the time!

    :D

    Ah, and now, a bit off-topic: what exaclty does the Bias section mean? Does it convert from, for example, degrees to keyframes?
     
    Last edited: 28 Feb 2011
  8. Au-MaV

    Au-MaV

    Joined:
    9 Nov 2006
    Messages:
    520
    Country:
    australia
    Hi
    from the sdk ;)
    "If the value returned and scaled does not fall into the desired range for the keyframes (for example, the range -50 to +50), then a bias can be added to all values to indicate which keyframe to use. A bias of 50 in this example will adjust the range to 0 to 100."

    Its used when using the <sim> tags, if using <code> tags its expressed via the maths :)
    Wozza
     
  9. n4gix

    n4gix Resource contributor

    Joined:
    26 Sep 2006
    Messages:
    10,733
    Country:
    unitedstates
    Remember this formula:

    keyframes = (simvar,units * scale) + bias

    As Wozza wrote, the bias is used to offset the results to match the keyframe scale.

    A simple example is this script for a turn coordinator ball. The simvar is returned as "position" with a range of -1.0 to 1.0. The scale is set to 50, and the bias to 50:

    Code:
      <PartInfo>
        <Name>turn_ball</Name>
        <AnimLength>100</AnimLength>
        <Animation>
          <Parameter>
            <Sim>
              <Variable>Turn coordinator ball</Variable>
              <Units>position</Units>
              <Bias>50</Bias>
              <Scale>50</Scale>
            </Sim>
          </Parameter>
        </Animation>
      </PartInfo>
    Let's calculate a few examples to verify our "math!"
    (simvar,unit * scalar) + bias = keyframes

    (-1 * 50) + 50 = 0 keyframe
    (-0.5 * 50) + 50 = 25 keyframe
    (0 * 50) + 50 = 50 keyframe
    (0.5 * 50) + 50 = 75 keyframe
    (1 * 50) + 50 = 100 keyframe
     
    Last edited: 13 Sep 2017 at 18:02
  10. lionheart

    lionheart

    Joined:
    24 Oct 2005
    Messages:
    8,177
    Country:
    us-arizona
    (pears over keyboard and mumurs 'ackk!' ).

    And I thought Nuclear Physics and Time displacements during varied Quantum Mechanics translations to gravity and light were difficult..
     
  11. n4gix

    n4gix Resource contributor

    Joined:
    26 Sep 2006
    Messages:
    10,733
    Country:
    unitedstates
    Bill O., that's 3rd grade arithmetic! :teacher:
     
  12. Vitus

    Vitus

    Joined:
    29 Nov 2006
    Messages:
    770
    Country:
    newzealand
    *whispers* Bill L. can probably also do more serious maths. remainders and such! :D
     
  13. Au-MaV

    Au-MaV

    Joined:
    9 Nov 2006
    Messages:
    520
    Country:
    australia
    Just sit on ya head it all makes sense then :)

    Yeah but we are not 3 graders...... all those years take its toll :D
     
    Last edited: 28 Feb 2011
  14. n4gix

    n4gix Resource contributor

    Joined:
    26 Sep 2006
    Messages:
    10,733
    Country:
    unitedstates
    This reminds me of a current commercial wireless access commercial:

     
    Last edited: 13 Sep 2017 at 18:04
  15. lionheart

    lionheart

    Joined:
    24 Oct 2005
    Messages:
    8,177
    Country:
    us-arizona
    LOLOL.... ATT versus Verizon...
     
  16. n4gix

    n4gix Resource contributor

    Joined:
    26 Sep 2006
    Messages:
    10,733
    Country:
    unitedstates
    Yep, that's the one!
     

Share This Page