Howto:Adding gun effects: Difference between revisions

From FlightGear wiki
Jump to navigation Jump to search
No edit summary
Line 2: Line 2:


== Setup ==
== Setup ==
You first need to bind a key for the trigger. To do this edit the <tt>keyboard.xml</tt> file in your FlightGear root. Add the following:  
There is no default key/button binding for a trigger in FlightGear, so you'll have to make your own.  An obvious choice would be the trigger on a joystick, but you can also make a keyboard binding by adding something like this to your  <tt>keyboard.xml</tt> file:  


  <key n="119">
  <key n="119">
Line 9: Line 9:
   <binding>
   <binding>
     <command>property-assign</command>
     <command>property-assign</command>
     <property>/controls/armament/trigger</property>
     <property>controls/armament/trigger</property>
     <value>true</value>
     <value>true</value>
   </binding>
   </binding>
Line 15: Line 15:
   <binding>
   <binding>
     <command>property-assign</command>
     <command>property-assign</command>
     <property>/controls/armament/trigger</property>
     <property>controls/armament/trigger</property>
     <value>false</value>
     <value>false</value>
   </binding>  
   </binding>  
Line 21: Line 21:
  </key>
  </key>


In the code, we have used '''w''' as the trigger. You can change it to a choice of your own.
In the code, we have used '''w''' as the trigger. You can change it to a choice of your own.  Joystick bindings are a bit more complex, but are explained in the wiki article on [[Joystick]]s.


== Compatible Aircraft ==
== Compatible Aircraft ==

Revision as of 20:43, 3 April 2009

With Flightgear's increasing capabilities, dogfight effects such as bullets and smoke on hit are now supported! You'll need FlightGear version 1.9 or later, in order to use the effects!

Setup

There is no default key/button binding for a trigger in FlightGear, so you'll have to make your own. An obvious choice would be the trigger on a joystick, but you can also make a keyboard binding by adding something like this to your keyboard.xml file:

<key n="119">
 <name>w</name>
 <desc>Gun Trigger</desc> 
  <binding>
   <command>property-assign</command>
   <property>controls/armament/trigger</property>
   <value>true</value>
  </binding>
 <mod-up>
  <binding>
   <command>property-assign</command>
   <property>controls/armament/trigger</property>
   <value>false</value>
  </binding> 
 </mod-up>
</key>

In the code, we have used w as the trigger. You can change it to a choice of your own. Joystick bindings are a bit more complex, but are explained in the wiki article on Joysticks.

Compatible Aircraft

All aircraft equipped with guns in Dave's hangar are capable to perform dogfights. Like: