Page 1 of 1
Animation - need a helping hand
Posted: 01 Mar 2010, 19:32
by gsnde
I am working on the animation of the F-104.
What I like to have:
While the aircraft is parked cold and dark, no pilot is visible and the canopy is closed. During pre-flight check the pilot gets visible and the canopy is open. The aircraft taxis to the runway with open canopy. Then the canopy closes and off it goes.
What I have:
While the aircraft is parked cold and dark, no pilot is visible and the canopy is closed. During pre-flight check the pilot gets visible and the canopy is open. The aircraft taxis to the runway with open canopy. Then the canopy
does not close and off it goes.
I fear that might be against some regulations and the pilot will catch a cold
This is the code I use:
<part>
<name>MIG23_canop</name>
<animation>
<parameter>
<code>
(A:LIGHT NAV, bool) 100 *
</code>
<lag>20</lag>
</parameter>
</animation>
</part>
Is it right that I need to add a "not LIGHT LANDING" condition to get what I want? If so, can somebody please tell me how the syntax for this boolean combine works?
Re: Animation - need a helping hand
Posted: 01 Mar 2010, 20:01
by Firebird
Well, very simply put Martin you describe 3 possible conditions, closed+no pilot, open+pilot and closed+pilot, but your code only has two possible outcomes, 0*100 or 1*100.
For three stages your animation will need three distinct key frames and then then the code will have to meet the requirements.
I have to ask why you don't split the two up. The pilot appears if the nav light is on, and the canopy is a separate item. The reason I say this is that the obvious code variables that work for taxying out and taking off, don't work easily for landing. The canopy will open after landing while still on the runway. I can provide you with some code to show this problem if you like.
Re: Animation - need a helping hand
Posted: 01 Mar 2010, 20:41
by gsnde
Steve,
Sorry, I was not precise enough when posting. The pilot works perfect and is dealt within another section.
<part>
<name>MIG25_Pilot</name>
<visible_in_range>
<parameter>
<code>
(A:LIGHT NAV,bool)
</code>
</parameter>
<minvalue>1</minvalue>
<maxvalue>2</maxvalue>
</visible_in_range>
</part>
What I want to have is that the canopy closes before takeoff. If I have understood all this correctly (which might very well not be the case) then it should go like this:
aircraft is not due to start -> canopy closed -> works ok
aircraft gets ready -> canopy open -> triggered by NAV light -> works ok
aircraft taxis to runway -> canopy open -> triggered by NAV light -> works ok
so far everything is like I want it, here comes the issue:
aircraft takes off -> canopy is still open
So I guess I have to add another condition to the one I already have which closes the canopy when takeoff takes place. My thinking is that the landing light would be a candidate (-> NAV light on and not landing light = canopy open, so when the landing light goes on it closes). But while I write this I fear that I need a third condition: while on ground:
canopy open = ('LIGHT NAV = TRUE' AND 'LIGHT LANDING = FALSE' AND 'SIM ON GROUND = TRUE')
1. Does this make sense?
2. How do I phrase the condition?
Re: Animation - need a helping hand
Posted: 01 Mar 2010, 21:17
by nickblack423
Martin,
It goes like this:
<part>
<name>anim_canopy_fresh_air</name>
<animation>
<parameter>
<code>
(A:LIGHT NAV, bool)
if{ (A:ENG1 COMBUSTION, bool)
if{ (A:LIGHT STROBE, bool) if{ 0 } els{ 25 } }
els{ 50 }
}
els{ 0 }
</code>
<lag>20</lag>
</parameter>
</animation>
</part>
This will allow that the canopy is closed at keyframe 0, fully open at keyframe 50 and slightly open at keyframe 25. What you need to do is animate it open at 25 as well and you're on a winner.
Nick
Re: Animation - need a helping hand
Posted: 01 Mar 2010, 21:33
by gsnde
Thank you, Nick - let me play with this a while, I might come back with another question.... OK, here I am
Can you enlighten me regarding the syntax question? How do I write the three AND conditions together?
('LIGHT NAV = TRUE' AND 'LIGHT LANDING = FALSE' AND 'SIM ON GROUND = TRUE')
Re: Animation - need a helping hand
Posted: 02 Mar 2010, 20:54
by Weescotty
Thinking about it you have to use Nicks method of an if / else selection.
If a mod could delete my post above, I would appreciate it. DONE
Kev
Re: Animation - need a helping hand
Posted: 02 Mar 2010, 21:25
by nickblack423
yeh, you've got to have a master variable in this case the nav lights. Then it says, if the nav light is on, check to see if the engine in on, if they are both on then check to see if the strobe is on, if its only nav lights then open the canopy all the way (keyframe 50) if its nav lights and engine on then its keyframe 25 and if its all 3 then revert to keyframe 0.
Nick
Re: Animation - need a helping hand
Posted: 02 Mar 2010, 23:26
by gsnde
After some serios struggling I now use this which is working perfectly:
Code: Select all
<code>
(A:SIM on GROUND, bool) 1 ==
(A:LIGHT LANDING,bool) 0 ==
and
(A:LIGHT NAV,bool) 1 ==
and
if{ 100 }
els{ 0 }
</code>
Thanks for all the input, guys !
Re: Animation - need a helping hand
Posted: 18 Mar 2010, 08:51
by andras1
Good morning
I have asked this before but have not gotten much of a response. I am trying to change the rotor animation of a helicopter. I know that it should work using vsiibility. I would like to attach the wisibilty to some engine values. So that the fast rotor shows up once the engine has reached a certain power setting. I have tried to use GENERAL ENG RPM and similar values for this purpose but this seems not to work on ai planes.
Dos anybody have an idea to what one could attach the rotor visibility. BTW does anybody know whether Heli traffic uses the same commands ?
Thanks
Andras
Re: Animation - need a helping hand
Posted: 18 Mar 2010, 18:56
by Weescotty
Try -
Use a copy of the prop_blurred, for the prop_slow.
Set the animation speed in the aircraft config, called something like prop_anim_ratio.
Not sure what engine conditions can be used, sorry.