mirror of
https://github.com/l0k1/oprf_assets.git
synced 2024-11-21 15:08:03 +08:00
Latest GCI update from pinto plus HUD changes.
This commit is contained in:
parent
e8cb589e7e
commit
be5c26c6bc
57
gci-radar/Hud/hud.xml
Normal file
57
gci-radar/Hud/hud.xml
Normal file
@ -0,0 +1,57 @@
|
|||||||
|
<?xml version="1.0"?>
|
||||||
|
|
||||||
|
<PropertyList>
|
||||||
|
|
||||||
|
<name>Vinson HUD</name>
|
||||||
|
|
||||||
|
<enable3d>false</enable3d>
|
||||||
|
|
||||||
|
<label>
|
||||||
|
<name>damage</name>
|
||||||
|
<x>-250</x>
|
||||||
|
<y>-225</y>
|
||||||
|
<width>125</width>
|
||||||
|
<height>25</height>
|
||||||
|
<prefix> Integrity: </prefix>
|
||||||
|
<postfix> %%</postfix>
|
||||||
|
<halign>left</halign>
|
||||||
|
<format>%3.1f</format>
|
||||||
|
<box>true</box>
|
||||||
|
<input>
|
||||||
|
<property>/sam/damage</property>
|
||||||
|
</input>
|
||||||
|
</label>
|
||||||
|
|
||||||
|
<label>
|
||||||
|
<name>cs</name>
|
||||||
|
<x>-100</x>
|
||||||
|
<y>-225</y>
|
||||||
|
<width>125</width>
|
||||||
|
<height>25</height>
|
||||||
|
<prefix> Callsign: </prefix>
|
||||||
|
<postfix></postfix>
|
||||||
|
<halign>left</halign>
|
||||||
|
<format>%s</format>
|
||||||
|
<box>true</box>
|
||||||
|
<input>
|
||||||
|
<property>/sim/multiplay/callsign</property>
|
||||||
|
</input>
|
||||||
|
</label>
|
||||||
|
|
||||||
|
<label>
|
||||||
|
<name>tower</name>
|
||||||
|
<x>100</x>
|
||||||
|
<y>-225</y>
|
||||||
|
<width>200</width>
|
||||||
|
<height>25</height>
|
||||||
|
<prefix> Placement near: </prefix>
|
||||||
|
<postfix></postfix>
|
||||||
|
<halign>left</halign>
|
||||||
|
<format>%s</format>
|
||||||
|
<box>true</box>
|
||||||
|
<input>
|
||||||
|
<property>/sim/tower/airport-id</property>
|
||||||
|
</input>
|
||||||
|
</label>
|
||||||
|
|
||||||
|
</PropertyList>
|
@ -30,6 +30,7 @@ var TRUE = 1;
|
|||||||
var FALSE = 0;
|
var FALSE = 0;
|
||||||
|
|
||||||
var hp = hp_max;
|
var hp = hp_max;
|
||||||
|
setprop("sam/damage", math.max(0,100*hp/hp_max));#used in HUD
|
||||||
|
|
||||||
var cannon_types = {
|
var cannon_types = {
|
||||||
#
|
#
|
||||||
@ -72,7 +73,7 @@ var warhead_lbs = {
|
|||||||
"GBU-12": 190.00,
|
"GBU-12": 190.00,
|
||||||
"GBU-24": 945.00,
|
"GBU-24": 945.00,
|
||||||
"GBU-31": 945.00,
|
"GBU-31": 945.00,
|
||||||
"GBU-54" 190.00,
|
"GBU-54": 190.00,
|
||||||
"GBU12": 190.00,
|
"GBU12": 190.00,
|
||||||
"GBU16": 450.00,
|
"GBU16": 450.00,
|
||||||
"HVAR": 7.50,#P51
|
"HVAR": 7.50,#P51
|
||||||
@ -231,7 +232,7 @@ var incoming_listener = func {
|
|||||||
probability = (maxDist/hpDist)*probability;
|
probability = (maxDist/hpDist)*probability;
|
||||||
}
|
}
|
||||||
var failed = fail_systems(probability, hp_max);
|
var failed = fail_systems(probability, hp_max);
|
||||||
var percent = 100 * prob;
|
var percent = 100 * probability;
|
||||||
printf("Took %.1f%% damage from %s clusterbomb at %0.1f meters from bomblet. %s systems was hit", percent,type,distance,failed);
|
printf("Took %.1f%% damage from %s clusterbomb at %0.1f meters from bomblet. %s systems was hit", percent,type,distance,failed);
|
||||||
nearby_explosion();
|
nearby_explosion();
|
||||||
return;
|
return;
|
||||||
|
@ -1,12 +1,11 @@
|
|||||||
# (c) 2018 pinto
|
# (c) 2018 pinto
|
||||||
# license: gplv2+
|
# license: gplv2+
|
||||||
|
|
||||||
# v0.1 - just a very basic proof of concept at this point.
|
# v0.2b
|
||||||
# will only report the closest bad guy, does no threat assessment.
|
# will only report the closest bad guy, does no threat assessment.
|
||||||
# todo:
|
# todo:
|
||||||
# test
|
# test
|
||||||
# toggle radar on/off
|
# toggle radar on/off
|
||||||
# all the other requests that a gci can do (only handles BRAA right now)
|
|
||||||
|
|
||||||
##########################################
|
##########################################
|
||||||
### Variables
|
### Variables
|
||||||
@ -17,10 +16,13 @@
|
|||||||
# request a BRAA, then it will receive it.
|
# request a BRAA, then it will receive it.
|
||||||
var damage_prop = props.globals.getNode("/carrier/sunk");
|
var damage_prop = props.globals.getNode("/carrier/sunk");
|
||||||
var prop_watch = {
|
var prop_watch = {
|
||||||
|
"MiG-15bis": [0,1,2],
|
||||||
"MiG-21bis": [0,1,2],
|
"MiG-21bis": [0,1,2],
|
||||||
"MiG-21MF-75": [0,1,2],
|
"MiG-21MF-75": [0,1,2],
|
||||||
"QF-4E": [0,1,2],
|
"QF-4E": [0,1,2],
|
||||||
"F-16": [50,51,52],
|
"F-16": [50,51,52],
|
||||||
|
"m2000-5B": [0,1,2],
|
||||||
|
"m2000-5": [0,1,2]
|
||||||
};
|
};
|
||||||
|
|
||||||
var radar_stations = [
|
var radar_stations = [
|
||||||
@ -79,6 +81,7 @@ var gci_contact = {
|
|||||||
m.last_request = NONE;
|
m.last_request = NONE;
|
||||||
m.request_status = PENDING;
|
m.request_status = PENDING;
|
||||||
m.msg_queue = [];
|
m.msg_queue = [];
|
||||||
|
m.last_seen = 0;
|
||||||
if (m.is_radar_station) {
|
if (m.is_radar_station) {
|
||||||
m.radar_station_process_send();
|
m.radar_station_process_send();
|
||||||
} else {
|
} else {
|
||||||
@ -142,8 +145,6 @@ var gci_contact = {
|
|||||||
} elsif (systime() - me.time_from_last_message < update_rate) {
|
} elsif (systime() - me.time_from_last_message < update_rate) {
|
||||||
#print("update failed");
|
#print("update failed");
|
||||||
return false;
|
return false;
|
||||||
} elsif (me.request_status == SENT) {
|
|
||||||
return false;
|
|
||||||
} else {
|
} else {
|
||||||
me.time_from_last_message = systime();
|
me.time_from_last_message = systime();
|
||||||
return true;
|
return true;
|
||||||
@ -153,45 +154,33 @@ var gci_contact = {
|
|||||||
# messages are first in, first out order
|
# messages are first in, first out order
|
||||||
# updates every 1.5 seconds
|
# updates every 1.5 seconds
|
||||||
#print('in process_send()');
|
#print('in process_send()');
|
||||||
|
|
||||||
|
# send messages
|
||||||
|
# if the request type changes, stop sending messages except for popups
|
||||||
|
|
||||||
if (damage_prop.getValue() == 0) {
|
if (damage_prop.getValue() == 0) {
|
||||||
|
|
||||||
me.update_request();
|
me.update_request();
|
||||||
|
|
||||||
#print('rqst: ' ~ me.request);
|
if (me.request != me.last_request or me.request == NONE) {
|
||||||
#print('last: ' ~ me.last_request);
|
# keep popup messages, purge everything else
|
||||||
#print('stat: ' ~ me.request_status);
|
for (var i = 0; i < size(me.msg_queue); i = i + 1) {
|
||||||
#print('queue size: ' ~ size(me.msg_queue));
|
if (split(":",me.msg_queue[i])[2] != 5) {
|
||||||
|
me.msg_queue = purge_from_vector(me.msg_queue, i);
|
||||||
if (me.request == NONE) {
|
|
||||||
#print('setting request to none');
|
|
||||||
me.request_status = PENDING;
|
|
||||||
} elsif (me.request != NONE and me.request_status == PENDING and me.request_status != SENT and size(me.msg_queue) > 0) {
|
|
||||||
#print('setting status to sending');
|
|
||||||
me.request_status = SENDING;
|
|
||||||
} elsif (me.request_status == SENDING and size(me.msg_queue) == 0) {
|
|
||||||
#print('setting status to sent');
|
|
||||||
me.request_status = SENT;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (me.request == NONE or me.request_status == SENT) {
|
|
||||||
#print('emptying queue');
|
|
||||||
me.msg_queue = [];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (me.request != me.last_request) {
|
|
||||||
#print('setting status to pending and emptying queue');
|
|
||||||
me.request_status = PENDING;
|
|
||||||
me.msg_queue = [];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
me.last_request = me.request;
|
me.last_request = me.request;
|
||||||
|
|
||||||
if (size(me.msg_queue) > 0 and me.request_status == SENDING) {
|
if (size(me.msg_queue) > 0) {
|
||||||
#print("msg_queue: " ~ debug.dump(me.msg_queue));
|
#print("msg_queue: " ~ debug.dump(me.msg_queue));
|
||||||
setprop("/sim/multiplay/generic/string["~output_prop~"]",me.msg_queue[0]);
|
setprop("/sim/multiplay/generic/string["~output_prop~"]",me.msg_queue[0]);
|
||||||
|
screen.log.write(me.msg_queue[0],1.0,0.2,0.2);
|
||||||
output_prop = output_prop > 9 ? 0 : output_prop + 1;
|
output_prop = output_prop > 9 ? 0 : output_prop + 1;
|
||||||
me.msg_queue = purge_from_vector(me.msg_queue,0);
|
me.msg_queue = purge_from_vector(me.msg_queue,0);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
settimer(func(){me.process_send();},1.3);
|
settimer(func(){me.process_send();},1.3);
|
||||||
@ -250,10 +239,27 @@ var gather_contacts = func() {
|
|||||||
|
|
||||||
var check_requests = func(){
|
var check_requests = func(){
|
||||||
foreach (var cx; cx_master_list) {
|
foreach (var cx; cx_master_list) {
|
||||||
|
if (check_visible(cx)) {
|
||||||
|
#print('cx is visible');
|
||||||
|
#print('cx last seen time is ' ~ cx.last_seen ~ ' | ' ~ (systime() - cx.last_seen));
|
||||||
|
#print('iff: ' ~ cx.check_foe());
|
||||||
|
#print('node: ' ~ cx.check_node());
|
||||||
|
if (systime() - cx.last_seen > 30 and (cx.check_foe() == true or cx.check_node() == false)) {
|
||||||
|
foreach (var tx; cx_master_list) {
|
||||||
|
if (cx.check_foe() == true) { continue; }
|
||||||
|
var bearing = math.round(tx.contact.get_Coord().course_to(cx.contact.get_Coord()),1);
|
||||||
|
var range = math.round(cx.contact.get_Coord().distance_to(tx.contact.get_Coord()));
|
||||||
|
var altitude = math.round(cx.contact.get_altitude(),1);
|
||||||
|
var aspect = math.round(math.periodic(-180,180,cx.contact.get_heading() - cx.contact.get_Coord().course_to(tx.contact.get_Coord())));
|
||||||
|
print(tx.callsign ~ ":" ~ get_random() ~ ":5:" ~ bearing ~ ":" ~ range ~ ":" ~ altitude ~ ":" ~ aspect);
|
||||||
|
append(tx.msg_queue, tx.callsign ~ ":" ~ get_random() ~ ":5:" ~ bearing ~ ":" ~ range ~ ":" ~ altitude ~ ":" ~ aspect);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
cx.last_seen = systime();
|
||||||
|
}
|
||||||
if (cx.check_foe() == true or cx.check_node() == false) { continue; }
|
if (cx.check_foe() == true or cx.check_node() == false) { continue; }
|
||||||
if (size(cx.msg_queue) > 0) { continue; } # msg queue should be reset or emptied when request changes.
|
if (size(cx.msg_queue) > 0) { continue; } # msg queue should be reset or emptied when request changes.
|
||||||
if (cx.request == NONE) {
|
if (cx.request == NONE) {
|
||||||
#print('reqest is none in check_requests');
|
|
||||||
continue;
|
continue;
|
||||||
} elsif (cx.request == PICTURE) {
|
} elsif (cx.request == PICTURE) {
|
||||||
var blue_coords = [];
|
var blue_coords = [];
|
||||||
@ -444,6 +450,7 @@ var get_intercept = func(bearing, dist_m, runnerHeading, runnerSpeed, chaserSpee
|
|||||||
# intercept not possible
|
# intercept not possible
|
||||||
return nil;
|
return nil;
|
||||||
}
|
}
|
||||||
|
|
||||||
var t1 = (-b+math.sqrt(b*b-4*a*c))/(2*a);
|
var t1 = (-b+math.sqrt(b*b-4*a*c))/(2*a);
|
||||||
var t2 = (-b-math.sqrt(b*b-4*a*c))/(2*a);
|
var t2 = (-b-math.sqrt(b*b-4*a*c))/(2*a);
|
||||||
|
|
||||||
|
@ -26,6 +26,14 @@
|
|||||||
<onground>true</onground>
|
<onground>true</onground>
|
||||||
</presets>
|
</presets>
|
||||||
|
|
||||||
|
<hud>
|
||||||
|
<path n="1">Aircraft/gci-radar/Hud/hud.xml</path>
|
||||||
|
<visibility n="1">true</visibility>
|
||||||
|
<font>
|
||||||
|
<size type="float">11.0</size>
|
||||||
|
</font>
|
||||||
|
</hud>
|
||||||
|
|
||||||
<menubar>
|
<menubar>
|
||||||
<default>
|
<default>
|
||||||
<menu n="100">
|
<menu n="100">
|
||||||
@ -90,6 +98,8 @@
|
|||||||
<z-offset-max-m type="float">2000.0</z-offset-max-m>
|
<z-offset-max-m type="float">2000.0</z-offset-max-m>
|
||||||
</current-view>
|
</current-view>
|
||||||
|
|
||||||
|
<chase-distance-m type="double" archive="y">-250.0</chase-distance-m>
|
||||||
|
|
||||||
<multiplay>
|
<multiplay>
|
||||||
<generic>
|
<generic>
|
||||||
<int n="0" type="int">0</int>
|
<int n="0" type="int">0</int>
|
||||||
|
Loading…
Reference in New Issue
Block a user