Howto:Adding gun effects: Difference between revisions

From FlightGear wiki
Jump to navigation Jump to search
No edit summary
Line 1: Line 1:
With [[Flightgear]]'s increasing capabilities, dogfight effects such as bullets and smoke on hit are now supported! You'll need [[FlightGear 1.9.0|FlightGear version 1.9]] or later, in order to use the effects!
With [[Flightgear]]'s increasing capabilities, bullet effects such as tracers and smoke on impact are now supported. You'll need [[FlightGear 1.9.0|FlightGear version 1.9]] or later, in order to use the effects.


== Setup ==
== 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  <tt>keyboard.xml</tt> file:  
There is no default key/button binding for a trigger in FlightGear, so you'll 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>keyboard.xml</tt> file:  


  <key n="119">
  <key n="119">
Line 23: Line 23:
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 '''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 ==
 
== Adding Guns and Bullet Effects to Your Airplane ==
Once you have a key or button binding defined to active the trigger, you'll then need to add the needed [[AI_Systems#Submodels]] configuration file to your airplane's root directory, and ensure the file is activated in your *-set.xml file.  The choice of tracer, smoke and impact visual models is up to you.  You may also add a sound effect to your sound configuration file that activates with the trigger.
 
 
== Aircraft Already Equipped with Guns==
Some aircraft have the needed submodel files included.
Some aircraft have the needed submodel files included.
All aircraft equipped with guns in [http://home.comcast.net/~davidculp2/hangar/hangar.html Dave's hangar] are capable bullet effects. Like:
All aircraft equipped with guns in [http://home.comcast.net/~davidculp2/hangar/hangar.html Dave's hangar] are capable bullet effects. Like:
Line 33: Line 38:
* LTV A-7E Corsair II
* LTV A-7E Corsair II
* Dassault Mirage IIIC, F-103E
* Dassault Mirage IIIC, F-103E
== Current Limitations ==
- Submodel information is not sent with the multiplayer protocol, so multiplayer users will not be effected by your bullets.  The tracers, smoke and impact effects will only be seen by you. 
- The impact cylinder for models is fairly large, so you will see impacts occur outside of the target model's boundaries.

Revision as of 21:09, 3 April 2009

With Flightgear's increasing capabilities, bullet effects such as tracers and smoke on impact 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 of button 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.


Adding Guns and Bullet Effects to Your Airplane

Once you have a key or button binding defined to active the trigger, you'll then need to add the needed AI_Systems#Submodels configuration file to your airplane's root directory, and ensure the file is activated in your *-set.xml file. The choice of tracer, smoke and impact visual models is up to you. You may also add a sound effect to your sound configuration file that activates with the trigger.


Aircraft Already Equipped with Guns

Some aircraft have the needed submodel files included. All aircraft equipped with guns in Dave's hangar are capable bullet effects. Like:

  • Embraer AT-29, A-29B Super Tucano
  • McDonnell F-4D/E/F, FGR.2, Phantom II
  • Republic F-105D Thunderchief
  • North American F-100 Super Sabre
  • North American FJ-3 Fury
  • LTV A-7E Corsair II
  • Dassault Mirage IIIC, F-103E


Current Limitations

- Submodel information is not sent with the multiplayer protocol, so multiplayer users will not be effected by your bullets. The tracers, smoke and impact effects will only be seen by you.

- The impact cylinder for models is fairly large, so you will see impacts occur outside of the target model's boundaries.