Speaking of animations...

29 May 2020 17:44 #46892 by Vodoun da Vinci
Specifically a canopy animation on a P-38 where there are actually 3 different objects that need to all come into place at different rates. Is there a tag to get the animation speed to change? I know that I can adjuts the rate of gear deployment and timing in the FDM but I'm not sure how to change the speed of things in animations.

Can it be done?

Thanks in advance!

VooDoo

Please Log in or Create an account to join the conversation.

29 May 2020 17:49 - 29 May 2020 18:01 #46893 by Algernon
The canopy is controlled by a bit of Nasal somewhere. You just change this to change the rate of opening and closing - if you need those different bits of canopy to move at different times, you can use an interpolation table. It looks complicated... until you know how ;)

No big deal - and at the same time, might be worth creating a Nasal code snippet you can use for canopies in future which uses the correct MP-aliased property for it (rather than the /sim/model.... one)

Let me know if you want a walkthrough. I'll write a code snippet in a moment and post below.

Please Log in or Create an account to join the conversation.

29 May 2020 18:11 - 29 May 2020 18:19 #46897 by Algernon
OK, first the Nasal. Just for this explanation, here is part of the comments from aircraft.nas where the door function lives.
# SYNOPSIS:
#	door.new(<property>, <swingtime> [, <startpos>]);
#
#	property   ... door node: property path or node
#	swingtime  ... time in seconds for full movement (0 -> 1)
#	startpos   ... initial position      (default: 0)

So the code snippet you want to include somewhere in your aircraft's Nasal is this:
var canopy = aircraft.door.new("canopy/position-norm", 6,1);

This creates a property called canopy/position-norm which MP automatically follows, sets the open/close time to 6 seconds, and sets the default position to 1 - so starting up with canopy open.

I would suggest creating a new nasal module just to do this, it'll make it way easier to swap into other aircraft. So create an empty text/nasal file called "doors.nas", save it in the aircraft's Nasal folder, and add this to its -set.xml inside the <nasal> tags, usually found at the bottom of the XML:
<doors>
  <file>Aircraft/--YOUR-AIRCRAFTS-FOLDER--/Nasal/doors.nas</file>
</doors>

Then add that code snippet above to doors.nas.

That's the first step! Now I'm going to post this, check it out, and put the next step in another post.

Please Log in or Create an account to join the conversation.

29 May 2020 18:20 #46900 by Algernon
Predictably, I made a few errors and so have updated my previous post. I suggest you don't start on it until I've written it all AND triple-checked it to avoid frustration. But do let me know if you're following and if everything makes sense.

Please Log in or Create an account to join the conversation.

29 May 2020 18:25 - 29 May 2020 18:28 #46902 by Algernon
Sigh. I'm now getting that 412 error, won't let me post the code snippet for the keyboard binding "for security reasons". I'll have to do this another way...

Perhaps I'll write it in a text file and provide the link... give me an hour or so - I got a steak to fry!! :)
The following user(s) said Thank You: Vodoun da Vinci

Please Log in or Create an account to join the conversation.

31 May 2020 13:54 #46976 by Vodoun da Vinci
I appreciate the help!

VooDoo

Please Log in or Create an account to join the conversation.

31 May 2020 15:22 #46977 by Algernon
It's a pleasure. Got a little modular package ready for you, pls see PMs.

Please Log in or Create an account to join the conversation.

Time to create page: 0.136 seconds
Powered by Kunena Forum

Latest Forum Posts

PM Notifications

You are not logged in.

PM Mailbox

You are not logged in.