Howto:Adding gun effects: Difference between revisions

Line 80: Line 80:
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:
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">
      <!-- Fire gun -->
                          <name>e</name>
      <!-- We do both triggers just to be safe -->
                          <desc>Gun Trigger</desc>  
      <key n="101">
                          <binding>
        <name>e</name>
                            <command>property-assign</command>
        <desc>Gun Trigger</desc>  
                            <property>ai/submodels/trigger</property>
        <binding>
                            <value>true</value>
          <command>property-assign</command>
                          </binding>
          <property>ai/submodels/trigger</property>
                          <binding>
          <value>true</value>
                            <command>property-assign</command>
        </binding>
                            <property>controls/armament/trigger</property>
        <binding>
                            <value>true</value>
          <command>property-assign</command>
                          </binding>
          <property>controls/armament/trigger</property>
                          <mod-up>
          <value>true</value>
                            <binding>
        </binding>
                            <command>property-assign</command>
        <mod-up>
                            <property>ai/submodels/trigger</property>
          <binding>
                            <value>false</value>
          <command>property-assign</command>
                            </binding>
          <property>ai/submodels/trigger</property>
                            <binding>
          <value>false</value>
                            <command>property-assign</command>
          </binding>
                            <property>controls/armament/trigger</property>
          <binding>
                            <value>false</value>
          <command>property-assign</command>
                          </binding>  
          <property>controls/armament/trigger</property>
                          </mod-up>
          <value>false</value>
                        </key>
        </binding>  
        </mod-up>
      </key>
482

edits