Howto:Adding gun effects: Difference between revisions

Line 5: Line 5:
There is no default key/button binding for a trigger in FlightGear, so you will have to make your own. An obvious choice of button would be the trigger on a [[joystick]], but you can also make a keyboard binding by adding something like this to your <tt>[[$FG_ROOT]]/keyboard.xml</tt> file:  
There is no default key/button binding for a trigger in FlightGear, so you will have to make your own. An obvious choice of button would be the trigger on a [[joystick]], but you can also make a keyboard binding by adding something like this to your <tt>[[$FG_ROOT]]/keyboard.xml</tt> file:  


  <key n="119">
  <key n="101">
   <name>w</name>
   <name>e</name>
   <desc>Gun Trigger</desc>  
   <desc>Gun Trigger</desc>  
   <binding>
   <binding>
Line 22: Line 22:
  </key>
  </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 [[Joystick]]s.
In the code, we have used '''e''' as the trigger. You can change it to a choice of your own but '''e''' is the standard key binding used by most aircraft in FlightGear. Joystick bindings are a bit more complex, but are explained in the wiki article on [[Joystick]]s.


== Adding guns and bullet effects to your Airplane ==
== Adding guns and bullet effects to your Airplane ==
482

edits