Animated Drums for Engine Time

#1
I have been through the forums here and came up with codes for the drums that work. I even have them set up to only roll from 9-0 via keyframes. My Problem is that the only one that times properly is the hundredths drum. With the rpm high that drum shifts a digit every 36 seconds, and the shift is good in terms of speed. The tenths drum will start to shift as soon as the hundredths drum hits nine, and slowly completes it's shift as the hundredths drum goes back to 0. The problem just gets worse as you work through the other drums. Here's what I am using...

Code:
<!-- Tach Drums -->

<Animation name="Engine_Time_Hundredths" guid="A3B58E32-A4E1-5384-5C72-1AFD1C5AEFC4" length="100" type="Sim" typeParam2="Engine_Time_Hundredths" typeParam="AutoPlay" />
<PartInfo>
  <Name>Engine_Time_Hundredths</Name>
    <AnimLength>100</AnimLength>
      <Animation>
        <Parameter>
            <Code>(A:GENERAL ENG ELAPSED TIME:1, hours) 100 * 10 % 10 * </Code>
        </Parameter>
      </Animation>
</PartInfo>

<Animation name="Engine_Time_Tenths" guid="A3B58E32-A4E1-6384-5C72-1AFD1C5AEFC4" length="100" type="Sim" typeParam2="Engine_Time_Tenths" typeParam="AutoPlay" />
<PartInfo>
  <Name>Engine_Time_Tenths</Name>
    <AnimLength>100</AnimLength>
      <Animation>
        <Parameter>
            <Code>(A:GENERAL ENG ELAPSED TIME:1, hours) 10 * 10 % 10 * </Code>
        </Parameter>
      </Animation>
</PartInfo>

<Animation name="Engine_Time_Ones" guid="A3B58E32-A4E1-3285-5C72-1AFD1C5AEFC4" length="100" type="Sim" typeParam2="Engine_Time_Ones" typeParam="AutoPlay" />
<PartInfo>
  <Name>Engine_Time_Ones</Name>
    <AnimLength>100</AnimLength>
      <Animation>
        <Parameter>
            <Code>(A:GENERAL ENG ELAPSED TIME:1, hours) 10 % 10 * </Code>
        </Parameter>
      </Animation>
</PartInfo>

<Animation name="Engine_Time_Tens" guid="A3B58E32-A4E1-6397-5C72-1AFD1C5AEFC4" length="100" type="Sim" typeParam2="Engine_Time_Tens" typeParam="AutoPlay" />
<PartInfo>
  <Name>Engine_Time_Tens</Name>
    <AnimLength>100</AnimLength>
      <Animation>
        <Parameter>
            <Code>(A:GENERAL ENG ELAPSED TIME:1, hours) 10 / 10 % 10 * </Code>
        </Parameter>
      </Animation>
</PartInfo>

<Animation name="Engine_Time_Hundreds" guid="A3B58E32-A4E1-6987-5C72-1AFD1C5AEFC4" length="100" type="Sim" typeParam2="Engine_Time_Hundreds" typeParam="AutoPlay" />
<PartInfo>
  <Name>Engine_Time_Hundreds</Name>
    <AnimLength>100</AnimLength>
      <Animation>
        <Parameter>
            <Code>(A:GENERAL ENG ELAPSED TIME:1, hours) 100 / 10 % 10 * </Code>
        </Parameter>
      </Animation>
</PartInfo>

<Animation name="Engine_Time_Thousand" guid="A3B58E32-A4E1-6347-5C72-1AFD1C5AEFC4" length="100" type="Sim" typeParam2="Engine_Time_Thousand" typeParam="AutoPlay" />
<PartInfo>
  <Name>Engine_Time_Thousand</Name>
    <AnimLength>100</AnimLength>
      <Animation>
        <Parameter>
            <Code>(A:GENERAL ENG ELAPSED TIME:1, hours) 1000 / 10 % 10 * </Code>
        </Parameter>
      </Animation>
 

n4gix

Resource contributor
#3
Bob, try using this script. Only the tenths digit "rolls constantly".
The (L:B737_APU_Hobbs, enum) may be substituted with (A:GENERAL ENG ELAPSED TIME:1, hours)
The /flr causes the rest of the drums to only roll over when the next lower digit goes from 9 to 0.

EDIT: You may only need to add /flr to all but the hundredths drum in your existing script.

XML:
  <PartInfo>
    <Name>B737_APU_Hobbs_10000</Name>
    <AnimLength>10</AnimLength>
    <Animation>
      <Parameter>
        <Code>(L:B737_APU_Hobbs,enum) 99999 min 0 max 100000 % 10000 / flr</Code>
      </Parameter>
      <Lag>30</Lag>
    </Animation>
  </PartInfo>

  <PartInfo>
    <Name>B737_APU_Hobbs_1000</Name>
    <AnimLength>10</AnimLength>
    <Animation>
      <Parameter>
        <Code>(L:B737_APU_Hobbs,enum) 99999 min 0 max 10000 % 1000 / flr</Code>
      </Parameter>
      <Lag>30</Lag>
    </Animation>
  </PartInfo>

  <PartInfo>
    <Name>B737_APU_Hobbs_100</Name>
    <AnimLength>10</AnimLength>
    <Animation>
      <Parameter>
        <Code>(L:B737_APU_Hobbs,enum) 99999 min 0 max 1000 % 100 / flr</Code>
      </Parameter>
      <Lag>30</Lag>
    </Animation>
  </PartInfo>

  <PartInfo>
    <Name>B737_APU_Hobbs_10</Name>
    <AnimLength>10</AnimLength>
    <Animation>
      <Parameter>
        <Code>(L:B737_APU_Hobbs,enum) 99999 min 0 max 100 % 10 / flr</Code>
      </Parameter>
      <Lag>30</Lag>
    </Animation>
  </PartInfo>

  <PartInfo>
    <Name>B737_APU_Hobbs_1</Name>
    <AnimLength>10</AnimLength>
    <Animation>
      <Parameter>
        <Code>(L:B737_APU_Hobbs,enum) 99999 min 0 max 10 % 1 / flr</Code>
      </Parameter>
      <Lag>30</Lag>
    </Animation>
  </PartInfo>

  <PartInfo>
    <Name>B737_APU_Hobbs_01</Name>
    <AnimLength>100</AnimLength>
    <Animation>
      <Parameter>
        <Code>(L:B737_APU_Hobbs,enum) s2 l2 int - 100 *</Code>
      </Parameter>
      <Lag>30</Lag>
    </Animation>
  </PartInfo>
 
Last edited:
Top