../../../../Aircraft/Buccaneer/Models/buccaneer.ac
../../../../Aircraft/Buccaneer/Models
print("Loading Buccaneer Wingman", cmdarg().getPath());
srand();
var fg_root = getprop("/sim/fg-root");
var self = cmdarg();
var variant_node = self.getNode("sim/model/variant", 1);
var name_node = self.getNode("name", 1);
var rel_brg_node = self.getNode("load/rel-brg-to-user-deg", 1);
var elev_node = self.getNode("load/elev-to-user-deg", 1);
var pilot_head_brg_node = self.getNode("pilot-head/rel-brg-deg", 1);
var pilot_head_elev_node = self.getNode("pilot-head/elev-deg", 1);
var observer_head_brg_node = self.getNode("observer-head/rel-brg-deg", 1);
var observer_head_elev_node = self.getNode("observer-head/elev-deg", 1);
var pilot_head_look_node = self.getNode("pilot-head/look", 1);
var observer_head_look_node = self.getNode("observer-head/look", 1);
var pilot_head_visor_node = self.getNode("pilot-head/visor-pos-norm", 1);
var observer_head_visor_node = self.getNode("observer-head/visor-pos-norm", 1);
var ht_agl_node = self.getNode("position/altitude-ft",1);
var right_aileron_node = self.getNode("surface-positions/right-aileron-pos-norm",1);
var left_aileron_node = self.getNode("surface-positions/left-aileron-pos-norm",1);
var engine_n1_node = self.getNode("engines/engine/n1",1);
var engine_smoking_node = self.getNode("engines/engine/smoking",1);
pilot_head_brg_node.setDoubleValue(0);
pilot_head_elev_node.setDoubleValue(0);
pilot_head_look_node.setValue("leader");
pilot_head_visor_node.setDoubleValue(0);
observer_head_brg_node.setDoubleValue(0);
observer_head_elev_node.setDoubleValue(0);
observer_head_look_node.setValue("ahead");
observer_head_visor_node.setDoubleValue(0);
var variant = nil;
var ht_agl = 0;
var loopid = 0;
var update = func {
var right_aileron = getprop("/surface-positions/right-aileron-pos-norm");
if (right_aileron != nil){
right_aileron_node.setDoubleValue(right_aileron);
}
var left_aileron = getprop("/surface-positions/left-aileron-pos-norm");
if (left_aileron != nil){
left_aileron_node.setDoubleValue(left_aileron);
}
var engine_n1 = getprop("/engines/engine/n1");
var engine_smoking = getprop("/engines/engine/smoking");
if (engine_n1 != nil){
engine_n1_node.setDoubleValue(engine_n1);
engine_smoking_node.setBoolValue(engine_smoking);
}
settimer(update, 0);
}
var observer = func{
var ht_agl = ht_agl_node.getValue();
# print("observer ht_agl ", ht_agl);
if (ht_agl != nil){
if( ht_agl >= 7500 + (rand() * 1000)){
observer_head_visor_node.setDoubleValue(1);
}else{
observer_head_visor_node.setDoubleValue(0);
}
}
var observer_look = observer_head_look_node.getValue();
if (observer_look == "leader")
{
interpolate(observer_head_brg_node, 5 - rand() * 10 , 1);
interpolate(observer_head_elev_node, 1 - rand() * 2 , 1);
observer_head_look_node.setValue("ahead");
settimer(observer, 5 + (rand() * 10));
} else {
interpolate(observer_head_elev_node, rand() * -20, 1);
interpolate(observer_head_brg_node, 5 - rand() * 10 , 1);
observer_head_look_node.setValue("leader");
settimer(observer, 10 + (rand() * 10));
}
} # end func observer_look
var loop = func(id) {
id == loopid or return;
var ht_agl = ht_agl_node.getValue();
# print("name ",name_node.getValue(), " ht_agl ", ht_agl);
if (ht_agl != nil){
if( ht_agl >= 8000 + (rand() * 1000)){
pilot_head_visor_node.setDoubleValue(1);
}else{
pilot_head_visor_node.setDoubleValue(0);
}
}
if(name_node.getValue()== "Blue-Leader"){
variant_node.setDoubleValue(323);
}elsif(name_node.getValue()== "Red-2"){
variant_node.setDoubleValue(324);
}elsif(name_node.getValue()== "Blue-2"){
variant_node.setDoubleValue(325);
}
var v = variant_node.getValue();
if (v != nil ) {
variant = v;
v = fg_root ~ "/Aircraft/Buccaneer/Models/Liveries/" ~ variant ~ ".xml";
fgcommand("loadxml", props.Node.new({ filename: v, targetnode: self.getPath() }));
}
var rel_brg = rel_brg_node.getValue();
var elev = elev_node.getValue();
var pilot_look = pilot_head_look_node.getValue();
if(pilot_look == "leader" and rel_brg != nil and elev != nil){
if(rel_brg <= -60 ){
rel_brg = -60;
} elsif(rel_brg >= 60 ){
rel_brg = 60;
}
interpolate(pilot_head_brg_node, rel_brg, 1);
if(rel_brg <= -45 ){
rel_brg = -45;
} elsif(rel_brg >= 45 ){
rel_brg = 45;
}
interpolate(pilot_head_elev_node, elev, 1);
# print ("rel_brg ", rel_brg," elev ", elev, " pilot_look ", pilot_look," ", rand() * -10);
pilot_head_look_node.setValue("ahead");
settimer(func { loop(id) }, 20 + (rand() * 10));
} else {
interpolate(pilot_head_brg_node, 0, 1);
interpolate(pilot_head_elev_node, 0 - rand() * 10, 1);
# print(name_node.getValue(), " ahead elev", pilot_head_elev_node.getValue(), " brg ", pilot_head_brg_node.getValue());
pilot_head_look_node.setValue("leader");
settimer(func { loop(id) }, 15 + (rand() * 10));
}
}
loop(loopid);
update();
observer();
print("Unloading Buccaneer Wingman", cmdarg().getPath());
loopid += 1;
0
false
select
Canopy-Main-Rain
Canopy-Side-Port-Rain
Canopy-Side-Stbd-Rain
Canopy-Front-Rain
Aircraft/Buccaneer/Models/fan.xml
Fan-Stbd
6.54929
1.14886
0.315138
2
/Aircraft/Buccaneer/Models/fan.xml
Fan-Port
6.54929
-1.14886
0.315138
2
AI/Aircraft/Buccaneer/Models/strop.xml
New-Strop
7.77252
0.0
-0.370128
select
Place-Holders
3.36104
AI/Aircraft/Buccaneer/Instruments/e2b.xml
3.52034
0
1.17373
AI/Aircraft/Buccaneer/Instruments/asi.xml
3.36104
-0.212109
0.89
12.5
-15
10
AI/Aircraft/Buccaneer/Instruments/blowing_press.xml
3.38
0.28
0.88
-12.5
-10
-25
AI/Aircraft/Buccaneer/Instruments/port_coaming_panel.xml
3.6
-0.311199
0.778272
22.5
AI/Aircraft/Buccaneer/Instruments/stbd_coaming_panel.xml
3.6
0.311199
0.785
-22.5
AI/Aircraft/Buccaneer/Instruments/throttle_panel.xml
3.83186
-0.455
0.347693
AI/Aircraft/Buccaneer/Models/main-panel.xml
0
0
0.00
25.0
10.0
AI/Aircraft/Buccaneer/Instruments/fuel_panel.xml
3.65
0.361662
0.40
AI/Aircraft/Buccaneer/Instruments/stick.xml
0
0
0
select
Pilot-Head
/sim/current-view/name
Model Cockpit View
rotate
Pilot-Head
pilot-head/rel-brg-deg
4.07546
-0.0499988
0.920013
0
0
-1
rotate
Pilot-Head
pilot-head/elev-deg
4.07546
-0.0499988
0.920013
0
1
0
rotate
Visor-Pilot
pilot-head/visor-pos-norm
40
4.05315
-0.150731
1.100
0
-1
0
rotate
Observer-Head
observer-head/rel-brg-deg
5.334126
0.0504371
1.13113
0
0
-1
rotate
Observer-Head
observer-head/elev-deg
5.33412
0.0504371
1.13113
0
1
0
rotate
Visor-Observer
observer-head/visor-pos-norm
40
5.31175
-0.0507311
1.31910
0
-1
0
rotate
Rudder
/surface-positions/rudder-pos-norm
-15
16.0501
0
1.18808
16.6735
0
2.79738
rotate
Aileron-Port
/surface-positions/left-aileron-pos-norm
-30
11.1886
-2.9227
0.366716
12.6736
-6.54553
0.275412
rotate
Aileron-Stbd
/surface-positions/right-aileron-pos-norm
30
11.1886
2.9227
0.366716
12.6736
6.54553
0.275412
rotate
Tail-Assmbly
/surface-positions/elevator-pos-norm
10
16.2535.57
0
3.18725
0
1
0
rotate
Flap-Tail-Port
/surface-positions/tail-flaps-pos-norm
30
17.1088
-2.194
3.19493
16.5068
-0.12744
3.19004
rotate
Flap-Tail-Stbd
/surface-positions/tail-flaps-pos-norm
-30
17.1088
2.194
3.19493
16.5068
0.12744
3.19004
rotate
Flap-Port
/surface-positions/flap-pos-norm
45
11.1477
-2.92065
0.366882
10.6706
-1.69491
0.354456
rotate
Flap-Stbd
/surface-positions/flap-pos-norm
-45
11.1477
2.92065
0.366882
10.6706
1.69491
0.354456
rotate
Airbrake-Stbd
/surface-positions/speedbrake-pos-norm
0
0
0.5
15
1
40
17.4764
0.407569
0.640095
0
0
1
rotate
Drag-Link-Stbd
Airbrake-Stbd
/surface-positions/speedbrake-pos-norm
0
0
0.5
19
1
35
16.36384
0.461053
0.477672
16.3554
0.477428
0.600957
rotate
Airbrake-Port
/surface-positions/speedbrake-pos-norm
0
0
0.5
-15
1
-40
17.4764
-0.407569
0.640095
0
0
1
rotate
Drag-Link-Port
Airbrake-Port
/surface-positions/speedbrake-pos-norm
0
0
0.5
-19
1
-35
16.36384
-0.461053
0.477672
16.3554
-0.477428
0.600957
rotate
Gear-Nose
/gear/gear[0]/position-norm
0
82.5
1
0
3.16747
0.0
-0.472047
0
-1
0
rotate
Door-Front
/gear/gear/position-norm
0
0
0.1
90
1
90
3.01056
0.146521
-0.624665
4.79913
0.152957
-0.717831
rotate
Assmbly-Lower-Nose
F-Arm
F-DArm
/gear/gear/caster-angle-deg
1
3.374
0
-0.374706
3.374
0
-0.999678
rotate
Pivot-Bracket
/gear/gear/caster-angle-deg
1
3.374
0
-0.374706
3.374
0
-0.999678
rotate
Assmbly-Lower-Nose
/gear/gear[0]/compression-norm
0
-2
1
18
3.17039
-1.92861
-1.36823
0
-1
0
translate
Oleo-Nose
/gear/gear[0]/compression-norm
0
-0.0093
1
0.1
0
0
1
rotate
Tail-Bumper
/gear/gear[3]/position-norm
0
0
1
75
13.9884
0.0
-0.420321
0
1
0
rotate
Tail-Bumper
/gear/gear[3]/compression-norm
0
0
1
35
13.9884
0.0
-0.420321
0
-1
0
rotate
Gear-Main-Port
/gear/gear[1]/position-norm
0
64
1
-2
8.97018
-1.84485
0.26455
1
0
0
rotate
Assmbly-Lower-Port
/gear/gear[1]/position-norm
0
64
0.35
64
1
0
9.0435
1.92861
-0.672172
0
-1
0
translate
Oleo-Port
/gear/gear[1]/position-norm
0
0.1975
0.35
0.1975
1
0
0
0
1
rotate
Door-Main-Port
/gear/gear[1]/position-norm
0
0
1
-67.5
9.09345
-2.03621
0.193093
9.91029
-2.03621
0.208715
rotate
Assmbly-Lower-Port
/gear/gear[1]/compression-norm
0
-4
1
60
9.0435
-1.92861
-0.672172
0
-1
0
translate
Oleo-Port
/gear/gear[1]/compression-norm
0
-0.0075
1
0.19
0
0
1
select
Gear-Main-Port
/gear/gear[0]/position-norm
0.02
rotate
Gear-Main-Stbd
/gear/gear[2]/position-norm
0
64
1
-2
8.97018
1.84485
0.26455
-1
0
0
rotate
Assmbly-Lower-Stbd
/gear/gear[2]/position-norm
0
64
0.35
64
1
0
9.0435
1.92861
-0.672172
0
-1
0
translate
Oleo-Stbd
/gear/gear[2]/position-norm
0
0.1975
0.35
0.1975
1
0
0
0
1
rotate
Door-Main-Stbd
/gear/gear[2]/position-norm
0
0
1
67.5
9.09345
2.03621
0.193093
9.91029
2.03621
0.208715
rotate
Assmbly-Lower-Stbd
/gear/gear[2]/compression-norm
0
-4
1
60
9.0435
1.92861
-0.672172
0
-1
0
translate
Oleo-Stbd
/gear/gear[2]/compression-norm
0
0.0075
1
0.1900
0
0
1
select
Gear-Main-Stbd
/gear/gear[0]/position-norm
0.02
rotate
AHook-assmbly
/gear/tailhook/position-norm
0
0
0.5
45
1
90
14.8328
0
-0.161891
0
1
0
rotate
Holdback
/gear/launchbar/holdback-position-norm
0
0
0.5
45
1
90
16.27641
0
0.116332
0
1
0
select
Holdback
/gear/launchbar/state
Engaged
shader
chrome
chrome2.rgb
Intake-Stbd
shader
chrome
chrome2.rgb
Pitot-Head
material
Fuselage-Markings-Side-No
sim/model/livery/material/Fuselage-Markings-Side-No
texture
material
Fuselage-Markings-Ser-No
sim/model/livery/material/Fuselage-Markings-Ser-No
texture
material
Markings-Wing-Inner-Ser-No-Stbd
sim/model/livery/material/Markings-Wing-Inner-Ser-No-Stbd
texture
material
Markings-Wing-Outer-Ser-No-Stbd
sim/model/livery/material/Markings-Wing-Outer-Ser-No-Stbd
texture
material
Markings-Wing-Inner-Ser-No-Stbd
sim/model/livery/material/Markings-Wing-Inner-Ser-No-Stbd
texture
material
Markings-Wing-Outer-Ser-No-Stbd
sim/model/livery/material/Markings-Wing-Outer-Ser-No-Stbd
texture
material
Markings-Wing-Inner-Ser-No-Port
sim/model/livery/material/Markings-Wing-Inner-Ser-No-Port
texture
material
Markings-Wing-Outer-Ser-No-Port
sim/model/livery/material/Markings-Wing-Outer-Ser-No-Port
texture
material
Markings-Flap-Stbd
sim/model/livery/material/Markings-Flap-Stbd
texture
material
Markings-Flap-Port
sim/model/livery/material/Markings-Flap-Port
texture
Aircraft/Buccaneer/Models/Effects/haze.xml
testhaze
0
0
0
Aircraft/Buccaneer/Models/Effects/smoke.xml
smoke-s
0
1
0
Aircraft/Buccaneer/Models/Effects/smoke.xml
smoke-p
0
-1
0
Aircraft/Buccaneer/Models/Effects/fuel.xml
fuel
0
0
0
AI/Aircraft/Buccaneer/Models/Effects/tiptrail-stbd.xml
tiptrail-s
0
0
0
AI/Aircraft/Buccaneer/Models/Effects/tiptrail-port.xml
tiptrail-p
0
0
0
AI/Aircraft/Buccaneer/Models/Effects/tiptrail-tail-port.xml
tiptrail-t-s
0
2.13948
0
AI/Aircraft/Buccaneer/Models/Effects/tiptrail-tail-port.xml
tiptrail-t-p
0
-2.13948
0
Aircraft/Buccaneer/Models/Effects/fuel.xml
fuel
0
0
0
Effects/buccaneerreflect-uber
Fuselage
Spine
Intake-Tail
Rudder
Nose-Cone
Nose
Nacelle-Stbd
Nacelle-Port
Drag-Link-Stbd
Drag-Link-Port
Body-Stbd
Body-Port
Strake-Lower-Stbd
Strake-Lower-Port
Strake-Upper-Stbd
Strake-upper-Port
Cat-Strop-Hook
NACA-Duct
Probe
Door-Main-Port
Door-Main-Stbd
Door-Front
Effects/buccaneerreflect-uber
Tail-Plane
Flap-Tail-Stbd
Flap-Tail-Port
Bullet-Aft
Bullet-Forward
Tail-Fairing-Top
Wing-Outer-Surface-Port
Aileron-Port
Body-Port
Pitot-Fairing
Wing-Inner-Surface-Port
Flap-Port-Surface
Wing-Outer-Surface-Stbd
Aileron-Stbd
Body-Stbd
Wing-Inner-Surface-Stbd
Flap-Stbd-Surface
Frame-Main
Frame-Front
Frame-Centre
Effects/buccaneerreflect-uber
0.1
0.05
0.1
0.1
0.2
Intakes
Probe-Tip
Pitot-Head
Effects/buccaneerglass-uber
0.05
0.05
0.05
0.1
0.2
Visor-Glass-Pilot
Visor-Glass-Observer
Effects/buccaneerglass-uber
Canopy-Side-Port
Canopy-Side-Stbd
Canopy-Front
Canopy-Main-Port
Canopy-Main-Stbd
Screen-Port
Screen-Stbd
Effects/model-transparent
Canopy-Front-Rain
Canopy-Main-Rain
Canopy-Side-Port-Rain
Canopy-Side-Stbd-Rain
Effects/model-transparent
Wiper-Arc
../../../../Aircraft/Buccaneer/Instruments/Canvas-HUD.xml
3.3518
-0.05
1.0