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

FSX XML Code; What is wrong with this?

Messages
10,163
Country
us-arizona
Hey all,


OK, this works in FS9 in FS9 XML format perfectly. I translated it into FSX XML format and it stops the code sheet from functioning.

I am going to take a guess that 'Rotation' is not supported or is perhaps worded a different way?



Code:
  <Part>
      <name>Koff_knob</name>
      <Animation>
         <Rotation>Y</Rotation>
         <Parameter>
            <Sim>
               <Variable>KOHLSMAN SETTING MB</Variable>
               <Units>mbar</Units>
            </Sim>
            <Lag>300</Lag>
         </Parameter>
      </Animation>
      <MouseRect>
         <Cursor>Hand</Cursor>
         <HelpID>HELPID_GAUGE_KOHLSMAN_KNOB</HelpID>
         <TooltipID>TOOLTIPTEXT_ALTIMETER_KOHLSMAN_MBAR</TooltipID>
         <MouseFlags>RightSingle+LeftSingle+MoveRepeat</MouseFlags>
         <CallbackCode>(M:Event) 'RightSingle' scmp 0 == if{ (&gt;K:KOHLSMAN_INC) } (M:Event) 'LeftSingle' scmp 0 == if{ (&gt;K:KOHLSMAN_DEC) }</CallbackCode>
      </MouseRect>
 <PartInfo>


Any thoughts or feedback or ideas would be massively appreciated.


Also, I want to thank Wozza for that code for the Kohlsman knob. Works brilliant in FS9.
 
I believe it is the 'Rotation' string in the above block. I just found this in my FSX XML parts sheet;



Code:
   <PartInfo>
      <Name>knob_heading</Name>
	    <AnimLength>100</AnimLength>
      	<Animation>
<!--			<Rotation>Z</Rotation>  -->
         		<Parameter>
            	   <Sim>
               		<Variable>AUTOPILOT HEADING LOCK DIR</Variable>
               		<Units>radians</Units>
			            <MinValue>0</MinValue> 
			            <MaxValue>100</MaxValue> 
               		<Scale>20</Scale>
            	   </Sim>
        		</Parameter>
      	</Animation>
      <MouseRect>
         <Cursor>Hand</Cursor>
         <TooltipID>TOOLTIPTEXT_AUTOPILOT_HEADING_INDICATOR</TooltipID>
         <MouseFlags>LeftSingle+LeftDrag+Wheel</MouseFlags>
         <CallbackJumpDragging>
            <XMovement>
               <Delta>1</Delta>
               <EventIdInc>HEADING_BUG_INC</EventIdInc>
		   <EventIdDec>HEADING_BUG_DEC</EventIdDec>
            </XMovement>
         </CallbackJumpDragging>
      </MouseRect>
   </PartInfo>


Note that the Rotation has been edited out.

How does one animate this? Is it 359 degrees rotation every 25 KF's?
 
I am going to give this one a try and see what it does.

New code blended in from the Heading knob animation block;




Code:
  <Part>
      <name>Koff_knob</name>
      <AnimLength>100</AnimLength>
      <Animation>
<!--         <Rotation>Y</Rotation>     -->
         <Parameter>
            <Sim>
               <Variable>KOHLSMAN SETTING MB</Variable>
               <Units>mbar</Units>
	            <MinValue>0</MinValue> 
	            <MaxValue>100</MaxValue> 
	<Scale>20</Scale>
            </Sim>
            <Lag>300</Lag>
         </Parameter>
      </Animation>
      <MouseRect>
         <Cursor>Hand</Cursor>
         <HelpID>HELPID_GAUGE_KOHLSMAN_KNOB</HelpID>
         <TooltipID>TOOLTIPTEXT_ALTIMETER_KOHLSMAN_MBAR</TooltipID>
         <MouseFlags>RightSingle+LeftSingle+MoveRepeat</MouseFlags>
         <CallbackCode>(M:Event) 'RightSingle' scmp 0 == if{ (&gt;K:KOHLSMAN_INC) } (M:Event) 'LeftSingle' scmp 0 == if{ (&gt;K:KOHLSMAN_DEC) }</CallbackCode>
      </MouseRect>
 <PartInfo>
 
On a side note; Does this mean that we cannot use free spinning Rotations in FSX? Is there a work around on this? For instance, this also uses PropTrashes cool Beacon animation. Rotation being excluded would mean we have to find a different way. Is that correct? And has it been done yet?
 
Rats... The modified 'Rotation' version does not work.


hmmm.. .


If anyone has any idea's, I would be most greatful.

I guess I can use a gauge texture, create a gauge, drop that on it's UVW and it will appear to animate as a knob.


We need a rotation work around.
 
Already tried to capitalize the "name" tag?

Also, <Part> at the top should be <Partinfo>. And you're missing a "/" in the closing PartInfo tag. ;)
 
Bill, use 360 frames, keyed every 90º. Note that I'm multiplying the <Animation> by 100 to make the knob "spin faster..." :D

Left/Right click, mouse wheel, click on center of knob to set STD pressure. Tooltip provides millibars.

Code:
  <PartInfo>
    <Name>T38_BaroSet</Name>
    <AnimLength>360</AnimLength>
    <Animation>
      <Parameter>
        <Code>(A:KOHLSMAN SETTING HG, inHg) 28.1 - 100 * 0 max 360 min</Code>
      </Parameter>
    </Animation>
    <MouseRect>
      <Cursor>Hand</Cursor>
      <TooltipText>%((A:KOHLSMAN SETTING HG:1, mbar))%!d! HPa</TooltipText>
      <MouseFlags>LeftSingle+MiddleSingle+RightSingle+WheelUp+WheelDown+DownRepeat</MouseFlags>
      <CallbackCode>
        (M:Event) 'LeftSingle' scmp 0 == if{ (&gt;K:KOHLSMAN_DEC) 1 (>L:XMLClick,enum) }
        (M:Event) 'MiddleSingle' scmp 0 == if{ 16211.2 (&gt;K:KOHLSMAN_SET) 1 (>L:XMLClick,enum) }
        (M:Event) 'RightSingle' scmp 0 == if{ (&gt;K:KOHLSMAN_INC) 1 (>L:XMLClick,enum) }
        (M:Event) 'WheelUp'     scmi 0 == if{ (&gt;K:KOHLSMAN_INC) 1 (>L:XMLClick,enum) }
        (M:Event) 'WheelDown'   scmi 0 == if{ (&gt;K:KOHLSMAN_DEC) 1 (>L:XMLClick,enum) }
        1 (>L:XMLSND2,bool)
      </CallbackCode>
    </MouseRect>
  </PartInfo>

While I'm at it, here some script for a HDG Knob:

Code:
  <PartInfo>
    <Name>T38_HDG_Knob</Name>
    <AnimLength>360</AnimLength>
    <Animation>
      <Parameter>
        <Code>(A:AUTOPILOT HEADING LOCK DIR, degrees) 10 * dnor</Code>
      </Parameter>
    </Animation>
    <MouseRect>
      <Cursor>Hand</Cursor>
      <TooltipID>TOOLTIPTEXT_AUTOPILOT_HEADING_INDICATOR</TooltipID>
      <MouseFlags>LeftSingle+MiddleSingle+RightSingle+WheelUp+WheelDown+DownRepeat</MouseFlags>
      <CallbackCode>
        (M:Event) 'LeftSingle'  scmi 0 == if{ (&gt;K:HEADING_BUG_DEC) }
        (M:Event) 'RightSingle' scmi 0 == if{ (&gt;K:HEADING_BUG_INC) }
        (M:Event) 'WheelUp'     scmi 0 == if{ (&gt;K:HEADING_BUG_INC) }
        (M:Event) 'WheelDown'   scmi 0 == if{ (&gt;K:HEADING_BUG_DEC) }
        (M:Event) 'MiddleSingle' scmi 0 == if{ (A:Plane heading degrees gyro,degrees)  (&gt;K:HEADING_BUG_SET) }
        1 (>L:XMLSND2,bool)
      </CallbackCode>
    </MouseRect>
  </PartInfo>
 
Already tried to capitalize the "name" tag?

Also, <Part> at the top should be <Partinfo>. And you're missing a "/" in the closing PartInfo tag. ;)

I caught that, lol.. yep, fixed it, still didnt work.


I dont know how you gauage code makers can do what you do. I stair at the screen looking for mistakes and errors and I see nothing wrong. It reminds me of those guys in The Matrix, that look at the odd machine code pouring in colums down the screen, and the guy goes, 'hey, theres that chick in the red dress' pointing at a column of code...
 
I dont know how you gauage code makers can do what you do.

Here's my dirty little secret...

I cheat! :laughing:

Seriously, I've taken the time to study examples others have done, and patiently learned to understand what each bit of XML script does.

I also have a set of generic prototypes available for me to simply cut-and-paste, then fill in the prototype with what I need for any given situation. :coffee:
 
Here's my dirty little secret...

I cheat! :laughing:

Seriously, I've taken the time to study examples others have done, and patiently learned to understand what each bit of XML script does.

I also have a set of generic prototypes available for me to simply cut-and-paste, then fill in the prototype with what I need for any given situation. :coffee:

Words of wisdom; jigs and patterns. Premade assemblies, be it code or parts.

I am still glad I was given the idea of importing my plane into a ready made FSX scene with all materials created. I was so happy about that. In under 2 hours, I had all materials switched over to FSX on the model.

Mind you, it will not export.. But the materials are done... :D
 
Words of wisdom; jigs and patterns. Premade assemblies, be it code or parts.

I use a slightly different technique with regards to FSX Materials. Whenever I have a "recipie & bitmap(s) that I really, really like...

I select a part to which it is applied, and then Save Selected to a new .max or .gmax file, and name it appropriately for future use.

When I need it, I can then Merge into my current project, Apply the imported FSX Material to the part I need, then simply Delete the imported mesh. :cool:
 
Hi Bill,

I try to do the same job as you: to learn the codes that I found in this forum, understand, and apply! For a 57 year old trainee like me, not easy ..., but terribly effective thanks to your advice and your generosity. You offer your code to the community, and I find it superb!

I just understand how works the codes presented in point # 7 (after a lot of time and patience ...!), and now my altimeter works perfectly.

Bill thank you for being who you are!
 
Hi Chris! For a 66 year old like myself, not much comes 'easy' for me either. I find that I'm spending more and more of my time thinking about the "here after..."

...as I stand in the kitchen wondering "What the heck did I come in "here after?" :laughing:

I suspect that I've found as many answers to my own questions as I've provided answers myself. In fact, many of the answers I've found lately I discover I'd already answered years ago! :rotfl:
 
Back
Top