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

AI Helos

Discussion, tutorials,hints and tips relating to designing military ai aircraft.
Post Reply
Angelus1971
Cadet
Cadet
Posts: 5
Joined: 31 Mar 2011, 08:22
Version: FSX

AI Helos

Post by Angelus1971 »

Hi

I've admired your new heli animation on takeoff and landing and wondered how its done properly.

I am able to build the animation into my models but what I need help with (please) is how to do the XML and where to attach it to in the model. On a specific part or the top level dummy or something else entirely.

I've tried going through the SDK and it is as clear as mud. I can code but I need a base to start learning from and the SDK is definitely not the place to be. Google and Bing have been searched to death and although they come up with code examples and bits of knowledge, they also assume I know the basics, which I freely admit at the moment, I do not.

How does the XML know where in the animation to start the effect? e.g. If the blades have started running and I want to lessen the blade droop?

Any help would be appreciated, preferably an idiots guide tutorial just to get me started. Pleeeeeeeeeeeeaaaaaaaaaaassssssssssse.
(Please don't suggest reading the SDK as it hasn't helped :( )

Thanks
User avatar
John Young
MAIW Developer
MAIW Developer
Posts: 4226
Joined: 12 Jul 2008, 15:15

Re: AI Helos

Post by John Young »

Kevin produced our xml code blocks for helicopters and designers here have made great use of it. I'd be happy to talk you through it, but I'd just like Kevin to approve that first since it's his code. I'm sure he will drive past here shortly.

The rotor blade droop is in the 3-D rotor (prop0_still). That only spins momentarily on an AI helicopter before the slow and the blurred disks take over. I don't think there's anyway of producing variable droop.

The lift code is applied to the airframe by assigning the custom part name from the code block. All other parts then need to be linked to the airframe so they lift with it.

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

Re: AI Helos

Post by Weescotty »

As John said...
You need a 'parent' poly (doesn't need to be a box, just a simple poly will do).
Parts get linked to that, and parts get linked to those parts. In the end either directly or through another part everything is linked to the parent poly.
You animate the parent poly to produce the lift.
keyframe 0 - on the ground
keyframe 100 - in the air

XML is where the magic happens, I'll give you a basic 'lift' code to get you started...

Call the parent poly - PARENT_POLY

Add this to your XML file -

<part>
<name>PARENT_POLY</name>
<animation>
<parameter>
<code>
(A:LIGHT STROBE,bool)
if{ 100 } els{ 0 }
</code>
<lag>60</lag>
</parameter>
</animation>
<part>

Compile and watch the aircraft in the sim, it should be in the hover as long as the strobe lights are on.
navychief88
Second Lieutenant
Second Lieutenant
Posts: 39
Joined: 19 Jul 2009, 00:11

Re: AI Helos

Post by navychief88 »

Is it possible to program auto-rotation practice into the flight plan of helos? If they are flying in the airfield circuit.
User avatar
VulcanDriver
MAIW Staff
MAIW Staff
Posts: 4508
Joined: 11 Aug 2006, 20:58
Version: FSX
Location: EGHH

Re: AI Helos

Post by VulcanDriver »

Don't think it is as the rotors are actually props in FS and as far as I know there isn't away to do that. Unless Kevin can think of an XML magic.
John

"That is the biggest fool thing we have ever done. The A-bomb will never go off, and I speak as an expert in explosives." - Admiral William Leahy
User avatar
Firebird
MAIW Admin
MAIW Admin
Posts: 12132
Joined: 11 Aug 2006, 21:04
Version: FS9
Location: EGLL

Re: AI Helos

Post by Firebird »

Even if you could do it with xml you would need all the models re-compiled with that xml code so realistically only new choppers could be used.
In reality, you would not be able to do it. The reason is that the xml would be triggered by variables and every time you hit those variables it would happen. This would mean that you would only get auto-rotates and as anybody who has done these knows that you only practice them over landing places and you would never get an approach that would allow you to be higher enough to make that manoeuvre possible.
Like run and breaks and pairs take offs,this is something that would need an overhaul of the AI engine and whilst in my dream world MS would make the FS9 code available to all in reality this won't happen.
Steve
_______________________________________________________
Image
Quid Si Coelum Ruat
_______________________________________________________
User avatar
VulcanDriver
MAIW Staff
MAIW Staff
Posts: 4508
Joined: 11 Aug 2006, 20:58
Version: FSX
Location: EGHH

Re: AI Helos

Post by VulcanDriver »

Nicely put Steve. We are battling with the MS FS9 and FSX AI engine all time.
John

"That is the biggest fool thing we have ever done. The A-bomb will never go off, and I speak as an expert in explosives." - Admiral William Leahy
Post Reply