Howto:Adding gun effects: Difference between revisions

Line 70: Line 70:
* Submodel information is not sent with the [[Howto: Multiplayer|multiplayer]] protocol, so multiplayer users will not be effected by your bullets. The tracers, smoke and impact effects will only be seen by you.   
* Submodel information is not sent with the [[Howto: Multiplayer|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.
* The impact cylinder for models is fairly large, so you will see impacts occur outside of the target model's boundaries.
== More complex/complete sample keyboard code ==
Different FlightGear aircraft use different locations for the main armament trigger.  Two locations are commonly used:
  ai/submodels/trigger
  controls/armament/trigger
The following code, which you can place in your keyboard.xml file or (if you are an aircraft designer) in your aircraft's -set.xml file, triggers both of those locations and works with almost all FG aircraft:
  <key n="101">
                          <name>e</name>
                          <desc>Gun Trigger</desc>
                          <binding>
                            <command>property-assign</command>
                            <property>ai/submodels/trigger</property>
                            <value>true</value>
                          </binding>
                          <binding>
                            <command>property-assign</command>
                            <property>controls/armament/trigger</property>
                            <value>true</value>
                          </binding>
                          <mod-up>
                            <binding>
                            <command>property-assign</command>
                            <property>ai/submodels/trigger</property>
                            <value>false</value>
                            </binding>
                            <binding>
                            <command>property-assign</command>
                            <property>controls/armament/trigger</property>
                            <value>false</value>
                          </binding>
                          </mod-up>
                        </key>
482

edits