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

rotating needle animation

Vitus

Resource contributor
Messages
1,480
Country
newzealand
Hello friends,

I guess this is an easy one:
Whats the XML code for a 360-degree rotating needle? I modeled a simple clock, showing hours, minutes and seconds. When looking at the seconds-needle, the animation works quite well until the step from 59- to 0 seconds where it rotates anti-clockwise to 0. How can this be solved? My code section looks like this so far:
Code:
<Code>
   (E:LOCAL TIME,seconds) flr 60 % 1.666666666667 *
</Code>

All the best!
Vitus
 
3d XML or 2d XML?

For 3d, use this:
Code:
  <PartInfo>
    <Name>needle_clock_seconds</Name>
    <AnimLength>360</AnimLength>
    <Animation>
      <Parameter>
        <Code>
          (L:needle_clock_seconds, number)
        </Code>
      </Parameter>
    </Animation>
  </PartInfo>
 
Hi Bill,

I am sorry but I didn't work that out. I was using the a 100 keyframe animation and my code fragment above gives me the actual time seconds between 0 and 59. So basically it does the same like your example - except that you animate 360 frames. What exactly makes the difference? Is it the evaluating code of your custom L: variable? I have no clue.

And yes: its 3D XML modeldef action :)

Regards
Vitus
 
Oops. I wasn't paying attention. That script is from the default modeldef.xml for the FA-18's analog clock. The driver variable is undoubtedly part of the .gau code...

However, the principle is the same. Try this. Don't forget to create an <Animation...guid=....</Animation> entry also!
Code:
  <PartInfo>
    <Name>needle_clock_seconds</Name>
    <AnimLength>360</AnimLength>
    <Animation>
      <Parameter>
                <Sim>
                    <Variable>LOCAL TIME</Variable>
                    <Units>seconds</Units>
                    <Scale>6.0</Scale>
                </Sim>
      </Parameter>
    </Animation>
  </PartInfo>
 
Hi Bill,

thanks for your time! Unfortunately it still refuses to work.

Of course I already had the animation header with a unique guid. I changed the animation length to 360 and copied your code to the partInfo section. I set the animation length in GMax to 360 and moved the three keys to frames 90, 180 and 360. I gave the needle the name of the animation and attached the animation to it assigning 0 to 360 of animation length in the animation tag tool. I exported the VC and: nothing. the needle doesn't move anymore at all. Once again, I have no clue.

Vitus
 
This issue is really annoying. By now I have around ten different parts that needs to have a continuous rotation-animation. But instead of turning round-and-round-and-round, they turn 360 clockwise to keyframe 360, then rapidly 360 degrees counterclockwise to keyframe 0 again.
Whats the trick? Do I have to change the animation parameters in GMax or is it a coding thing?!

Regards
Vitus
 
Thanks again Bill,

After looking, trying, changing and looking again I found the reason for the needle`s behavior. The math was fine - but I set the lag-parameter for each needle which usually smooths the needle`s animation. It turns out that the needles can go round and round without rotating backwards.

What an annoying, stupid mistake.... :banghead:
Vitus
 
Oh, we are all quite capable of making "stupid mistakes..."

I'm been working on the DA42 project for the past few weeks, adding additional details (of which there are a LOT), UVW Mapping, creating the basic textures, et cetera.

Day before yesterday I wanted to compile a partial model to check my work. Imagine my horror to discover that the model was now causing FS9 to crash with an "FE.dll error!" :yikes:

I immediately entered "Panic Mode," and thinking dark, dark thoughts about a corrupted .gmax source file, and other horrible, TERRIBLE things that may have gone on...

After stepping away until the next morning, and having had a good night's sleep, I began thinking rationally again, and within short order had discovered the proximate cause of my problem...

What do you suppose the sim will do if you ask it to load a bitmap that's 1357x1357 pixels? :rolleyes: :scratchch:

Yep! Fr. Stupid struck again! :rotfl: :censored: :censored:
 
:eek: that's a good one! If I think about it, most of the time-consuming issues I had where caused by silly little things like that.
Programming languages should not be made user-friendly but moron-friendly. That would save us a lot of time! :D
 
Back
Top