The website and forum will be intermittently unavailable while we're making some security updates.
File uploads to the download hangar are also disabled until further notice.

Custom Animations, GMax

The Tutorials forum section is the place where you can learn the various techniques that go into the creation of AI traffic packages.
User avatar
SeanG
Captain
Captain
Posts: 360
Joined: 11 May 2008, 05:22
Version: P3D
Location: Christchurch, New Zealand
Contact:

Custom Animations, GMax

Post by SeanG »

I am playing with some xml animation, John Young sent me a "how-to" document which helped me get conditional display parts, chocks, RBF and Pilots working, but I just can't seem to get any animations working!

I can create animations, I use TICK18's for things quite happily, but can't seem to compile anything with this code:

<part>
<name>anim_canopy</name>
<animation>
<parameter>
<code>(A:LIGHT NAV, bool) (A:LIGHT RECOGNITION, bool) + 50 * </code>
<lag>20</lag>
</parameter>
</animation>
</part>

Any ideas?

SeanG
Image
User avatar
John Young
MAIW Developer
MAIW Developer
Posts: 4206
Joined: 12 Jul 2008, 15:15

Re: Custom Animations, GMax

Post by John Young »

That block of code opens the canopy only when the Nav lights are on Sean. In FS9 that's from 15 minutes before departure.

It works fine for me, but you need the Key Frames right:

KF0: closed
KF50: open
KF100: closed

The part name is "anim_canopy" of course.

Always put new code blocks as the first entry in your makemdl.parts.xml file, ie after <part_dictionary>. If the compile fails, you know it must be due to that block and not something above it.

John
User avatar
SeanG
Captain
Captain
Posts: 360
Joined: 11 May 2008, 05:22
Version: P3D
Location: Christchurch, New Zealand
Contact:

Re: Custom Animations, GMax

Post by SeanG »

Thanks John,
The only thing I haven't done is move that code to the top, to see if it works, but I'm pretty sure I have code *after* it which works...

I am suspecting something wrong in my GMax environment, I've had a look at Makemdl.exe versions. I currently have "MakeMDL - FS90 (9.00.030612.02)"

Could you check what version you are running please?

Cheers
Sean
Image
User avatar
John Young
MAIW Developer
MAIW Developer
Posts: 4206
Joined: 12 Jul 2008, 15:15

Re: Custom Animations, GMax

Post by John Young »

That's the same version as mine Sean.

This is the code block copied straight from my makemdle.parts.xml file. Try it in place of what you have just in case anything was lost in translation at some point:

<part>
<name>anim_canopy</name>
<animation>
<parameter>
<code>(A:LIGHT NAV, bool) (A:LIGHT RECOGNITION, bool) + 50 * </code>
<lag>20</lag>
</parameter>
</animation>
</part>

John
User avatar
SeanG
Captain
Captain
Posts: 360
Joined: 11 May 2008, 05:22
Version: P3D
Location: Christchurch, New Zealand
Contact:

Re: Custom Animations, GMax

Post by SeanG »

Ok, more testing....
Moved "anim_canopy" to the top of the XML.
Re-compiled my model, with a "group" called "anim_canopy"
The group contained parts with other visibility code later in the xmp file.

The model generates, but the animation doesn't work :( The visibility stuff later down works, which suggests that the XML block earlier is fine.... Still digging... :)

SeanG
Image
User avatar
John Young
MAIW Developer
MAIW Developer
Posts: 4206
Joined: 12 Jul 2008, 15:15

Re: Custom Animations, GMax

Post by John Young »

Why a "group" Sean? The only groups I tend to use are for each LOD.

If you would like to send me your Gmax file and the aircraft.cfg and .air file, I'll gladly check it over for you and do a test export to FS9.

John
User avatar
SeanG
Captain
Captain
Posts: 360
Joined: 11 May 2008, 05:22
Version: P3D
Location: Christchurch, New Zealand
Contact:

Re: Custom Animations, GMax

Post by SeanG »

Thanks John,
I'll send you something to try.... bear in mind I'm just playing with an idea :)

SeanG
Image
User avatar
John Young
MAIW Developer
MAIW Developer
Posts: 4206
Joined: 12 Jul 2008, 15:15

Re: Custom Animations, GMax

Post by John Young »

No problem Sean. Good on you for having a go.

John
User avatar
SeanG
Captain
Captain
Posts: 360
Joined: 11 May 2008, 05:22
Version: P3D
Location: Christchurch, New Zealand
Contact:

Re: Custom Animations, GMax

Post by SeanG »

Success!
I found the problem, which must have been in the key animation somewhere. Started a fresh project, added a box with the animation setup, and it compiles! Now I'm off to try and build what I set out to :)

Thanks for your help (again) John!

SeanG
Image
User avatar
SeanG
Captain
Captain
Posts: 360
Joined: 11 May 2008, 05:22
Version: P3D
Location: Christchurch, New Zealand
Contact:

Re: Custom Animations, GMax

Post by SeanG »

Main discovery tonight: custom animations don't seem to work on named "groups"..... create a part, name it and animate it, then link all the rest of the bits to it and it works a treat :)

SeanG
Image
User avatar
John Young
MAIW Developer
MAIW Developer
Posts: 4206
Joined: 12 Jul 2008, 15:15

Re: Custom Animations, GMax

Post by John Young »

Glad that's fixed Sean.

Custom animations only work on parts with names that match the name in the makemdl.parts file. Those parts can certainly be included within a group, but not as the group name itself. I suspect you were not handling Gmax Grouping correctly. Let me know if you want any advice on that. You will need to be able to group when it come to making LODs. You shouldn't need to group within a LOD.

The only part you need to link to the canopy is the glass if that's using a different texture to the frame. If you link anything else, it will move with the frame.

John
User avatar
SeanG
Captain
Captain
Posts: 360
Joined: 11 May 2008, 05:22
Version: P3D
Location: Christchurch, New Zealand
Contact:

Re: Custom Animations, GMax

Post by SeanG »

Thanks John, Being an interesting learning process. Most of my design stuff in GMax has been for scenery; basic shapes, and some TICK18 animations.... this aircraft stuff is pretty cool :)

Now to come clean.... and the cryptic questions about canopy animations... I'm actually *not* animating a canopy... but using a modified version of the code...
I am attempting to build an AI helo... one which due to it's obscurity, age and ugliness no-one is likely to do :)

Image

The canopy animation is used to lift it into hover, and return it to the ground after flight... I know, it's a crude attempt at heli-animation, but it will work well enough for my needs :)

Image

TICK18 animation used for the rotors, with conditional tags for when the beacon is on. So, beacon off; it sits on the ground with rotors stopped, beacon on the rotors spin, and it lifts up into a 10ft hover :) From there I'm not doing anything clever (yet)

Big thanks to you John, for igniting this flame... and to wescotty for his XML tutorial thread which came up at just the right moment :)

SeanG
Image
User avatar
John Young
MAIW Developer
MAIW Developer
Posts: 4206
Joined: 12 Jul 2008, 15:15

Re: Custom Animations, GMax

Post by John Young »

Aha. So you are using the beacon trigger to hover-taxi out to your runway. I presume the FDE will then take over - perhaps with another animated lift with a power (throttle) trigger?

Why do you need tick18 animation for the rotors - why not use conventional prop0_still, slow and blurred? I presume the tick18 animation needs a link to dummy visibility parts. That sound more complicated than it needs to be.

John
User avatar
SeanG
Captain
Captain
Posts: 360
Joined: 11 May 2008, 05:22
Version: P3D
Location: Christchurch, New Zealand
Contact:

Re: Custom Animations, GMax

Post by SeanG »

My grand plan is for the rotors to start up with the beacon trigger.. then the lift animation will happen with engine start (therefore I'm not using stock prop animation) so that the rotors will appear to start up prior to the lift to hover.... after that... more playing with triggers and variables ;-) I'm just experimenting with ideas, fortunately I'm a better coder than I am a modeller! I hope to add some pitch animation to simulate acceleration/deceleration... But even as it sits, lifting up, hover taxiing to the runway then looking like a fixed wing will do for this obscure aircraft. After all, I am probably the only person who will want one for any project!

SeanG
Image
jgowing
Captain
Captain
Posts: 226
Joined: 08 Oct 2008, 12:36
Version: FS9
Location: EGLM

Re: Custom Animations, GMax

Post by jgowing »

There's always room for another helicopter! I'll bet there's more interest than you think.. and I'm very interested in how you fare with pitch animation, as I'm struggling with an FSDS Alouette at the moment.

Jon G
User avatar
John Young
MAIW Developer
MAIW Developer
Posts: 4206
Joined: 12 Jul 2008, 15:15

Re: Custom Animations, GMax

Post by John Young »

The beacon trigger and engine start occur at the same time (or very nearly), so I can't quite see the point in the tick18 animation on the rotors. However, you could spin them 15 minutes prior to the initial lift with a Nav light trigger. More realistically, you could use the timer code that Kevin developed to spin them at say, 2 or 3 minutes before the hover-taxi kicks in, timed from the Nav lights trigger.

Kevin also has a block of code for rotor tilt for pitch animation. Still rotors also look so much better with a droop in them.

John
User avatar
SeanG
Captain
Captain
Posts: 360
Joined: 11 May 2008, 05:22
Version: P3D
Location: Christchurch, New Zealand
Contact:

Re: Custom Animations, GMax

Post by SeanG »

Nav lights... sorry, that's what I meant to say... :)
And I've never played with timers in XML... that's next!

Sean
Image
User avatar
Weescotty
MAIW Developer
MAIW Developer
Posts: 2770
Joined: 11 Aug 2006, 22:15
Version: FS9
Location: Sydney

Re: Custom Animations, GMax

Post by Weescotty »

Timers in XML.....
Ah.

All methods require a way of storing a value.
L:Var is what a user aircraft can use.
These don't work on AI aircraft.

There are s and l operators (store and load) but they need to be refreshed every code execution.

There is one group of other variables than can store and keep a value, but more usefully AI aircraft respond to them. They also initialise at 0, and are mentioned in the SDK.

NOTE - for FSX they do not initialise at 0, I have been unable to find out what they do start at. The only check that works is 0 != .

They are coded much the same as say .NET or Basic and can use either an initial value from the time, or one supplied which is then incremented or decrementend.
Something to remember if you use a counter it is approx 17 to 18 code 'runs' per second. So an initial value of 170 decrementend by 1 each run results in a countdown of approx 10 seconds.
User avatar
SeanG
Captain
Captain
Posts: 360
Joined: 11 May 2008, 05:22
Version: P3D
Location: Christchurch, New Zealand
Contact:

Re: Custom Animations, GMax

Post by SeanG »

Weescotty wrote: 04 Mar 2017, 22:29 Timers in XML.....
Ah.

All methods require a way of storing a value.
L:Var is what a user aircraft can use.
These don't work on AI aircraft.

There are s and l operators (store and load) but they need to be refreshed every code execution.

There is one group of other variables than can store and keep a value, but more usefully AI aircraft respond to them. They also initialise at 0, and are mentioned in the SDK.

NOTE - for FSX they do not initialise at 0, I have been unable to find out what they do start at. The only check that works is 0 != .

They are coded much the same as say .NET or Basic and can use either an initial value from the time, or one supplied which is then incremented or decrementend.
Something to remember if you use a counter it is approx 17 to 18 code 'runs' per second. So an initial value of 170 decrementend by 1 each run results in a countdown of approx 10 seconds.
Thank you sir! Time for me to play and see what sort of mischief I can create ;-)

SeanG
Image
User avatar
Weescotty
MAIW Developer
MAIW Developer
Posts: 2770
Joined: 11 Aug 2006, 22:15
Version: FS9
Location: Sydney

Re: Custom Animations, GMax

Post by Weescotty »

Lets see if this is of any use to you....

One of the problems with rotor or prop tie-downs is that the part stops at a random rotation.

To get this to work you need to rename the slow/stopped prop to AI_PROP_STILL_ENG1, you also need the other two prop state parts.

Use these keyframes and XML

100 keyframes...
0 - 0 degrees
25 - 90 degrees
50 - 180 degrees
75 - 270 degrees
100 - 360 degrees (same as 0)

<part>
<name>AI_PROP_STILL_ENG1</name>
<visible_in_range>
<parameter>
<code>
(A:PROP MAX RPM PERCENT:1,percent) 6.25 &lt;
if{ 1 } els{ 0 }
</code>
</parameter>
<minvalue>1</minvalue>
</visible_in_range>
<animation>
<parameter>
<code>
0.05 6.25 (A:PROP MAX RPM PERCENT:1,percent) rng
if{ (A:PROP MAX RPM PERCENT:1,percent) 6 * (E:ABSOLUTE TIME,second) * 360 % }
els{ 0 }
</code>
<lag>100</lag>
</parameter>
</animation>
</part>

The prop/rotor will ALWAYS stop at frame 0.

This is partly what I came up with for John Strinsoms V-22 Osprey to ensure the props always stopped ready to be folded.
Post Reply