The download hangar is currently disabled. We're doing our best to bring it back as soon as possible.

AI KC-30A

Discussion, tutorials,hints and tips relating to designing military ai aircraft.
User avatar
Bell 209
First Lieutenant
First Lieutenant
Posts: 101
Joined: 27 Aug 2006, 11:32
Version: FSX
Location: Nambour, QLD, Australia

AI KC-30A

Post by Bell 209 »

Firebird wrote:There is always time for a KC-30, Rob. :D

How's that for encouragement. :lol:
I'm not happy with the leading edge flaps, the gear won't behave (doesn't compress as it should in the sim) and I can't think of a suitable key to make the refuelling pod turbines spin when the aircraft is moving through the air. Graham King's done a preliminary paint but I have too much ORBX scenery stuff on my plate at the moment...

Here's where I'm at so far, any help gratefully accepted!
Attachments
ScreenMate_2.jpg
ScreenMate_1.jpg
User avatar
MIKE JG
MAIW Developer
MAIW Developer
Posts: 10976
Joined: 12 Aug 2006, 02:25
Version: MSFS

Re: AI KC-30A

Post by MIKE JG »

Rob I wouldn't sweat the gear compression. I know we can help with the XML bits and part names. Most of that should be the same as in FSDS.

Nick has the little props spinning on this refueling version of his SuperHornet so I'm sure he can offer some advice.
-Mike G.

Recovering flight sim addict, constant lurker.

Check out my real life RV-8 build here: RV-8 Builder Log
User avatar
Bell 209
First Lieutenant
First Lieutenant
Posts: 101
Joined: 27 Aug 2006, 11:32
Version: FSX
Location: Nambour, QLD, Australia

Re: AI KC-30A

Post by Bell 209 »

Yeah, names are the same as FSDS (that's what FS looks for). Thanks for the offer, I could be coaxed if there is help available...
User avatar
MIKE JG
MAIW Developer
MAIW Developer
Posts: 10976
Joined: 12 Aug 2006, 02:25
Version: MSFS

Re: AI KC-30A

Post by MIKE JG »

All you have to do is ask. :wink:
-Mike G.

Recovering flight sim addict, constant lurker.

Check out my real life RV-8 build here: RV-8 Builder Log
User avatar
Bell 209
First Lieutenant
First Lieutenant
Posts: 101
Joined: 27 Aug 2006, 11:32
Version: FSX
Location: Nambour, QLD, Australia

Re: AI KC-30A

Post by Bell 209 »

Okay...can someone please help me out with the animation of the refuelling pod turbines? I want them to turn when the aircraft moves at speed (takeoff roll to landing roll) but be still during taxi/aircraft stopped. I also need a hand with the gear compression; it won't work in the sim but is fine in GMax. I'd post the source file but I know most people here use FSDS.
User avatar
MIKE JG
MAIW Developer
MAIW Developer
Posts: 10976
Joined: 12 Aug 2006, 02:25
Version: MSFS

Re: AI KC-30A

Post by MIKE JG »

I don't know how Nick did it but I would try it by creating two separate parts for the little prop. One that is just a static part and one that is animated using the "prop_slow" name. Then use a conditional visibility XML code to have the static one hidden at a given parameter and have the prop slow version visible during that same parameter.

I've seen the guys here use anything from a z body velocity value to certain aircraft lights or switch positions. You might even find a ready made code over at the Free Flight Design Forums in their XML section.
-Mike G.

Recovering flight sim addict, constant lurker.

Check out my real life RV-8 build here: RV-8 Builder Log
User avatar
Bell 209
First Lieutenant
First Lieutenant
Posts: 101
Joined: 27 Aug 2006, 11:32
Version: FSX
Location: Nambour, QLD, Australia

Re: AI KC-30A

Post by Bell 209 »

Tried that one. The prop_stopped version looks fine but as soon as the engines start, so does the prop_slow part. I think it needs a conditional key but I don't know how to do that.
User avatar
MIKE JG
MAIW Developer
MAIW Developer
Posts: 10976
Joined: 12 Aug 2006, 02:25
Version: MSFS

Re: AI KC-30A

Post by MIKE JG »

Yes it needs a conditional XML visibility, actually they both would. Let's say you wrote a code based off of the aircraft's speed. You could use the parameter of z body velocity to hide or display the prop parts. I'd have to research the conditions under which FS9 uses the prop_still, versus prop_slow, prop_blurred to see when each one of those is used.

But the basic principle of it would be that you make at static prop part. You only want to see it when the aircraft is moving slowly or not moving at all. So you would write a code so that this part is only visible below a certain z body velocity, say 20 kts for example. Then make a second part, probably use prop_blurred for this one, and write another XML visibility code so that this prop_blurred part is only visible when the z body velocity is above 20 knots.

So for one visible part on the model, you would actually need two parts, the static prop and the flat disc that is used as the prop blurred in motion part. Each of these two parts would need it's own XML visibility code so that they would only show up above or below that specific speed.

If you've worked with XML before it should be fairly easy to do. If not, just say so, we'll get you up to speed. They have a dedicated XML code thread over at the Free Flight Design forums that you can look through to see if you can find a z body velocity conditional visibility code. If not, I know we have a couple floating around here somewhere.

I'm not even close to the expert on this, the other modelers have far more experience with it than I do.
-Mike G.

Recovering flight sim addict, constant lurker.

Check out my real life RV-8 build here: RV-8 Builder Log
User avatar
Bell 209
First Lieutenant
First Lieutenant
Posts: 101
Joined: 27 Aug 2006, 11:32
Version: FSX
Location: Nambour, QLD, Australia

Re: AI KC-30A

Post by Bell 209 »

Thanks Mike,

I've only used xml before on gauges and haven't a clue how to encode it in GMax. Any help from anyone would be appreciated.
User avatar
MIKE JG
MAIW Developer
MAIW Developer
Posts: 10976
Joined: 12 Aug 2006, 02:25
Version: MSFS

Re: AI KC-30A

Post by MIKE JG »

Look in your main MakeMdl SKD folder for a file named MakeMdl.parts.txt

If you see that in there, you're in good shape, that is the file that we modify to enable all of these fancy XML tricks and annimations.

When the model is ready to be compiled using MakeMdl you can check an optional box that tells MakeMdl to look for that file as part of the compilation process.

I need to hit the sack for tonight but the guys who live in Europe will be up soon so they might chime in. Otherwise I'll be back in the morning, US, time, probably about the time you are asleep again. :? Darn this internet thingy.

But if you can find that file mentioned above, we can get you started.
-Mike G.

Recovering flight sim addict, constant lurker.

Check out my real life RV-8 build here: RV-8 Builder Log
User avatar
Dark Morelia
Captain
Captain
Posts: 248
Joined: 15 Feb 2007, 04:02
Version: FS9
Location: Hervey Bay, Australia
Contact:

Re: AI KC-30A

Post by Dark Morelia »

The screens are a bit small and way too compressed to see much detail, but it looks very promising from what I can see! :mrgreen:

Tick18 would be the thing to use for the animation I think, that way you have a constant, controlled speed animation that you can't get by naming it as a prop.
Just animate the part as per usual tick18 keyframing, name it something like tick18_twirly_thing and make a non-animated version called something like twirly_thing_still and xml them to be visible or not using whatever params you need, like tick18_twirly_thing at over 10,000ft, and twirly_thing_still at under 10,000. (example, obviously) There's a ton of params that work with AI aircraft, so I'm sure something suitable can be found :wink:

As Mike said, applying xml to a model is simply a matter of opening in notepad and creating a new <part> entry in the MakeMDL.parts.xml file in the MakeMDL folder (wherever that's located on your system)
Drew >>

Image
User avatar
Bell 209
First Lieutenant
First Lieutenant
Posts: 101
Joined: 27 Aug 2006, 11:32
Version: FSX
Location: Nambour, QLD, Australia

Re: AI KC-30A

Post by Bell 209 »

Just pretend I know nothing about custom animations and explain again? :lol:

I tried Tick 18, too but didn't do the custom xml thing. Someone will need to walk me through that...
User avatar
Firebird
MAIW Admin
MAIW Admin
Posts: 12132
Joined: 11 Aug 2006, 21:04
Version: FS9
Location: EGLL

Re: AI KC-30A

Post by Firebird »

Rob,I am not going to be able to help as far actual animation is concerned, but I agree about the conditional part.
I think though that a simple if not totally realistic way of doing it, is to have the prop dead stop as normal, but have the animation come in when the strobe light is on. This would mean that it would animate from when it was cleared for take off until it exits the runway.

Does this work for you, or would you prefer the speed as the deciding parm instead?
Steve
_______________________________________________________
Image
Quid Si Coelum Ruat
_______________________________________________________
User avatar
Bell 209
First Lieutenant
First Lieutenant
Posts: 101
Joined: 27 Aug 2006, 11:32
Version: FSX
Location: Nambour, QLD, Australia

Re: AI KC-30A

Post by Bell 209 »

Hadn't thought about the strobe lights; that would probably work (the turbines would still spin at the threshold but I could live with that). Speed coding would be best if it can be achieved.
User avatar
Firebird
MAIW Admin
MAIW Admin
Posts: 12132
Joined: 11 Aug 2006, 21:04
Version: FS9
Location: EGLL

Re: AI KC-30A

Post by Firebird »

It can most definitely, Rob.
I was just going for a slightly easier solution. I would suggest that the speed be over 30kts as some people have their taxi speeds set this high.
Steve
_______________________________________________________
Image
Quid Si Coelum Ruat
_______________________________________________________
User avatar
MIKE JG
MAIW Developer
MAIW Developer
Posts: 10976
Joined: 12 Aug 2006, 02:25
Version: MSFS

Re: AI KC-30A

Post by MIKE JG »

Bell 209 wrote:Just pretend I know nothing about custom animations and explain again? :lol:
I tried Tick 18, too but didn't do the custom xml thing. Someone will need to walk me through that...

Probably the easiest way to approach it is to get the little props spinning like you want. Now that I think about it, AI models do not use "prop_slow". It's either full on or off using "prop_still" or "prop_blurred". If the engine is on, then the AI will use "prop_blurred".

So that being the case, if you use the normal prop names, you may not be able to control the parts even with XML codings as it may interfere with the default part names that FS uses. So you may have to make the parts and use unique names for both of them.

What I would do is to model the non moving prop part and just make up a name for it that you will remember. The nice thing is that you will be able to simply make the other pod's little prop parts, children parts of the main ones that you are making, so you should only have to write the XML code for one prop and then the others will follow suit as they will be child parts of the main ones.

Find that xml text file I mentioned, it should be in the main MakeMdl SDK folder that you have to install in order to make use of the MakeMdl compiler. Name is MakeMDL.parts.xml

That file comes by default as a read only file that can't be modified. You have to double check its properties and make sure that the read only attribute in not enabled. This will prevent you from modifying it if it is. No one bothered to share that tidbit with me and I spent an entire day pulling my hair out trying to figure out why I couldn't modify that file. Once you have made sure that it is no longer a read only file, you should be able to right click on it and choose "edit". This should open up in a text editor like Notepad.

If you can do that, you're in good shape. This is what the top portion will look like:

<?xml version="1.0" encoding="utf-8"?>

<!--

Notes on certain tags:

SIM: Converts simvar to keyframes: simvar * scale + bias = keyframes

CALLBACK_JUMP_DRAGGING: Units are in pixels.

CALLBACK_DRAGGING: Converts simvar units to event units, which are the units of the internal variable.
scale: Scales from simvar units to event units
yscale: Scales movement delta in pixels to event units
minvalue: min event value in event units
maxvalue: max event value in event units

CODE: Written in postfix stack-based language.

TOOLTIP_TEXT: Convert code to text using %(code) construct. Use %!d! construct to printf.

G:Variables: Global to file. Not shared by 2d and VC.

L:Variables: Global and shared by both 2d and VC. Use these instead of G:Variables.

Part names: Must NOT have trailing "_#". This will be stripped off by makemdl.

Some units:
percent: 0 - 100
part: 0 - 1
position: 0 - 1
-->

<part_dictionary>
-Mike G.

Recovering flight sim addict, constant lurker.

Check out my real life RV-8 build here: RV-8 Builder Log
User avatar
MIKE JG
MAIW Developer
MAIW Developer
Posts: 10976
Joined: 12 Aug 2006, 02:25
Version: MSFS

Re: AI KC-30A

Post by MIKE JG »

The first entry underneath the <part_dictionary> is an entry for a part named "switch_master_battery". That is the first default part entry that FS9 will use in the creation of a model. I don't think that AI models make use of a lot of those entries but DO NOT overwrite or delete ANY of them. They must ALL stay in that text file whatever you do. So when we are ready to add our own XML code, make sure you only add it ABOVE that first default entry. The name of this file "MakeMDL.parts.xml" must also not be changed. So you can only have one XML file for one model at a time. This is why you should just right click on the file and choose the "edit" function. This way your OS should not ask you what name you want to call this file, it should just retain this original name. If the name gets changed, none of this will work.

So if you are with me so far, we are ready to try the first bit of XML code for your static prop part. There are two types of XML codes you can use. One is a conditional visibility code that makes a part either visible or not visible based on the conditions you set in the XML blurb. The other is a conditional animation code that makes a certain animation visible based on the XML blurb. So between these two types we can do just about anything we need to for an AI model. Things like flaps, slats, reversers, etc. would use the conditional animation code to make those animations occur only during specific times. Thinks like wheel chocks, engine covers, pitot covers, etc would make use of the conditional visibility code to have them only show up during certain conditions, like engines off, beacon light off, etc.

I'm headed out again but to get a grasp on how XML works for parts, you can read this little post by one of the members of the Eaglesoft Development team. It explains the anatomy of an XML parts code:

http://www.aerodynamika.com/cgi-bin/yab ... 1129865563

More later.
-Mike G.

Recovering flight sim addict, constant lurker.

Check out my real life RV-8 build here: RV-8 Builder Log
User avatar
MIKE JG
MAIW Developer
MAIW Developer
Posts: 10976
Joined: 12 Aug 2006, 02:25
Version: MSFS

Re: AI KC-30A

Post by MIKE JG »

We need an XML code that will allow your static prop to only be seen below say 35kts. So for that we can make use of a conditional visibility XML code. This will only allow that part to be seen under the conditions that we define.

In this case any time the model is at a speed less than 35 knots, the static part will be seen and the rotating part will not be seen.

Here is a code that I found that might do the trick, there is always a bit of trial and error to these things so we'll see if this works. The goal for now is to have the static prop part only showing when the model is less than 35 knots. Once it reaches that speed, the static prop should go away and for now, there won't be anything there. We'll fix that once we have the first bit taken care of.

<part>
<name>Your_Part_Name</name>
<visible_in_range>
<parameter>
<code>(A: VELOCITY BODY Z, knots)</code>
</parameter>
<minvalue>0</minvalue>
<maxvalue>35</maxvalue>
</visible_in_range>
</part>
-Mike G.

Recovering flight sim addict, constant lurker.

Check out my real life RV-8 build here: RV-8 Builder Log
User avatar
MIKE JG
MAIW Developer
MAIW Developer
Posts: 10976
Joined: 12 Aug 2006, 02:25
Version: MSFS

Re: AI KC-30A

Post by MIKE JG »

I have no idea if that will work, only one way to find out. Copy that bit and paste it into the MakeMDL.parts.xml file at the top just below the <part properties> tag. Make sure you leave that file in the MakeMDL SDK folder as that's where the MakeMDL compiler will look for it.

Make sure you change the name of the part in the XML bit to the name of the part for your little prop.

When you are ready to compile the model and run MakeMDL, you need to make sure that you can bring up the options tab. In that tab there should be a check box to include XML, make sure that box is checked.

Compile the model, boot up the sim and see if the part shows up. If so, try taking off and see if it disappears at around 35 knots. If so, we're in business.
-Mike G.

Recovering flight sim addict, constant lurker.

Check out my real life RV-8 build here: RV-8 Builder Log
User avatar
Bell 209
First Lieutenant
First Lieutenant
Posts: 101
Joined: 27 Aug 2006, 11:32
Version: FSX
Location: Nambour, QLD, Australia

Re: AI KC-30A

Post by Bell 209 »

Nope, visible all the time. I've also tried the anemometer part name as that would seem ideal with no luck.
Post Reply