Results 1 to 4 of 4

Thread: Help with VC Custom Animated Parts

  1. #1

    Question Help with VC Custom Animated Parts

    Hi guys,

    My situation is:

    I'm trying to develop a custom Flight Computer for a specific aircraft. So far I've been able to create the part in the modeldef.xml, asign the animation with the animationtool in gmax and attach the mouserect to the part.

    The code for one of the buttons:

    <PartInfo>
    <Name>CTU_0</Name>
    <AnimLength>50</AnimLength>
    <Animation>
    <Parameter>
    <Code>(L:CTU_0_KEY,bool) if{ 50 } else{ 0 }</Code>
    </Parameter>
    </Animation>
    <MouseRect>
    <Cursor>Hand</Cursor>
    <MouseFlags>LeftSingle+LeftRelease</MouseFlags>
    <CallbackCode>
    (M:Event) 'LeftRelease' scmp 0 == if{ 0 (&gt;L:CTU_0_KEY,bool) quit }
    (M:Event) 'LeftSingle' scmp 0 == if{ 1 (&gt;L:CTU_0_KEY,bool) quit }
    </CallbackCode>
    </MouseRect>
    </PartInfo>

    Now the problem:

    There's no animation!!

    what I'm trying to do is that the part behaves as a real button, meaning that when I Left click over the part, the button goes down (keyframe 50) and when I release the mouse's left button, the part returns to the original position (keyframe 0)...

    I don't know if there is something else necessary for the part to animate since there's no FSX Variable involved...

    Please, if anyone is able to give me a hand on this I'll appreciate it.

    cheers and happy new year!!!!

  2. #2
    Join Date
    Feb 2008
    Location
    Near EGNC,Cumbria, England
    Posts
    2,333
    Blog Entries
    10

    Default

    Does the mouse rect work? Can you be sure that the animation is the problem, not the mouse code?

    I'd try substituting the code line for:

    ( (L:CTU_0_KEY, bool) if{ 50 } els{ 0 } )

    You don't use else, you us els in XML.
    I fly through the valley of death, but I fear no evil,for I am at 80,000 feet and climbing. Let's powerdive and scare that poor soul in that Ultralight there.

  3. #3

    Red face

    Quote Originally Posted by Flying Officer Jevans View Post
    Does the mouse rect work? Can you be sure that the animation is the problem, not the mouse code?

    I'd try substituting the code line for:

    ( (L:CTU_0_KEY, bool) if{ 50 } els{ 0 } )

    You don't use else, you us els in XML.

    Thanks and sorry, my mistake about the 'els'...

    Regarding the mouserect, I believe it's working since when I place the mouse on top of the part, the cursor changes to 'hand', but the object refuse to move. I don't see what could be the problem, in gmax or in modeldef.xml.

    The mouserect code I copied it from another part and I just modified according to my desires.... maybe those are wrong!!!!

    Is it necessary to have a gauge in the [vcockpit] section in the panel.cfg that deals with the part? .... I think it shouldn't be necessary but... who knows...

    Any other comment is appreciated?

  4. #4

    Red face Problem solved!!!

    Reading the SDK documentation, it says that in the animation definition in the modeldef.xml, you can put in the 'typeparameter' either 'AutoPlay', Random' or leave it blank.

    First I had it like this:

    <Animation name="CTU_0" guid="8A54D4B8-A1B0-4eb1-BE79-2D7C896FF166" length="50" type="Sim" typeParam2="CTU_0" typeParam="" />

    It didn't work....

    I changed it to:

    <Animation name="CTU_0" guid="8A54D4B8-A1B0-4eb1-BE79-2D7C896FF166" length="50" type="Sim" typeParam2="CTU_0" typeParam="AutoPlay" />

    And now it's working perfectly well!!!!


    I feel a little embarrased since it appears to be a simple yet detailed and trial/error mistake...

    I hope this could help future animators and designers.... but I bet they already knew this issue hahaha!!!!

    cheers and happy new year!!

Similar Threads

  1. Ai Animated
    By n452mk in forum FS2004
    Replies: 6
    Last Post: 06-03-2008, 07:17 PM
  2. Animated windsock animated Quebec flag.
    By flatspin in forum Airport for Windows Support
    Replies: 0
    Last Post: 06-28-2003, 01:28 AM
  3. My Second UFO Animated
    By joe35 in forum MSFS Screen Shot Forum
    Replies: 8
    Last Post: 06-19-2003, 07:30 PM
  4. Re: Custom made parts in gmax
    By frfsim in forum Aircraft Design Archive
    Replies: 3
    Last Post: 05-22-2002, 11:56 AM
  5. Custom made parts in gmax
    By alejomdp in forum Aircraft Design Archive
    Replies: 0
    Last Post: 05-21-2002, 11:01 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •