• 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 VC Tailhook lever problem

Messages
231
Country
us-alabama
Hi Guys!

I am using this code to control the VC tail hook lever part in my fs9 mkmdl.parts file

Code:
<part>
   <name>TailHookLever</name>
  <animation>
   <parameter>
    <code>(L:TailHookLever, bool) 100 *</code>
    <lag>100</lag>
   </parameter>
  </animation>
  <mouserect>
   <cursor>Hand</cursor>
  <tooltip_text>Tailhook</tooltip_text>
  <callback_code>
  (L:TailHookLever, bool) ! (>L:TailHookLever, bool)
  (>K:TOGGLE_TAIL_HOOK_HANDLE)
  1 (&gt;L:XMLSND15,enum)
  </callback_code>
  </mouserect>
</part>

The code works well when the part is clicked on, Vc lever and tailhook both animate and the sound plays. But when I try the tail hook keyboard command, ' , only the tail hook part itself animates.
How do I get the VC tail hook lever and sound to respond to the keyboard command?

Carl
 
You have two options:

-To capture the TOGGLE_TAIL_HOOK_HANDLE event with an Event Handler and update (L:TailHookLever, bool) accordingly

-Use (A:TAILHOOK HANDLE,bool) variable to control the animation of the lever:

Code:
<part>
   <name>TailHookLever</name>
  <animation>
   <parameter>
    <code>(A:TAILHOOK HANDLE,bool) 100 *</code>
    <lag>100</lag>
   </parameter>
  </animation>
  <mouserect>
   <cursor>Hand</cursor>
  <tooltip_text>Tailhook</tooltip_text>
  <callback_code>
     (>K:TOGGLE_TAIL_HOOK_HANDLE)
     1 (&gt;L:XMLSND15,enum)
  </callback_code>
  </mouserect>
</part>

This last one is the easiest by far. It's for FSX but I guess should be the same for FS9

Tom
 
Tom

No joy! With your code the tail hook handle in the vc and sound file still fail to respond to the keyboard command, they also fail to respond to click input also. When I inserted, (L:TailHookLever, bool) ! (>L:TailHookLever, bool) into the callback section the sound would play when the TailHookLever part was clicked but the animation did not run, sound nor animation would run when the keyboard command was pressed.

Carl
 
Luka

When written:
Code:
(A:TAILHOOK POSITION,percent)
The VC handle animated only one way and the sound file did not play.

When I changed the percent to bool as so:
Code:
<part>
   <name>TailHookLever</name>
  <animation>
   <parameter>
    <code>(A:TAILHOOK POSITION, bool) 100 *</code>
    <lag>100</lag>
   </parameter>
  </animation>
  <mouserect>
   <cursor>Hand</cursor>
  <tooltip_text>Tailhook</tooltip_text>
  <callback_code>
     1 (&gt;L:XMLSND15,enum)
  </callback_code>
  </mouserect>
</part>

The VC handle animated correctly on each press of the keyboard command. Sound file still did not play unless I clicked the TailHookLever part,

Carl
 
Try some of this:
Code:
<code>(A:TAILHOOK POSITION, percent) 0 > 100 *</code>
<code>(A:TAILHOOK POSITION, percent)</code>
<code>(A:TAILHOOK POSITION, position) 100 *</code>

Another way to get sound can be through "On Event". Put this code in an active gauge (somewhere in VCockpit section):
Code:
<Keys>
    <On Event="TOGGLE_TAIL_HOOK_HANDLE">1 (>L:XMLSND15,enum)</On>
</Keys>
 
Last edited:
Luka

<code>(A:TAILHOOK POSITION, percent)</code> , no sound or movement.
<code>(A:TAILHOOK POSITION, percent) 0 > 100 *</code> , no sound movement only on the first press of the key command.
<code>(A:TAILHOOK POSITION, position) 100 *</code> no sound but correct movement

I added the "On Event" code to the vc Hydraulic pressure gauge. The sound now plays correctly!

And here is the code for the part:
Code:
<part>
   <name>TailHookLever</name>
  <animation>
   <parameter>
    <code>(A:TAILHOOK POSITION, position) 100 *</code>
    <lag>300</lag>
   </parameter>
  </animation>
  <mouserect>
   <cursor>Hand</cursor>
  <tooltip_text>Tailhook</tooltip_text>
  </mouserect>
</part>

Many Thanks! Luka!
And thank you to all who offered suggestions!

Carl
 
Just a doubt. Does the sound play well in External view when managing the tailhook via keyboard commands?

Tom
 
Keys/Event should always work if placed in the VC Gauge, but in FS-2004 you can add ACTIVE VIEW MODE (1=cockpit, 2=VC, 3=tower, 4=spot, 5=top down) as an additional condition:
Code:
<Keys>
    <On Event="TOGGLE_TAIL_HOOK_HANDLE">
        1 2 (P:ACTIVE VIEW MODE,enum) rng if{ (* inside code *) }
        (P:ACTIVE VIEW MODE,enum) 4 == if{ (* outsde code *) }
    </On>
</Keys>
Also, the default fs9gps.xml has examples of Visible tags within Keys.
 
Keys/Event should always work if placed in the VC Gauge, but in FS-2004 you can add ACTIVE VIEW MODE (1=cockpit, 2=VC, 3=tower, 4=spot, 5=top down) as an additional condition:

That was the reason of my question. In FS2004(9) event captures work fine in any view mode, but in FSX they don't work when active view is EXTERNAL, and the only solution to this issue is to program an Event Handler in C++.

Tom
 
This is because FSX has changed view system. Also, ACTIVE VIEW MODE variable does not work at all. I guess the FSX solution is in your post at the beginning of this topic, or maybe in some kind of always visible type=special panel.
 
Last edited:
This is because FSX has changed view system. Also, ACTIVE VIEW MODE variable does not work at all. I guess the FSX solution is in your post at the beginning of this topic, or maybe in some kind of always visible type=special panel.

Exactly. As the view system changed those FS9 related vars are no longer valid. So the only way to capture an event in external view in FSX that I know of is by using a C++ event handling routine in panel.cfg

Tom
 
Back
Top