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

Window opening/closig code

Messages
189
Country
hungary
Hi fellows !

I wrote a simple code to open and close the little side window of the cabin, see pic. It turna upwards 90degrees, and the window opens.

ablakz%25C3%25A1r.jpg


I think this code has to work, but not :( If I attach and other MouseRect to the knob ( for example landig light ) that's works...

Code:
 <PartInfo>
  <Name>kisablak_zar_bal</Name>
  <AnimLenght>100</Animlength>
   <Animation>
    <Parameter>
      <Code>(L:kisablak_zar_bal, bool) 100 *</Code>
    </Parameter>
  </Animation>
  <MouseRect>
    <Cursor>Hand</Cursor>
    <Tooltip>Kisablak</Tooltip>
    <CallbackCode>
          (L:kisablak_zar_bal, bool) ! (>L:kisablak_zar_bal, bool)
    </CallbackCode>   
  </MouseRect>
</PartInfo>
 
I'm confused... I tried exporting it many times, and one time it worked ! Then I made the code for the right side window, it worked ! But now I exported again without any modification in the code, and it's not working :mad:
 
Spelling error:

<AnimLenght>100</Animlength>

should be:

<AnimLength>100</AnimLength>
 
Last edited:
Try seperate animations for the left and right side windows.
 
They are seperated from the beginning ! I worked out the code for the left side first, then I exported the model n+1 times, without success. Then one time it worked, and I made the code for the right side also, and both windows worked only once.
 
It seems that animations/codes which have L: variables does not work in my poroject. What could be the error?!
 
No, L:vars will always "work..."

Maybe the sim doesn't like Hungarian! :p Just kidding of course!

Try these two working scripts:

Code:
  <Animation name="da42_vent_left"   guid="7bd3027e-5a10-4211-a48e-8a2e1ae91429" length="100" type="Sim" typeParam2="da42_vent_left" typeParam="AutoPlay" />
  <Animation name="da42_vent_right"   guid="d5059bd8-baf5-4f63-8197-3e8bd6daf09e" length="100" type="Sim" typeParam2="da42_vent_right" typeParam="AutoPlay" />
Code:
  <PartInfo>
    <Name>da42_vent_left</Name>
    <AnimLength>100</AnimLength>
    <Animation>
      <Parameter>
        <Code>
          (L:VentLeft, number) 100 *
        </Code>
        <Lag>40</Lag>
      </Parameter>
    </Animation>
    <MouseRect>
      <Cursor>Hand</Cursor>
      <TooltipText>Vent Left</TooltipText>
      <CallbackCode>
        (L:VentLeft, number) ! (>L:VentLeft, number)
      </CallbackCode>
    </MouseRect>
  </PartInfo>

  <PartInfo>
    <Name>da42_vent_right</Name>
    <AnimLength>100</AnimLength>
    <Animation>
      <Parameter>
        <Code>
          (L:VentRight, number) 100 *
        </Code>
        <Lag>40</Lag>
      </Parameter>
    </Animation>
    <MouseRect>
      <Cursor>Hand</Cursor>
      <TooltipText>Vent Right</TooltipText>
      <CallbackCode>
        (L:VentRight, number) ! (>L:VentRight, number)
      </CallbackCode>
    </MouseRect>
  </PartInfo>
 
It seems that animations/codes which have L: variables does not work in my poroject. What could be the error?!

Having looked even more closely, it appears that your scripts are failing because of inconsistent Capitalization errors in the <Tags>!!!

In multiple places you have incorrectly put <Animlength> instead of <AnimLength>...

The <Tags> must be absolutely correct and matching!
 
Thanks Bill if you try to help me :)

I've pasted your code into modeldef.xml, and for surprise... not working... the "Hand" mouse pointer and Tooltip text still does not appear when I put it over the knob...

- the knob animated to 100 frames, as it is in the code
- scale is resetted on the part
- animation attached to it with Anim.Manager
- MouseRectangle attached in Attachpoint Tool
- code must be good
- exporting the model to X file from Max
- converting the X file to mdl with xtomdl.exe from SDK SP2
 
  • Are other animations working?
  • Did you remember to check "Export Animations" when Exporting to .x file?
  • Did you remember to include the .xanim file when compiling via xtomdl.exe?
There has to be a step missing somewhere, since I know without question that these scripts are working in the DA42... ;)
 
- Yes all "default" animations are working ( flaps, landing gears, control surfaces...)
- Yes, on every export I check "Export Animations" box
- Yes I include the /xanim tag, here is the content os the batch file :

Code:
xtomdl /dict:modeldef.xml /xanim /out:D:\FSX\SimObjects\Airplanes\L-410\model.uvp\L410UVP_VC L410UVP_VC.x

I have the same modeldef.xml in the /bin folder and in the /plugin folder where I export the X file - and where all the dll's live :)

At the end of convert I get this message :

Code:
<!-- ++++ Processing Animation : ablaktorlo_bal ++++ -->
<!-- ++++ Processing Animation : da42_vent_left ++++ -->
<!-- ++++ Processing Animation : kapcsolo_ablaktorlo ++++ -->
<!-- ++++ Processing Animation : kisablak_zar_bal ++++ -->
<!-- ++++ Processing Animation : kisablak_zar_jobb ++++ -->
<!-- ++++ Processing Animation : needle_attitude_bank ++++ -->
<!-- ++++ Processing Animation : prop0_blurred ++++ -->
<!-- ++++ Processing Animation : prop0_slow ++++ -->
<!-- ++++ Processing Animation : prop0_still ++++ -->
<!-- ++++ Processing Animation : prop1_blurred ++++ -->
<!-- ++++ Processing Animation : prop1_slow ++++ -->
<!-- ++++ Processing Animation : prop1_still ++++ -->
 
Okay then. If you select the vent object, right-click and check the Object_Properties/User Defined tab can you see the XML script mouse code?

Code:
FSXML = <?xml version="1.0" encoding="ISO-8859-1" ?> <FSMakeMdlData version="9.0"> <MouseRect name="da42_vent_left"> </MouseRect> </FSMakeMdlData>
 
Same for me :

Code:
FSXML = <?xml version="1.0" encoding="ISO-8859-1" ?> <FSMakeMdlData version="9.0"> <MouseRect name="da42_vent_left"> </MouseRect> </FSMakeMdlData>
 
Shit... there was a simple poly in the cockpit for displaying sim variables with BlackBox3, and somehow this poly blocked my animations :confused: Without this poly I can open/close the vent window :)

How could it be?
 
Probably something in Blackbox3 was blocking the commands. I have it but haven't tried it out yet myself.

I'll have to give it a try to see what's up...
 
Sometimes when you create a Mouse Rect tag on a part and it fails to work even if you reset scale......Simply apply Xform.

If you make parts that are a larger scale and then scale them to fit your project you must reset xform even if it works. Because small parts like a switch will have even a smaller Rect area to click. Makes it tought to click during flights and can cause it to fail.....:confused: I always create my parts in my scene first to make sure it's about the right scale. Then i hide or freeze other parts. Using the simple scale also throws off the x y and z scale. But this does not matter unless your creating parts by size. For parts that you convert to mesh or poly does not matter if you scale as long as you scale slightly.

So it's not always parts in the way.

DG
 
Blocking parts by other parts will make them unclickable, thus not working. Sliding over to the other side of the cockpit and clicking then 'might' do this.


Animation Manager has many bugs. Sometimes it will not attach the code to the part.

Also, reclear the part's animation and reset it with key frames set for 0 to 100. That has happened to me. Having reset for 100 frames did it as for some reason, it didnt work the first time.


Its something so simple if everything is correct.

Make sure 'all' of the other parts are working as there may be something in the XML parts list that has a bad code.
 
To save you trouble. I have never reset the animation keys.
But I have had to make a new part before. The parts can get thrashed sometimes.

So it might not be nec.. to do that step.

DG:o
 
Back
Top