• 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 Controll Tick_18

Messages
246
Country
southafrica
I am making the nose gun for my heli, and the gun will move with the gunner's head. but how do I turn the gun off, so that it does not animate while aircraft engines are not running?

I am modeling in Gmax for FS2004
 
Hey Jakes,

Easy enough. You would have a basic if/els condition that would perhaps be based on engine combustion. If you cant write one, let me know and I think I can write one up for you.
 
I went ahead and wrote one up. I havent tested this.

EDIT: THIS DOES NOT HAVE TICK 18

Code:
[COLOR="blue"][B]<part>
	<name>helo_gunner_turret</name>
 <animation>
  <parameter>
   <code>
          (A:GENERAL ENG COMBUSTION) 1 == 
       if{
          (&gt;L:HeloGunTurretOne,bool)
         }   
    els{ 0 }
   </code>
  </parameter>
 </animation>
        <mouserect>
              <cursor>Hand</cursor>
	   <Tooltip_Text>Gunners Turret</Tooltip_Text>
	   <mouse_flags>LeftSingle+LeftDrag</mouse_flags>
    <callback_code>
          (A:GENERAL ENG COMBUSTION) 1 == 
       if{
          (&gt;L:HeloGunTurretOne,bool)
         }   
    els{ 0 }
        </callback_code>
     </mouserect>
</part> [/B][/COLOR]


[COLOR="Red"][B]Alternative Callback code section[/B][/COLOR]

[COLOR="Blue"][B]    <callback_code>
          (L:HeloGunTurretOne,bool) ! (&gt;L:HeloGunTurretOne,bool)
    </callback_code>[/B][/COLOR]

Code:
[COLOR="Red"][B]This version below has Tick18[/B][/COLOR]

[COLOR="blue"][B]<part>
	<name>helo_gunner_turret</name>
 <animation>
  <parameter>
   <code>
          (A:GENERAL ENG COMBUSTION) 1 == 
       if{
          (>K:TICK18,bool)
         }   
    els{ 0 }
   </code>
  </parameter>
 </animation>
        <mouserect>
              <cursor>Hand</cursor>
	   <Tooltip_Text>Gunners Turret</Tooltip_Text>
	   <mouse_flags>LeftSingle+LeftDrag</mouse_flags>
    <callback_code>
          (A:GENERAL ENG COMBUSTION) 1 == 
       if{
          (>K:TICK18,bool)
         }   
    els{ 0 }
        </callback_code>
     </mouserect>
</part> [/B][/COLOR]



If the code doesnt work, try changing out the bottom 'callback code' section with the extra version.

Basically you are placing an if logic on engine combustion in this that will enable the part to animate 'when' the engine is running.



Bill
 
Last edited:
Hey Jakes,

Easy enough. You would have a basic if/els condition that would perhaps be based on engine combustion. If you cant write one, let me know and I think I can write one up for you.

Ok, I am not good with XML scripting, but here is my try:

Code:
<part>
		 <name>Tick18_Gun01</name>
		  <AnimLength>100</AnimLength>
		  <animation>
			 <parameter>
				   <code>
if{(A:GENERAL ENG RPM, percent) 1 &gt; 
els { 0 }
				   </code>
				<lag>50</lag>
			 </parameter>
		  </animation>
	   </part>

The question is, when the engine running, the gun will keep animate, but when the engien are off, will it just pause? or at least that's how I want it to animate.
I know I am looking for the impossible here :D
 
Jakes,

My humble apologies. I missed the Tick18 part. I edited the script above with an extra one that has the tick18 animation call.

Sorry I missed that.



Bill
 
Jakes,

If that doesnt turn off the turret's Tick18 animation (which I dont think it will), then you could create a set of conditional appearences of separate turrets. One would appear when the engine is off, doesnt move. One moves (and appears) when the engine starts up.
 
Jakes,

If that doesnt turn off the turret's Tick18 animation (which I dont think it will), then you could create a set of conditional appearences of separate turrets. One would appear when the engine is off, doesnt move. One moves (and appears) when the engine starts up.

Ok, I have decided to go for the conditional set of appearances, and want to know how can I build in a time delay in my appearance conditions? The reason I am asking, it take my turret about 5 seconds to turn out, and it have to turn out, and the turn out is part of the "static appearance" After it turned out, then only the appearance must switch from static to animate. I will have a toggle switch for the turn out of the turret, as well as the animation (armed)
See this thread for the turret code and switch:

So basically I only need a time delay on the armed switch of 5 seconds, with a condition that the Turret switch must be on?
 
Alternative, can i make the visibility code so that it triggers when the Gun_Optics animation is at the 100 keyframe? that will be a better option.

Now I am clueless with XML coding, but here is my try - not working....

Code:
 <!-- code that turn out turret - 100 keyframe animation   -->	
        <part> 
		<name>Gun_Optics</name>
         	<animation>
			  <parameter>
				<code>
(L:turret, number) 100 * 
				</code>
				<lag>50</lag>
			  </parameter>
			</animation>
		</part> 
<!-- code that trigger the visibility at key 100   -->	
	<part> 
		<name>Animate_optics</name>
         	<Visibility>
			  <parameter>
				<code>
(L:turret, number) 100 * 
				</code>
			  </parameter>
			  <minvalue>100</minvalue>
			</Visibility>
		</part>
 
Ok Jakes...

I am going to show you something that I have that I think you might be able to use.

This code shows how to start off at KF 40. This is a 'very' exotic code for dragging an object, not a Tick18 like yours. So you need to tare away that part on 'this' animation, and see how Vitus has caused the animation to trigger at KF 40. It is both in the top 'code' zone, and in the bottom clickzone.


Code:
<part>
	<name>ave_adjustable_colum</name>
 <animation>
  <parameter>
   <code>
    (L:AVE INITIALIZED,bool) 0 ==
    if{
      40 (&gt;L:AVEadjustableCOLUM, number)
      1 (&gt;L:AVE INITIALIZED,bool)
    }   
 
    100 (L:AVEadjustableCOLUM, number) -
   </code>
  </parameter>
 </animation>
	<mouserect>
		<cursor>Hand</cursor>
	   <Tooltip_Text>Adjust Steering Colum</Tooltip_Text>
	   <mouse_flags>LeftSingle+LeftDrag</mouse_flags>
    <callback_code>
	(M:Event) 'LeftSingle' scmp 0 ==
	if{
	  100 (M:Y) - (&gt;L:aveColumMOUSEPOS, number)
	  quit
	}
	(M:Event) 'LeftDrag' scmp 0 ==
	if{
	  100 (M:Y) - (L:aveColumMOUSEPOS,number) - 0.5 * (L:AVEadjustableCOLUM, number) + 0 max 100 min (&gt;L:AVEadjustableCOLUM, number)
	  100 (M:Y) - (&gt;L:aveColumMOUSEPOS,number)
	}
    </callback_code>
	</mouserect>
</part>


UNSTAGGERED:



<part>
<name>ave_adjustable_colum</name>
<animation>
<parameter>
<code>
(L:AVE INITIALIZED,bool) 0 ==
if{
40 (&gt;L:AVEadjustableCOLUM, number)
1 (&gt;L:AVE INITIALIZED,bool)
}

100 (L:AVEadjustableCOLUM, number) -
</code>
</parameter>
</animation>
<mouserect>
<cursor>Hand</cursor>
<Tooltip_Text>Adjust Steering Colum</Tooltip_Text>
<mouse_flags>LeftSingle+LeftDrag</mouse_flags>
<callback_code>
(M:Event) 'LeftSingle' scmp 0 ==
if{
100 (M:Y) - (&gt;L:aveColumMOUSEPOS, number)
quit
}
(M:Event) 'LeftDrag' scmp 0 ==
if{
100 (M:Y) - (L:aveColumMOUSEPOS,number) - 0.5 * (L:AVEadjustableCOLUM, number) + 0 max 100 min (&gt;L:AVEadjustableCOLUM, number)
100 (M:Y) - (&gt;L:aveColumMOUSEPOS,number)
}
</callback_code>
</mouserect>
</part>



Here is the code section;

<code>
(L:AVE INITIALIZED,bool) 0 ==
if{
40 (&gt;L:AVEadjustableCOLUM, number) <<-- NOTE KF 40 Selected
1 (&gt;L:AVE INITIALIZED,bool) <<-- NOTE, Innitializer
}

100 (L:AVEadjustableCOLUM, number) - <<-- NOTE, actual animation with 100 KF callout, this one in the 'negative' direction
</code>



Clickzone mouse section;


<callback_code>
(M:Event) 'LeftSingle' scmp 0 ==
if{
100 (M:Y) - (&gt;L:aveColumMOUSEPOS, number)
quit
}
(M:Event) 'LeftDrag' scmp 0 ==
if{
100 (M:Y) - (L:aveColumMOUSEPOS,number) - 0.5 * (L:AVEadjustableCOLUM, number) + 0 max 100 min (&gt;L:AVEadjustableCOLUM, number)
100 (M:Y) - (&gt;L:aveColumMOUSEPOS,number)
}
</callback_code>



Note above in the mouse click section, this animation string is the activator for the above code animation;


(L:AVEadjustableCOLUM, number) + 0 max 100 min (&gt;L:AVEadjustableCOLUM, number)



I do not understand this enough (yet) to translate it to yours, but this holds (I believe) what you need to start off at KF 100. This one shows KF40 for example.

Sorry I cant be of more help..


Bill
 
wow okay, thank you, it is quite a code you have here.I will go over and over and see what I can make out of this! Thank you very much!
 
I was making the world to difficult for me. I've thinked, and re thinked, and I then thought it will be much easier to control the turret with the tailhook animation, an then trigger the Tick18 visibilities with the tailhook position.

So here is it, tested and working fine! :D

Code:
[COLOR="Blue"]	
<part> 
	<name>Optic_animater</name>
            <visible_in_range>
                 <parameter>
	 		<code>

(A:TAILHOOK POSITION,percent) 99 &gt;

			</code>
                 </parameter>
            <minvalue>1</minvalue>  
      </visible_in_range>
</part> 
		
<part> 
        <name>Static_optics</name>
            <visible_in_range>
               <parameter>
			<code>
(A:TAILHOOK POSITION,percent) 99 &lt;

			</code>
                </parameter>
            <minvalue>1</minvalue>  
      </visible_in_range>
</part> 		[/COLOR]

see the animation here

Now just create a toggle switch for that tailhook aka turret activate...
Thanks very much for all the help!
 
Last edited:
Glad you got it working right Jakes.

My apologies for not knowing better how to help you. Working with controlling a Tick18 is a bit beyond me presently.


I love using the ole tailhook and wingfold animations, especially with them being keyboard driven commands.

It would be nice to create new keyboard commands into objects, but they would probably need to be exotic multi-button arrangements to keep from walking on peoples own keyboard setup commands...



Bill
 
Back
Top