Military AI Works • A.I. flaps question
Page 1 of 2

A.I. flaps question

Posted: 14 May 2021, 07:47
by YoYo
It's me again, maybe some are fed up with me ;) but lately Im tweaking AI traffic. :oops:
One thing bothers me - I noticed that some of models, which have flaps, have it on down position from the start the sim and during the flight too (!). I can solve it but fixing animation (turn it off on zero position by MCX) but maybe there is some other way to the correct operation of the flaps or is it normal for AI traffic?

Image

Image

Re: A.I. flaps question

Posted: 14 May 2021, 09:11
by John Young
There's a variety of xml code for different configurations, unless you just want default flaps.

What do you want to achieve?

John

Re: A.I. flaps question

Posted: 14 May 2021, 10:06
by Firebird
Also one question that occurs is whether the flaps down aircraft are flyable ones that yo are trying to turn into AI aircraft?

Re: A.I. flaps question

Posted: 14 May 2021, 10:56
by John Young
The two screen shots show flaps down when parked, which is not unusual. That's achievable too with AI, but it's a bit more complicated. Just post what configuration you want for your aircraft and I'll dig out some FSX/P3D code if you would like it.

John

Re: A.I. flaps question

Posted: 14 May 2021, 12:09
by YoYo
John Young wrote: 14 May 2021, 10:56 The two screen shots show flaps down when parked, which is not unusual. That's achievable too with AI, but it's a bit more complicated. Just post what configuration you want for your aircraft and I'll dig out some FSX/P3D code if you would like it.

John

Just two position will be very ok - closed (0 position) for parking and in the air and something open (30-45deg?) for landing and take off if its possible :).

Re: A.I. flaps question

Posted: 14 May 2021, 14:40
by John Young
You might as well just tag the flaps as the default for FSX/P3D then - "l_flap_key" and "r_flap key". KF0=up. KF100=down. You can set the deflection in the animation, or possibly just use the values in the aircraft.cfg file.

Are you OK with animation tagging? It's only a feature of FSX and P3D? FS9 just uses the part names.

John

Re: A.I. flaps question

Posted: 14 May 2021, 19:00
by YoYo
So something like this? Right flap example:

Image

I'll check it. TY.

Re: A.I. flaps question

Posted: 14 May 2021, 19:10
by John Young
Yes, give that a try. "r_flap_percent_key", I think forces the aircraft.cfg flap settings, but since I never use it, I can't quite remember.

John

Re: A.I. flaps question

Posted: 14 May 2021, 19:27
by YoYo
Ok, what is good now they are at "0":

Image

So looks better, the worst thing - always ;) (so not for take off e.g.) but its not a big problem, or maybe I need to add something in cfg? But it sure looks better now. Great.

Re: A.I. flaps question

Posted: 14 May 2021, 21:19
by John Young
This is the xml for flaps I use most.

This gives flaps half down for taxi and take-off and up for flight. On approach the flaps come back down to half and full flap on finals. Once the aircraft leaves the runway, the flaps go up to half for taxi and fully up when parked. The key variable is the trigger speed which is set in the code to 155 knots, but will need to be adjusted for your aircraft:

<Animation name="ai_flaps_half_at_taxi" guid="88E4F680-E313-47c2-B85D-E22553963614" length="100" type="Sim" typeParam2="ai_flaps_half_at_taxi" typeParam="AutoPlay" />

<PartInfo>
<Name>ai_flaps_half_at_taxi</Name>
<AnimLength>100</AnimLength>
<Animation>
<Parameter>
<Code>
(A:VELOCITY BODY Z, knots) 155 &lt; (A:FLAPS HANDLE PERCENT, percent) 0 &gt; + 50 * (A:LIGHT BEACON, bool) *
</Code>
<Lag>10</Lag>
</Parameter>
</Animation>
</PartInfo>

KF:0 = up, KF:50 = half down, KF100 = fully down.

I don't know how you set that up in the programs you are using but in Gmax I would just add the code to my modeldef.xml file to create a new animation tag.

John

Re: A.I. flaps question

Posted: 15 May 2021, 08:21
by YoYo
Thx John, I have come to the point that I can add it and create xml file - however, yes, looks like Gmax is necessary to add this file to the model. I have and use only MCX.

Image

Ok, it's not that important, I've already checked in a few flights and flaps are always closed, so it's still a big success for me and looks more natural in the flight ;).

Re: A.I. flaps question

Posted: 15 May 2021, 09:57
by John Young
It shouldn't be because members of the conversion regularly use custom xml. Is that why perhaps, that the animated lift appears to be not working on your conversion of Mins's Huey? Strange though because the hover-taxi xml is working and that uses similar custom xml.

No problem though, come back if you need any further help.



John

Re: A.I. flaps question

Posted: 15 May 2021, 11:29
by YoYo
Ok, I'm starting to understand these xml: http://www.calclassic.com/convert_tutorial/part1.html . It looks like I saved it (new for flaps) in wrong place after modification (not overwriting this orginal one). I'll check it, thx for the tip :smt006 .

Re: A.I. flaps question

Posted: 15 May 2021, 13:57
by YoYo
Next step forward :) . It started to work for me finally. I did new conversion of model (DC6) and checked here. It works but with oposite side. Parking - ok, down, taxi and take off - up, bigger speed 1/2:

Image

Image

Image

So looks like it works ok but I must to check why vice versa.

I added this to lines:

Image

Next in MCX animator I added (I saw this name, new entry) it to flaps.

Re: A.I. flaps question

Posted: 15 May 2021, 15:07
by John Young
Yes that's the way to do it. If the flaps are operating in the wrong direction, just reverse the animation.

John

Re: A.I. flaps question

Posted: 15 May 2021, 15:30
by YoYo
Thx. I'm closer the light from the tunnel. :wink:

I found this advice for this: https://www.fsdeveloper.com/forum/threa ... ost-780708 (post of TeamNutmeg).

Image

So to be sure - I must revers red part (eg when is 0.000 on the top must be 100.00) from this? Green part looks the same (just see "-" on some parts).

Re: A.I. flaps question

Posted: 15 May 2021, 15:39
by John Young
No, I meant reverse the animation in the model.

In Gmax, the code works with the following key frames as I said: KF:0 = up, KF:50 = half down, KF100 = fully down.

If MCX does something different, can you reverse the animation in the model, so KF:0 is down etc?

John

Re: A.I. flaps question

Posted: 15 May 2021, 16:00
by YoYo
With my post above it looks now like this, full reverse :lol: :

Image
John Young wrote: 15 May 2021, 15:39 If MCX does something different, can you reverse the animation in the model, so KF:0 is down etc?
Hard to tell me is here option like this, I dont see it:

Image

Re: A.I. flaps question

Posted: 15 May 2021, 16:12
by John Young
Sorry, I can't advise on the way you are doing things because I have no knowledge of MCX for converting aircraft. I can only say that the code works in Gmax with the key frames as I gave them to you. You really need to contact one of the conversion team for advice.

John

Re: A.I. flaps question

Posted: 15 May 2021, 16:35
by YoYo
Thx John, you have helped me so much. :smt006

Finally I found this option, its present:

Image

but unfortunately in this model I have flaps above the wing now, as in the screen below, as if there was no lock at 0 so it works with revers not like 0 to 50 but from 0 to -50.

Image

I see some kind of editor is here too:

Image

I guess I have to turn them off though. I'll check only the Rot X option here, I see it causes the flap to go over the wing in animation.