Need help with Elevator XML

Discussion, tutorials,hints and tips relating to designing military ai aircraft.
Post Reply
User avatar
gavinc
MAIW Conversion Team
MAIW Conversion Team
Posts: 324
Joined: 25 Aug 2013, 09:26
Version: FSX

Need help with Elevator XML

Post by gavinc » 05 Feb 2018, 15:42

Hi Folks
Can someone who knows more about xml than me (ie everyone) give me a hand?
I am converting the NBAI F-22 to P3D and need a bit of assistance with the tail surfaces.

Nick modeled the engine outlets that move along with the tail.
Image

I would also like to model the tail droop when the aircraft is parked (like this)
Image

This bit of code works great for the moving tail

<PartInfo>
<Name>elevator_key</Name>
<AnimLength>100</AnimLength>
<Animation>
<Parameter>
<Sim>
<Variable>ELEVATOR DEFLECTION</Variable>
<Units>grads</Units>
<Bias>50</Bias>
</Sim>
</Parameter>
</Animation>
</PartInfo>


and this bit of code works great to droop the tail when parked
<Name>custom_anim_F16_Elevator</Name>
<AnimLength>100</AnimLength>
<Animation>
<Parameter>
<Code>
(A:GROUND VELOCITY,knots) 0 !=
(A:LIGHT BEACON,bool) or
if{ A:ELEVATOR DEFLECTION PCT, percent) -0.5 * 50 + }
els{ (A:ELEVATOR DEFLECTION PCT, percent)}
</Code>
<Lag>30</Lag>
</Parameter>
</Animation>
</PartInfo>

My problem is trying to combine them.

All help gratefully received.

thanks
Gavin

User avatar
Firebird
MAIW Admin
MAIW Admin
Posts: 12123
Joined: 11 Aug 2006, 21:04
Version: FS9
Location: EGLL

Re: Need help with Elevator XML

Post by Firebird » 05 Feb 2018, 16:00

I am a big fan of the KISS principal so my initial thought is if both bits of code work as you want them to, why combine them to make one complicated statement that could be troublesome to troubleshoot?

Are you trying to get the engine outlets to droop as well on the ground?

I realise that I could be being thick today in not seeing an issue.
Steve
_______________________________________________________
Image
Quid Si Coelum Ruat
_______________________________________________________

User avatar
clickclickdoh
MAIW Developer
MAIW Developer
Posts: 1570
Joined: 03 Mar 2009, 03:04

Re: Need help with Elevator XML

Post by clickclickdoh » 05 Feb 2018, 17:21

Firebird wrote:
05 Feb 2018, 16:00
Are you trying to get the engine outlets to droop as well on the ground?
FYI: If this is the case, the F-22 vectored thrust nozzles don't droop when the jet is cold. They spread.

User avatar
gavinc
MAIW Conversion Team
MAIW Conversion Team
Posts: 324
Joined: 25 Aug 2013, 09:26
Version: FSX

Re: Need help with Elevator XML

Post by gavinc » 05 Feb 2018, 19:45

Firebird wrote:
05 Feb 2018, 16:00
I am a big fan of the KISS principal so my initial thought is if both bits of code work as you want them to, why combine them to make one complicated statement that could be troublesome to troubleshoot?

Are you trying to get the engine outlets to droop as well on the ground?

I realise that I could be being thick today in not seeing an issue.
Sorry - not making myself clear. I can use one set of code or the other.

Nicks FS9 model just had the moving elevators, when parked they were level. I am trying to add the droop when parked.

Gavin

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

Re: Need help with Elevator XML

Post by Weescotty » 05 Feb 2018, 21:08

Try this....

<PartInfo>
<Name>custom_anim_F16_Elevator</Name>
<AnimLength>100</AnimLength>
<Animation>
<Parameter>
<Code>
(A:LIGHT BEACON,bool) !
if{ <DROOP KEYFRAME NUMBER HERE> }
else{ (A:ELEVATOR DEFLECTION PCT,percent) }
</Code>
<Lag>30</Lag>
</Parameter>
</Animation>
</PartInfo>


Info...
(A:LIGHT BEACON,bool) ! - Makes the beacon off condition TRUE
if{ <DROOP KEYFRAME NUMBER HERE> } - If TRUE (beacon off) goto parked keyframe
else{ (A:ELEVATOR DEFLECTION PCT,percent) } - If FALSE (beacon on) use the actual elevator postion.

Not sure why the -0.5 * 50 + is needed on the original code.

User avatar
gavinc
MAIW Conversion Team
MAIW Conversion Team
Posts: 324
Joined: 25 Aug 2013, 09:26
Version: FSX

Re: Need help with Elevator XML

Post by gavinc » 06 Feb 2018, 14:45

Thanks Weescotty
that worked. I needed to add the -0.5 * 50 back in for the elevators to come back to the neutral position when the lights came on.

Now on to the next challenge.

Gavin

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

Re: Need help with Elevator XML

Post by Weescotty » 06 Feb 2018, 20:03

That -0.5 * 50 + shouldn't be needed.

Try adding a keyframe at 50 with the elevators level and this slightly modded code....

<PartInfo>
<Name>custom_anim_F16_Elevator</Name>
<AnimLength>100</AnimLength>
<Animation>
<Parameter>
<Code>
(A:LIGHT BEACON,bool) !
if{ <DROOP KEYFRAME NUMBER HERE> }
else{ (A:ELEVATOR DEFLECTION PCT,percent) }
</Code>
<Bias>50</Bias>
<Lag>30</Lag>
</Parameter>
</Animation>
</PartInfo>

<Bias>50</Bias> - tells it the 'default' position for the animation is keyframe 50.
They should also function as elevators when the aircraft is flying.

Post Reply