Hello.
I'm practicing making AI helicopters.
I have a question.
It is a problem with the nose gun animation on the circle in the picture below.
I want to make it move(KEY FRAME) only during the flight. (ENG START)
I tried different XML codes but failed.
EX) With the application of TICK18 it moves all day long. ^ ^;;
Ask for help.
Thanks.
AI HELI NOSE GUN XML???
- clickclickdoh
- MAIW Developer
- Posts: 1568
- Joined: 03 Mar 2009, 03:04
Re: AI HELI NOSE GUN XML???
I think the trick would be to use a radar altimeter reading instead of the engine start variable....but the .xml specialists should know for certain.
- Fokket50
- MAIW Developer
- Posts: 212
- Joined: 31 Aug 2006, 13:38
- Version: FS9
- Location: The Netherlands
Re: AI HELI NOSE GUN XML???
one solution you can use, is too clone the nose gun, and use one as static that shows on the ground, and the second animated for in the air.
If you use 1 dummy part with visibility coding on the ground, and connect (make the dummy the parent) the static nose gun to this dummy part, then it will show on the ground only.
Then have the second dummy part with visibility coding in the air, and connect the tick18 moving nose gun to this dummy part, then it will show airborne.
The dummy part can be hidden in another part, so you will not see it. A small box can be sufficient.
The coding you can use would look like:
<part>
<name>dummypartground</name>
<visible_in_range>
<parameter>
<code>(A:LIGHT STROBE, bool) </code>
</parameter>
<minvalue>-1</minvalue>
<maxvalue>0</maxvalue>
</visible_in_range>
</part>
<part>
<name>dummypartairborne</name>
<visible_in_range>
<parameter>
<code>(A:LIGHT STROBE, bool) </code>
</parameter>
<minvalue>1</minvalue>
<maxvalue>1</maxvalue>
</visible_in_range>
</part>
I hope this is helpfull.
Menno
If you use 1 dummy part with visibility coding on the ground, and connect (make the dummy the parent) the static nose gun to this dummy part, then it will show on the ground only.
Then have the second dummy part with visibility coding in the air, and connect the tick18 moving nose gun to this dummy part, then it will show airborne.
The dummy part can be hidden in another part, so you will not see it. A small box can be sufficient.
The coding you can use would look like:
<part>
<name>dummypartground</name>
<visible_in_range>
<parameter>
<code>(A:LIGHT STROBE, bool) </code>
</parameter>
<minvalue>-1</minvalue>
<maxvalue>0</maxvalue>
</visible_in_range>
</part>
<part>
<name>dummypartairborne</name>
<visible_in_range>
<parameter>
<code>(A:LIGHT STROBE, bool) </code>
</parameter>
<minvalue>1</minvalue>
<maxvalue>1</maxvalue>
</visible_in_range>
</part>
I hope this is helpfull.
Menno
Re: AI HELI NOSE GUN XML???
Dear Menno.Fokket50 wrote: ↑17 Jan 2018, 10:47 one solution you can use, is too clone the nose gun, and use one as static that shows on the ground, and the second animated for in the air.
If you use 1 dummy part with visibility coding on the ground, and connect (make the dummy the parent) the static nose gun to this dummy part, then it will show on the ground only.
Then have the second dummy part with visibility coding in the air, and connect the tick18 moving nose gun to this dummy part, then it will show airborne.
The dummy part can be hidden in another part, so you will not see it. A small box can be sufficient.
The coding you can use would look like:
<part>
<name>dummypartground</name>
<visible_in_range>
<parameter>
<code>(A:LIGHT STROBE, bool) </code>
</parameter>
<minvalue>-1</minvalue>
<maxvalue>0</maxvalue>
</visible_in_range>
</part>
<part>
<name>dummypartairborne</name>
<visible_in_range>
<parameter>
<code>(A:LIGHT STROBE, bool) </code>
</parameter>
<minvalue>1</minvalue>
<maxvalue>1</maxvalue>
</visible_in_range>
</part>
I hope this is helpfull.
Menno
Thank you very much.
It works very well.
It's great.
Happy Flight~~~
Mins
Mins
- Victory103
- Colonel
- Posts: 3979
- Joined: 13 Aug 2007, 03:35
- Version: P3D
- Location: KPHX
Re: AI HELI NOSE GUN XML???
mins, is that a first look at a special project in work?
DUSTOFF
ARMY PROPS
NAVY SAR
-Chris
ARMY PROPS
NAVY SAR
-Chris
Re: AI HELI NOSE GUN XML???
Forget about cloning it just adds polys when they aren't needed.
Use (A:RADIO HEIGHT,feet), also instead of tick 18 use a looped animation (first and last keyframe must be the same).
So assuming 100 frames with 0 and 100 the same
<part>
<name>YOU_PART_NAME_HERE</name>
<animation>
<parameter>
<code>
(A:RADIO HEIGHT,feet) 500 <
if{ 0 (>G:Var1) 0 }
els{ (G:Var1) ++ 100 % (>G:Var1) (G:Var1) }
</code>
<lag>50</lag>
</parameter>
</animation>
</part>
Under 500ft the gun would be at keyframe 0 (parked position I would guess).
Over 500ft it would continuosly loop through keyframes 0 to 100 over and over again.
Change the 500 on the first line of code to change when it starts looping.
Lag controls how fast the animation 'runs' you just have to experiment to find the best value as it changes with each animation.
Use (A:RADIO HEIGHT,feet), also instead of tick 18 use a looped animation (first and last keyframe must be the same).
So assuming 100 frames with 0 and 100 the same
<part>
<name>YOU_PART_NAME_HERE</name>
<animation>
<parameter>
<code>
(A:RADIO HEIGHT,feet) 500 <
if{ 0 (>G:Var1) 0 }
els{ (G:Var1) ++ 100 % (>G:Var1) (G:Var1) }
</code>
<lag>50</lag>
</parameter>
</animation>
</part>
Under 500ft the gun would be at keyframe 0 (parked position I would guess).
Over 500ft it would continuosly loop through keyframes 0 to 100 over and over again.
Change the 500 on the first line of code to change when it starts looping.
Lag controls how fast the animation 'runs' you just have to experiment to find the best value as it changes with each animation.
Re: AI HELI NOSE GUN XML???
No. No.
This is just to practice the FSDS.
I don't have the skills to do a project.
Happy Flight~~~
Mins
Mins
Re: AI HELI NOSE GUN XML???
Thank very much Weescotty.Weescotty wrote: ↑17 Jan 2018, 21:20 Forget about cloning it just adds polys when they aren't needed.
Use (A:RADIO HEIGHT,feet), also instead of tick 18 use a looped animation (first and last keyframe must be the same).
So assuming 100 frames with 0 and 100 the same
<part>
<name>YOU_PART_NAME_HERE</name>
<animation>
<parameter>
<code>
(A:RADIO HEIGHT,feet) 500 <
if{ 0 (>G:Var1) 0 }
els{ (G:Var1) ++ 100 % (>G:Var1) (G:Var1) }
</code>
<lag>50</lag>
</parameter>
</animation>
</part>
Under 500ft the gun would be at keyframe 0 (parked position I would guess).
Over 500ft it would continuosly loop through keyframes 0 to 100 over and over again.
Change the 500 on the first line of code to change when it starts looping.
Lag controls how fast the animation 'runs' you just have to experiment to find the best value as it changes with each animation.
That's a great way to do it.
and I don't know why, but it goes well up and down, but it doesn't go well on the left and right.
Sway to one side(left).
I'll have to study it a little bit more.
Thank you all very much for being so helpful anyway.
Happy Flight~~~
Mins
Mins
Re: AI HELI NOSE GUN XML???
You have to keyframe the positions you would like it to go through.
It will then go from one position to the next over and over. Same as you would keyframe a tick18 animation.
Big difference is it ONLY runs when the aircraft is over the height you choose, and when it drops back under that height it returns to keyframe 0 (parked position).
tick18 using visibility it jumps back.
You can also increase the length of the animation by changing the 100 on the els line to -
for example 200 and keyframing to 200.
I think I know what your problem might be...
Its two seperate parts? One for left to right and the gun up and down?
If you called them -
cobra_gun.turret - keyframe that left and right
cobra_gun.barrel - keyframe that up and down
on the XML change the name to -
<name>cobra_gun</name>
The one piece of code runs both animations.
It will then go from one position to the next over and over. Same as you would keyframe a tick18 animation.
Big difference is it ONLY runs when the aircraft is over the height you choose, and when it drops back under that height it returns to keyframe 0 (parked position).
tick18 using visibility it jumps back.
You can also increase the length of the animation by changing the 100 on the els line to -
for example 200 and keyframing to 200.
I think I know what your problem might be...
Its two seperate parts? One for left to right and the gun up and down?
If you called them -
cobra_gun.turret - keyframe that left and right
cobra_gun.barrel - keyframe that up and down
on the XML change the name to -
<name>cobra_gun</name>
The one piece of code runs both animations.