• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

FS2004 Animation Triger

Messages
106
Country
germany
i have a little problem.
i have a switch with a (L:). this switch is a trigger for another part.
when i made a mdl, than i read "Animation Triger not found"

code trigger part:
Code:
<part>
	<name>switch_fire_nozzle</name>
	<animation>
	   <parameter>
		<code>(L:fire_nozzle, enum) 100 *
		</code>
		<lag>400</lag>
	   </parameter>
	</animation>
	<mouserect>
		<cursor>Hand</cursor>
		<tooltip_text>FIRE ATTACK REFILL NOZZLE</tooltip_text>
		<callback_code>
		(L:fire_nozzle,enum) ! (>L:fire_nozzle,enum)
		1 (>L:click,enum)
		</callback_code>
	</mouserect>
   </part>

code part:
Code:
   <part>
	<name>Fire_parent</name>
	<animation>
	   <parameter>
		<code>(L:fire_nozzle, enum) 1 == if{ (>L:fire_nozzle_anim,enum) 100 *}</code>
		<lag>200</lag>
	   </parameter>
	</animation>
   </part>

or/and

Code:
   <part>
	<name>Fire_parent</name>
	<animation>
	   <parameter>
		<code>(>L:fire_nozzle,enum) 100 *</code>
		<lag>200</lag>
	   </parameter>
	</animation>
   </part>

what is the problem?


Mijo
 
Messages
106
Country
germany
new problem. the animation work, but i have a problem with the codes.

i have 4 parts. part 1 is the animated part was triggered by switch.

the other 3 parts have a visible in range. only the first part is visible.

part 1

Code:
   <part>
	<name>Fire_parent</name>
	<animation>
	   <parameter>
		<code>(L:fire_nozzle,enum)</code>
		<lag>200</lag>
	   </parameter>
	</animation>
   </part>

first visible part
Code:
<part> 
 <name>Fire_child_up</name>
  <visible_in_range>
   <parameter>
    <code>(L:fire_nozzle,enum)</code>
   </parameter>
   <minvalue>0</minvalue>
	<maxvalue>33</maxvalue>
   </visible_in_range>
</part>
second part
Code:
<part> 
 <name>Fire_child_mid</name>
  <visible_in_range>
   <parameter>
    <code>(L:fire_nozzle,enum)</code>
   </parameter>
    <minvalue>34</minvalue>
	<maxvalue>66</maxvalue>
   </visible_in_range>
</part>

third part
Code:
<part> 
 <name>Fire_child_down</name>
  <visible_in_range>
   <parameter>
    <code>(L:fire_nozzle,enum)</code>
   </parameter>
    <minvalue>67</minvalue>
	<maxvalue>100</maxvalue>
   </visible_in_range>
</part>

the first part is animated from 0 - 100.
the first part is visible from 0 - 33.
the second from 34 - 66
an the last part when the animated part is at keyframe 67 - 100.


Mijo
 
Last edited:

tgibson

Resource contributor
Messages
11,327
Country
us-california
Perhaps the L: value switches instantly when you use L:... ! L:...., although the movement is slower due to the lag statement?
 

Heretic

Resource contributor
Messages
6,830
Country
germany
The <visible_in_range> tag should be before the <minvalue> tags.
 
Messages
106
Country
germany
the visible-tag have the right position.

my problem is the code directly :confused:

water.png


the animated part is ok and is triggered by a switch in VC.

the problem is at the other parts.
the visiblility is by the keyframe from the animated parts?

can i write a code for this or is this not supported?
 
Messages
160
Country
germany


Okay, thats the scene we are talking about. We try to animate the refill nozzle of a simplex tank.

The off-nozzle is hanging under the tailboom. A switch "cut" the nozzle from it´s off Position and nozzle is falling down to a 90 degree position.

part1 blue is Fire_child_up
part2 orange is Fire_child_mid
part3 red is Fire_child_down

The picture of BK117 shows each child, how they should display. Mijo´s graphic shows the parts without animation. All child parts are 0,0,0 axis pos. The parent part is a very small box. Also 0,0,0 axis.
 
Last edited:

Heretic

Resource contributor
Messages
6,830
Country
germany
As far as I can see, (L:fire_nozzle,enum) would never have any value above 1 as it will be either 1 or 0 in a toggle scenario. You'll need a range of 0 to 100 though.


Try something like this for the switch:

Code:
<part>
	<name>switch_fire_nozzle</name>
	<animation>
	   <parameter>
		<code>(L:fire_nozzle_switch, enum) 100 *
		</code>
		<lag>400</lag>
	   </parameter>
	</animation>
	<mouserect>
		<cursor>Hand</cursor>
		<tooltip_text>FIRE ATTACK REFILL NOZZLE</tooltip_text>
		<callback_code>
		(L:fire_nozzle_switch, bool) ! (>L:fire_nozzle_switch, bool)
		1 (>L:click,enum)
		</callback_code>
	</mouserect>
   </part>

And for the parent part:

Code:
   <part>
	<name>Fire_parent</name>
	<animation>
	   <parameter>
		<code>
(L:fire_nozzle_anim,enum) 1 + (L:fire_nozzle_switch, bool) * 100 min (>L:fire_nozzle_anim,enum)

(L:fire_nozzle_anim,enum) 100 ==
(L:fire_nozzle_switch, bool) 1 !=
and
 if{ 0 (>L:fire_nozzle_anim,enum) }</code>
		<lag>200</lag>
	   </parameter>
	</animation>
   </part>

Adjust the "1" and the lag value for animation speed.

Part one of the code counts from 1 to 100 and stops as 100 as long as the switch is on.
Part two resets the nozzle when it is deployed and switched off again.


You should now be able to use your code for the "child" parts.
 
Last edited:
Messages
106
Country
germany
hey heretic

the visibility works fine :D thx

"but" the animation not.
the part parent have a rotation from 90°.
this doesn`t rotate when i clicked the switch. :confused:
 

Heretic

Resource contributor
Messages
6,830
Country
germany
I did not consider any animation for the parent part.

Put the "parent" animation code from above into another part and name it "fire_nozzle_controller" and then simply use this for the parent:

Code:
<part>
	<name>Fire_parent</name>
	<animation>
	   <parameter>
		<code>
(L:fire_nozzle_anim,enum)</code>
		<lag>200</lag>
	   </parameter>
	</animation>
   </part>
 
Messages
160
Country
germany
Heretic,

your controller tip was simply perfect. Now the nozzle animation is working via the trigger.

Thank you very much for you help. Gruesse auch von Michael

Thomas
 
Top