On Wednesday 03 January 2007 00:37, Detlef Faber wrote:
> Am Montag, den 01.01.2007, 16:41 -0800 schrieb Hal V. Engel:
> > I have been playing around with my control setup and recently modified an
> > old joystick to work as a throttle quadrant (has throttle, mixture and
> > pitch controls plus a starter button).  This freed up some buttons and
> > one axis (was throttle) on my main stick and I am in the process of
> > remapping these and I would like to map these to a number of things many
> > of which I have been able to figure out.  But I have run into some things
> > that I am not sure how to handle.
> >
> > The first issue is how the boost control is set up.  I notice that in the
> > P51, Corsair and the Beaufighter that these are setup differently but not
> > much differently.   Just enough that it looks like anything I setup in my
> > joystick configuration will be correct for only one aircraft.
>
> There is also some difference in Boost handling. Some Aircraft switch
> the blower by hand, so the switch works like on/off. Other engines (like
> the two staged supercharged merlin) switch the gears automatic and the
> "user" button just disables this Automatism.
> These are key bindings which are easy to unify. I see a problem with
> nasal scrips...

I set this up using the same settings as the key bindings for control-b as the 
p-51.  This seemed to work OK for the Beaufighter.  I have not tried this 
with any other aircraft at this point.  

The joystick config for this look like this:

  <button n="8">
  <repeatable>false</repeatable>
   <binding>
    <command>property-adjust</command>
    <property>/controls/engines/engine[0]/boost</property>
    <step type="double">0.33</step>
    <min type="double">0.0</min>
    <max type="double">1.5</max>
   </binding>
   <binding>
     <condition>
     <greater-than>
     <property>/controls/engines/engine[0]/boost</property>
     <value type="double">1.0001</value>
        </greater-than>
        </condition>
          <command>property-assign</command>
          <property>/controls/engines/engine[0]/boost</property>
          <value type="double">0.0</value>
    </binding>
    <binding>
      <condition>
      <greater-than>
        <property>/controls/engines/engine[0]/boost</property>
        <value type="double">0.55</value>
      </greater-than>
      </condition>
      <command>property-assign</command>
        <property>/controls/engines/engine[0]/boost</property>
        <value type="double">1.0</value>
   </binding>
  </button>

I also think I need to extend the above so that it works in mutli-engine but 
at least in the Beaufighter the above seems to work for both engines??   But 
I don't understand why that is the case.

snip

> > But the 
> > rockets use a custom nasal script:
> >
> >     <key n="72">
> >         <name>H</name>
> >         <desc>Fire Rockets</desc>
> >           <binding n="0">
> >           <command>nasal</command>
> >           <script>beaufighter.fire_rp()</script>
> >         </binding>
> >       </key>
> >
> > and the A10 also uses a nasal script for it's canon:
> >
> >    <key n="101">
> >         <name>e</name>
> >         <desc>Fire GAU-8/A cannon</desc>
> >         <binding>
> >           <command>nasal</command>
> >           <script>A10.fire_gau8a()</script>
> >         </binding>
> >         <mod-up>
> >           <binding>
> >             <command>nasal</command>
> >             <script>A10.cfire_gau8a()</script>
> >           </binding>
> >         </mod-up>
> >       </key>
>
> I believe (haven'tried for a while) you can also add nasal scripts in
> your Joystick config. The Beaufighter needed Nasal to display the
> remaining rockets on the rails.

I was able to get this to work for the A-10 so you are correct.  But I have 
not figured out the Beaufighter but I can't even get this to work from the 
keyboard.  I think it should be possible to bind a button to more than one 
nasal script which is what I did.  The real issue with this is that each new 
aircraft will require that the joystick configuration be modified if it has 
guns/rockets/missles that require a nasal script unless the naming for the 
scripts are some how standardized. 

This is what I did in my joystick configuration file:

<button n="0">
  <desc>cannon or rockets or guns</desc>
  <repeatable>false</repeatable>
  <binding>
    <command>nasal</command>
       <script>A10.fire_gau8a()</script>
  </binding>
  <mod-up>
  <binding>
     <command>nasal</command>
        <script>A10.cfire_gau8a()</script>
  </binding>
  </mod-up>
  <binding>
    <command>nasal</command>
      <script>beaufighter.fire_rp()</script>
   </binding>
 </button>

>
> > There are perhaps other aircraft that also have guns, missiles or other
> > armaments but I have not located these yet so I don't know how much
> > variation there is in how this is handled.  But my real question is.  How
> > are these mapped to a joystick/controller button in such a way that it
> > works for a wide range of aircraft or even for that matter for a single
> > aircraft?
>
> As stated above key bindings are easy to adapt, but the nasal scripts
> names vary with every aircraft and function triggered.
> The first I can think of, is to attach listeners to generic properties
> which can be triggered by key/joystick bindings. The listener then calls
> the nasal script.
> But is this an acceptable solution?
>
> There may be a lot listeners active. One may also be tempted to bind
> other (all) virtual cockpit functions to Joystick buttons.

For those wanting to setup realistic cockpits using devices like the MJoy16 it 
should be possible to use the existing joystick configuration files to handle 
this (IE. binding nasal scripts to the various buttons, switches and knobs 
that these advanced joystick controllers provide).  In such a setup a user 
would likely want to map every available cockpit function to the joystick 
inputs. Again this will be very aircraft specific in any case where the 
keyboard bindings are calling custom nasal scripts.  This may not be a 
significant issue for a user who is setting up a very detailed cockpit for a 
specific aircraft (or series of aircraft).  But it could be an issue for 
anyone trying to setup an advanced but more generic cockpit (for example one 
that would be a close fit for most reciprocating single engine aircraft).

The use of listeners seem overly complex to me.  It should be possible to 
solve this problem in a much simpler way.  On the other hand if something 
like this only needed coding on the part of the aircraft modeler then from a 
user point of view it would not matter other than the fact that it would (if 
properly implemented) simplify the joystick configuration process.

>
> What do the others think about that?
>
>
> Greetings
>
> Detlef
>
> > Hal

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Flightgear-users mailing list
Flightgear-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-users

Reply via email to