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

Makemdl.parts code for animating flag to wind direction

Milton_Shupe

Resource contributor
Messages
331
Country
us-newmexico
windir.jpg
View attachment 20684 Happy New Year friends.

In my "Bounty" ship project, I wish to add a flag to the mast to show wind direction.

I have some of the important constructs below but not sure how to make them work as I am not an xml knowledgeable coder. The <code> shown is from a <value> statement I use in my sails mgmt gauge and it works fine in the gauge.

Animation uses Y axis and 100 frames.
Is the <variable? statement necessary?
Should <units> be in degrees?
How does <bias> work into this calculation to set the flag/wind direction?
Any help immensely appreciated.View attachment 20684

<!-- Animated Flag Showing Wind Direction -->
<part>
<name>flag_01</name>

<animation>
<rotation>Y</rotation>
<parameter>
<code>(A:Ambient wind direction, radians) (A:plane heading degrees true, radians) - pi 2 / - </code>
<Delay DegreesPerSecond="180"/>
<sim>
<variable>Wind Direction</variable>
<units>radians</units>
<scale>100</scale>
<bias>0</bias>
</sim>
</parameter>
</animation>
</part>
 
Last edited:
Update on the question above:

I found I did not need to animate the flag for rotation so I removed the animation and the <sim> statements.

The flag rotates with wind direction change now but it is 90 degrees off. :-/

Here is what I have now in makemdl.parts :

<!-- Animated Flag Showing Wind Direction -->
<part>
<name>flag</name>

<animation>
<rotation>Z</rotation>
<parameter>
<code>(A:Ambient wind direction, radians) (A:plane heading degrees true, radians) - pi 2 / - </code>
<Delay DegreesPerSecond="180"/>
</parameter>
</animation>
</part>

Any ideas?

RESOLVED: Simply rotated flag 90 degrees in the model.
 

Attachments

  • windir2.jpg
    windir2.jpg
    238.4 KB · Views: 349
Last edited:
I have a number of sail rigging sets that will show/hide based on degrees of flaps deployed. Testing this code now but unsure if this is written correctly.

If flaps position is 26 degrees, show "rigging02" part.
My test gauge shows the flaps degrees at 26.00 (2 decimals) but the parts swap is not occurring.
I have the same code working with &gt or &lt, but not sure how to do an "equals".
Am I doing this code correctly?

<!-- flaps-position.2 = 26 -->
<part>
<name>rigging02</name>
<visible_in_range>
<parameter>
<code>
(A:Trailing edge flaps0 left angle, degrees) 26 ==;
</code>
</parameter>
<minvalue>1</minvalue>
</visible_in_range>
</part>
 
Last edited:
(A:Trailing edge flaps0 left angle, degrees) 26 ==;
Probably will work if you remove ";" at the end of the script.

But for float values is always a risk when using direct comparison. Better option is &gt and &lt, or similar:
Code:
(A:Trailing edge flaps0 left angle, degrees) near 26 ==
or
Code:
25.5 26.5 (A:Trailing edge flaps0 left angle, degrees) rng

Also, instead of "A:Trailing edge flaps0 left angle" you can try:
Code:
(A:Flaps handle index, number) N ==
where "N" is the index of current flap position in the aircraft.cfg (N=0,1,2,3...).

Hope this help:)
 
Thanks Robert :) I just completed all the sail arm and rigging animations, quite the task.

Sail arms are animated using 10 sets of Flaps stops, each stop represents 11 degrees of turn of the arms on the 3 masts. (Zero degrees thru 99 degrees stop to stop. This gives us 50 degrees of swing both ways from square.)

Each stop owns 13 rigging line sets, a total of 18 lines.

So, there are 130 rigging sets that were animated to accommodate the sail arms turning, and different lengths of line for each stop.

In addition to the gmax parts and animation, XML model code was required to do the animation and show and hide each rigging set for each stop. I set the xml to show for 11 degrees, 5 degrees before and after each stop. (See attached gmax screenshot of all the sets displayed at once :) )

Then I changed the Sail Management Gauge to accommodate the new animation to display the 3 sail arms correctly in sync with the animations.

Overall, it was rather complicated for a novice XML coder but fortunately I had some good input from folks here at FSDeveloper when I ran into questions or problems.

The next challenge now is to show/hide sails (or change sail configurations) based on wind speeds. :)

And of course, there is the more complex issue of animating a flag. :) It does rotate to show wind direction, but it does not yet flap in the breeze.

Here are a couple of shots from FS9 and FSX as I was testing. Forgive the gauge appearance as the artwork has not yet been started.
fsx0102.jpg
10setsof13parts.jpg

Milton
 

Attachments

  • fs90102.jpg
    fs90102.jpg
    115.3 KB · Views: 429
Last edited:
Hello Milton,

What are the chances of - When The model is finished - a written Tutorial - of the Model -the Rigging - the Textures - and Animation. That Would be totally Assume .

Johnamn
 
Hello Johnamn,

Although retired, I find it interesting how time flies with so much to do. I have 6 projects in progress, yet I find myself with time to work on this "filler" project.

Modeling the ship is no different than modeling any other object from a fundamentals standpoint. I enjoyed it as an opportunity to learn more about "tall ships" and "square riggers", and something about sailing in general with its culture and lingo. So as to a tutorial, I am unable to see the value beyond normal aircraft modeling tutorials. If you are interested in its construction, I will happily share the gmax source with anyone interested.

With reference to the rigging, both "standing" and "running", many hours were required to sort out from reference pictures and drawings what was what, and what I needed for the model without overdoing it. There's 10,000 feet of over 500 different lines on the "Bounty" per the Captain so only the essentials were used for best appearance.

Animations of the sail yard arms and the running rigging was an interesting challenge but needed to be done. Static, separate models for port and starboard tacking or changing winds was unacceptable to me as a solution.

Control and display of sails and rigging is done with quite simple "makemdl.parts" coding, a Sail Management Gauge, and the aircraft.cfg flaps section. I will happily share that as requested.

Thanks to the good people here at FSDeveloper for their help with my questions.
 
Back
Top