This commit is contained in:
omega13a 2017-06-05 15:03:28 -07:00
commit 2b8cacbc96
13 changed files with 166 additions and 37 deletions

View file

@ -722,6 +722,7 @@
<file>Aircraft/A320Family/Nasal/gpws.nas</file> <file>Aircraft/A320Family/Nasal/gpws.nas</file>
<file>Aircraft/A320Family/Nasal/efis.nas</file> <file>Aircraft/A320Family/Nasal/efis.nas</file>
<file>Aircraft/A320Family/Nasal/ECAM.nas</file> <file>Aircraft/A320Family/Nasal/ECAM.nas</file>
<file>Aircraft/A320Family/Nasal/shake.nas</file>
</libraries> </libraries>
<acconfig> <acconfig>
<file>Aircraft/A320Family/AircraftConfig/acconfig.nas</file> <file>Aircraft/A320Family/AircraftConfig/acconfig.nas</file>

View file

@ -4,6 +4,32 @@
<path>res/fd_complete.ac</path> <path>res/fd_complete.ac</path>
<animation>
<type>translate</type>
<property>/systems/shake/shaking</property>
<axis>
<x1-m> 0</x1-m>
<y1-m> 0</y1-m>
<z1-m> 0</z1-m>
<x2-m> 0.5</x2-m>
<y2-m>-0.5</y2-m>
<z2-m> 0.8</z2-m>
</axis>
</animation>
<animation>
<type>translate</type>
<property>/systems/shake/shaking</property>
<axis>
<x1-m> 0</x1-m>
<y1-m> 0</y1-m>
<z1-m> 0</z1-m>
<x2-m> 0.5</x2-m>
<y2-m>-0.5</y2-m>
<z2-m> 0.8</z2-m>
</axis>
</animation>
<!-- Overhead Panel --> <!-- Overhead Panel -->
<model> <model>

View file

@ -2233,7 +2233,10 @@
<command>property-toggle</command> <command>property-toggle</command>
<property>controls/lighting/strobe</property> <property>controls/lighting/strobe</property>
</binding> </binding>
<binding>
<command>nasal</command>
<script>setprop("/sim/sounde/switch1", 1);</script>
</binding>
</action> </action>
</animation> </animation>
<animation> <animation>
@ -2268,7 +2271,10 @@
<command>property-toggle</command> <command>property-toggle</command>
<property>controls/lighting/beacon</property> <property>controls/lighting/beacon</property>
</binding> </binding>
<binding>
<command>nasal</command>
<script>setprop("/sim/sounde/switch1", 1);</script>
</binding>
</action> </action>
</animation> </animation>
<animation> <animation>
@ -2303,7 +2309,10 @@
<command>property-toggle</command> <command>property-toggle</command>
<property>controls/lighting/wing-lights</property> <property>controls/lighting/wing-lights</property>
</binding> </binding>
<binding>
<command>nasal</command>
<script>setprop("/sim/sounde/switch1", 1);</script>
</binding>
</action> </action>
</animation> </animation>
<animation> <animation>
@ -2341,7 +2350,10 @@
<value>1</value> <value>1</value>
<value>2</value> <value>2</value>
</binding> </binding>
<binding>
<command>nasal</command>
<script>setprop("/sim/sounde/switch1", 1);</script>
</binding>
</action> </action>
</animation> </animation>
<animation> <animation>
@ -2378,6 +2390,10 @@
<command>property-toggle</command> <command>property-toggle</command>
<property>controls/lighting/landing-lights[2]</property> <property>controls/lighting/landing-lights[2]</property>
</binding> </binding>
<binding>
<command>nasal</command>
<script>setprop("/sim/sounde/switch1", 1);</script>
</binding>
</action> </action>
</animation> </animation>
<animation> <animation>
@ -2413,7 +2429,10 @@
<command>property-toggle</command> <command>property-toggle</command>
<property>controls/lighting/landing-lights[1]</property> <property>controls/lighting/landing-lights[1]</property>
</binding> </binding>
<binding>
<command>nasal</command>
<script>setprop("/sim/sounde/switch1", 1);</script>
</binding>
</action> </action>
</animation> </animation>
<animation> <animation>
@ -2615,6 +2634,10 @@
<value>0.5</value> <value>0.5</value>
<value>1</value> <value>1</value>
</binding> </binding>
<binding>
<command>nasal</command>
<script>setprop("/sim/sounde/knb1", 1);</script>
</binding>
</action> </action>
</animation> </animation>
<animation> <animation>
@ -2653,6 +2676,10 @@
<value>0</value> <value>0</value>
<value>1</value> <value>1</value>
</binding> </binding>
<binding>
<command>nasal</command>
<script>setprop("/sim/sounde/switch1", 1);</script>
</binding>
</action> </action>
</animation> </animation>
<animation> <animation>
@ -2689,6 +2716,10 @@
<command>property-toggle</command> <command>property-toggle</command>
<property>controls/switches/seatbelt-sign</property> <property>controls/switches/seatbelt-sign</property>
</binding> </binding>
<binding>
<command>nasal</command>
<script>setprop("/sim/sounde/switch1", 1);</script>
</binding>
</action> </action>
</animation> </animation>
<animation> <animation>
@ -2723,6 +2754,10 @@
<command>property-toggle</command> <command>property-toggle</command>
<property>controls/switches/no-smoking-sign</property> <property>controls/switches/no-smoking-sign</property>
</binding> </binding>
<binding>
<command>nasal</command>
<script>setprop("/sim/sounde/switch1", 1);</script>
</binding>
</action> </action>
</animation> </animation>
<animation> <animation>

View file

@ -88,6 +88,15 @@ setlistener("/sim/sounde/knb1", func {
}, 0.05); }, 0.05);
}); });
setlistener("/sim/sounde/switch1", func {
if (!getprop("/sim/sounde/switch1")) {
return;
}
settimer(func {
props.globals.getNode("/sim/sounde/switch1").setBoolValue(0);
}, 0.05);
});
setlistener("/controls/switches/seatbelt-sign", func { setlistener("/controls/switches/seatbelt-sign", func {
props.globals.getNode("/sim/sounde/seatbelt-sign").setBoolValue(1); props.globals.getNode("/sim/sounde/seatbelt-sign").setBoolValue(1);
settimer(func { settimer(func {
@ -154,7 +163,7 @@ setlistener("/sim/signals/fdm-initialized", func {
systems.hyd_init(); systems.hyd_init();
systems.press_init(); systems.press_init();
fmgc.APinit(); fmgc.APinit();
externalconnections.start(); librariesLoop.start();
fmgc.FMGCinit(); fmgc.FMGCinit();
mcdu1.MCDU_init(); mcdu1.MCDU_init();
mcdu2.MCDU_init(); mcdu2.MCDU_init();
@ -165,6 +174,26 @@ setlistener("/sim/signals/fdm-initialized", func {
libraries.variousReset(); libraries.variousReset();
}); });
var librariesLoop = maketimer(0.1, func {
var groundpwr = getprop("/controls/switches/cart");
var groundair = getprop("/controls/pneumatic/switches/groundair");
var gs = getprop("/velocities/groundspeed-kt");
var parkbrake = getprop("controls/gear/brake-parking");
if ((groundair or groundpwr) and ((gs > 2) or !parkbrake)) {
setprop("/controls/switches/cart", 0);
setprop("/controls/pneumatic/switches/groundair", 0);
}
var V = getprop("/velocities/groundspeed-kt");
if (V > 15) {
setprop("/systems/shake/effect", 1);
} else {
setprop("/systems/shake/effect", 0);
}
});
var variousReset = func { var variousReset = func {
setprop("/modes/cpt-du-xfr", 0); setprop("/modes/cpt-du-xfr", 0);
setprop("/modes/fo-du-xfr", 0); setprop("/modes/fo-du-xfr", 0);
@ -182,17 +211,6 @@ var aglgears = func {
aglgears(); aglgears();
var externalconnections = maketimer(0.1, func {
var groundpwr = getprop("/controls/switches/cart");
var groundair = getprop("/controls/pneumatic/switches/groundair");
var gs = getprop("/velocities/groundspeed-kt");
var parkbrake = getprop("controls/gear/brake-parking");
if ((groundair or groundpwr) and ((gs > 2) or !parkbrake)) {
setprop("/controls/switches/cart", 0);
setprop("/controls/pneumatic/switches/groundair", 0);
}
});
var mcpSPDKnbPull = func { var mcpSPDKnbPull = func {
setprop("/it-autoflight/input/spd-managed", 0); setprop("/it-autoflight/input/spd-managed", 0);
fmgc.ManagedSPD.stop(); fmgc.ManagedSPD.stop();

37
Nasal/shake.nas Normal file
View file

@ -0,0 +1,37 @@
# A3XX Shaking
var shakeEffectA3XX = props.globals.initNode("/systems/shake/effect",0,"BOOL");
var shakeA3XX = props.globals.initNode("/systems/shake/shaking",0,"DOUBLE");
var rSpeed = 0;
var sf = 0;
var n_g_c = 0;
var n_g_l = 0;
var n_g_r = 0;
var theShakeEffect = func{
n_g_c = getprop("/gear/gear[0]/compression-norm") or 0;
n_g_l = getprop("/gear/gear[1]/compression-norm") or 0;
n_g_r = getprop("/gear/gear[2]/compression-norm") or 0;
rSpeed = getprop("/gear/gear[0]/rollspeed-ms") or 0;
sf = rSpeed / 94000;
if (shakeEffectA3XX.getBoolValue() and (n_g_c > 0 or n_g_l > 0 or n_g_r > 0)) {
interpolate("/systems/shake/shaking", sf, 0.03);
settimer(func {
interpolate("/systems/shake/shaking", -sf * 2, 0.03);
}, 0.06);
settimer(func {
interpolate("/systems/shake/shaking", sf, 0.03);
}, 0.12);
settimer(theShakeEffect, 0.09);
} else {
setprop("/systems/shake/shaking", 0);
setprop("/systems/shake/effect",0);
}
}
setlistener("/systems/shake/effect", func(state){
if(state.getBoolValue()){
theShakeEffect();
}
}, 1, 0);

View file

@ -394,7 +394,7 @@
<detenta> <detenta>
<mode>once</mode> <mode>once</mode>
<name>detendaa</name> <name>detendaa</name>
<path>detenta.wav</path> <path>Cockpit/detenta.wav</path>
<condition> <condition>
<equals> <equals>
<property>/systems/thrust/state1</property> <property>/systems/thrust/state1</property>
@ -409,7 +409,7 @@
<detentb> <detentb>
<mode>once</mode> <mode>once</mode>
<name>detendba</name> <name>detendba</name>
<path>detentb.wav</path> <path>Cockpit/detentb.wav</path>
<condition> <condition>
<equals> <equals>
<property>/systems/thrust/state2</property> <property>/systems/thrust/state2</property>
@ -424,7 +424,7 @@
<detenta> <detenta>
<mode>once</mode> <mode>once</mode>
<name>detendab</name> <name>detendab</name>
<path>detenta.wav</path> <path>Cockpit/detenta.wav</path>
<condition> <condition>
<equals> <equals>
<property>/systems/thrust/state1</property> <property>/systems/thrust/state1</property>
@ -439,7 +439,7 @@
<detentb> <detentb>
<mode>once</mode> <mode>once</mode>
<name>detendbb</name> <name>detendbb</name>
<path>detentb.wav</path> <path>Cockpit/detentb.wav</path>
<condition> <condition>
<equals> <equals>
<property>/systems/thrust/state2</property> <property>/systems/thrust/state2</property>
@ -454,7 +454,7 @@
<detenta> <detenta>
<mode>once</mode> <mode>once</mode>
<name>detendac</name> <name>detendac</name>
<path>detenta.wav</path> <path>Cockpit/detenta.wav</path>
<condition> <condition>
<equals> <equals>
<property>/systems/thrust/state1</property> <property>/systems/thrust/state1</property>
@ -469,7 +469,7 @@
<detentb> <detentb>
<mode>once</mode> <mode>once</mode>
<name>detendbc</name> <name>detendbc</name>
<path>detentb.wav</path> <path>Cockpit/detentb.wav</path>
<condition> <condition>
<equals> <equals>
<property>/systems/thrust/state2</property> <property>/systems/thrust/state2</property>
@ -484,7 +484,7 @@
<detenta> <detenta>
<mode>once</mode> <mode>once</mode>
<name>detendad</name> <name>detendad</name>
<path>detenta.wav</path> <path>Cockpit/detenta.wav</path>
<condition> <condition>
<equals> <equals>
<property>/systems/thrust/state1</property> <property>/systems/thrust/state1</property>
@ -499,7 +499,7 @@
<detentb> <detentb>
<mode>once</mode> <mode>once</mode>
<name>detendbd</name> <name>detendbd</name>
<path>detentb.wav</path> <path>Cockpit/detentb.wav</path>
<condition> <condition>
<equals> <equals>
<property>/systems/thrust/state2</property> <property>/systems/thrust/state2</property>
@ -514,7 +514,7 @@
<detenta> <detenta>
<mode>once</mode> <mode>once</mode>
<name>detendae</name> <name>detendae</name>
<path>detenta.wav</path> <path>Cockpit/detenta.wav</path>
<condition> <condition>
<equals> <equals>
<property>/systems/thrust/state1</property> <property>/systems/thrust/state1</property>
@ -529,7 +529,7 @@
<detentb> <detentb>
<mode>once</mode> <mode>once</mode>
<name>detendbe</name> <name>detendbe</name>
<path>detentb.wav</path> <path>Cockpit/detentb.wav</path>
<condition> <condition>
<equals> <equals>
<property>/systems/thrust/state2</property> <property>/systems/thrust/state2</property>
@ -544,7 +544,7 @@
<detenta> <detenta>
<mode>once</mode> <mode>once</mode>
<name>detendaf</name> <name>detendaf</name>
<path>detenta.wav</path> <path>Cockpit/detenta.wav</path>
<condition> <condition>
<equals> <equals>
<property>/systems/thrust/state1</property> <property>/systems/thrust/state1</property>
@ -559,7 +559,7 @@
<detentb> <detentb>
<mode>once</mode> <mode>once</mode>
<name>detendbf</name> <name>detendbf</name>
<path>detentb.wav</path> <path>Cockpit/detentb.wav</path>
<condition> <condition>
<equals> <equals>
<property>/systems/thrust/state2</property> <property>/systems/thrust/state2</property>
@ -574,7 +574,7 @@
<detenta> <detenta>
<mode>once</mode> <mode>once</mode>
<name>detendag</name> <name>detendag</name>
<path>detenta.wav</path> <path>Cockpit/detenta.wav</path>
<condition> <condition>
<equals> <equals>
<property>/controls/engines/engine[0]/reverser</property> <property>/controls/engines/engine[0]/reverser</property>
@ -589,7 +589,7 @@
<detentb> <detentb>
<mode>once</mode> <mode>once</mode>
<name>detendbg</name> <name>detendbg</name>
<path>detentb.wav</path> <path>Cockpit/detentb.wav</path>
<condition> <condition>
<equals> <equals>
<property>/controls/engines/engine[1]/reverser</property> <property>/controls/engines/engine[1]/reverser</property>
@ -604,7 +604,7 @@
<detenta> <detenta>
<mode>once</mode> <mode>once</mode>
<name>detendah</name> <name>detendah</name>
<path>detenta.wav</path> <path>Cockpit/detenta.wav</path>
<condition> <condition>
<equals> <equals>
<property>/controls/engines/engine[0]/reverser</property> <property>/controls/engines/engine[0]/reverser</property>
@ -619,7 +619,7 @@
<detentb> <detentb>
<mode>once</mode> <mode>once</mode>
<name>detendbh</name> <name>detendbh</name>
<path>detentb.wav</path> <path>Cockpit/detentb.wav</path>
<condition> <condition>
<equals> <equals>
<property>/controls/engines/engine[1]/reverser</property> <property>/controls/engines/engine[1]/reverser</property>
@ -667,9 +667,9 @@
</ns> </ns>
<switch> <switch>
<name>Overhead Button</name> <name>Button</name>
<mode>once</mode> <mode>once</mode>
<path>Aircraft/A320Family/Sounds/oh-button.wav</path> <path>Aircraft/A320Family/Sounds/Cockpit/button.wav</path>
<condition> <condition>
<property>/sim/sounde/btn1</property> <property>/sim/sounde/btn1</property>
</condition> </condition>
@ -679,9 +679,9 @@
</switch> </switch>
<switch> <switch>
<name>Overhead Knob</name> <name>Knob</name>
<mode>once</mode> <mode>once</mode>
<path>Aircraft/A320Family/Sounds/oh-knob.wav</path> <path>Aircraft/A320Family/Sounds/Cockpit/knob.wav</path>
<condition> <condition>
<property>/sim/sounde/knb1</property> <property>/sim/sounde/knb1</property>
</condition> </condition>
@ -690,5 +690,17 @@
</volume> </volume>
</switch> </switch>
<switch>
<name>Switch</name>
<mode>once</mode>
<path>Aircraft/A320Family/Sounds/Cockpit/switch.wav</path>
<condition>
<property>/sim/sounde/switch1</property>
</condition>
<volume>
<factor>0.60</factor>
</volume>
</switch>
</fx> </fx>
</PropertyList> </PropertyList>

BIN
Sounds/Cockpit/switch.wav Normal file

Binary file not shown.