A SL vehicle carries a transponder. This broadcastss a signal that says where it is in the simulator.
Instead of an active radar, the receiver merely receives and displays the information.
It is supposed to display the information on a two dimensional black "radar" screen 1 meter by 1 meter.
The dot will not move even when the transponder moves.
Here comes the code, sample data and more description:
Bids are now being taken for production of a radar system that will come as close as functionally possible to the "Dradis" from Battlestar Galactics.
Specifications:
-----------------
Scan the entire sim in all 3 axises
Scan for, and track, multiple fixed and moving targets.
Display this data on a 2D vertical surface as if looking top down onto the sim floor as a "blip". The display will be at a fixed point in the sim to be determined later.
Included in this data should be the pilot's name, position on the Z axis, and distance from the screen.
It must also have different types of markers, depending on what type of aircraft it is tracking.
The entire system, including all scripts, prims, etc. must include full copy, modify, and transfer rights.
-----------------
A fixed price for all work, including demos and testing, and a deadline date for delivery, will be mutually agreed upon. Terms and conditions of payment will be discussed with individual bidders.
Sample data
ship, AV key, name, vector
Here is the basic concept.
We have a 1 meter by 1 meter display screen, kind of like radar
we have a transponder that broadcasts position
Plane,Avatar key,yevka laws,vector
Vector is two dimensional, consists of altitude in the simulator and
LSL Code
Transponder: Broadcasts the location for the other components to pick up.
string ship;
string pilot;
key av;
string Blip_Msg;
string My_Pos;
default {
state_entry() {
llSitTarget(<0, 0, 0.5>, ZERO_ROTATION); // needed for llAvatarOnSitTarget to work
}
changed(integer change) { // either someone sat down or stood up
if (change & CHANGED_LINK) { // and it was a link change (See Bottom)
av = llAvatarOnSitTarget(); // get the key of the av who sat down
if (av) { // if someone is actually sitting down,
ship = llGetObjectDesc(); // get ship type off object description
pilot = llKey2Name(av); // change key into a name...
//llRegionSay(90210, "viper"
; // Broadcast channel number to the consolellSetTimerEvent(1); // Start broadcasting my position
} else {
if (av == NULL_KEY); { // if the pilot left the ship
llRegionSay(90210, "unmanned"
; // Broadcast kill signal to the consolellSetTimerEvent(0); // Stop broadcasting position
}
}
}
}
timer() {
ship = (string) llGetObjectDesc();
vector TempPos = llGetPos();
float x = (TempPos.x);
float y = (TempPos.y);
float z = (TempPos.z);
llSay(0, (string) x);
llSay(0, (string) y);
llSay(0, (string) z);
Blip_Msg = (ship + "," + (string) av + "," + pilot + "," + (string) x + "," + (string) y + "," + (string) z);
//llOwnerSay(Blip_Msg);
llRegionSay(90210, Blip_Msg);
}
}
blip:
Truly troublesome part, which is currently supposed to display a two dimensional graphic ball and move it around the radar screen as thethe transponder moves.
integer Blip_Chan;
float Ratio = .00390625;
string message;
default {
state_entry()
{
llSetObjectName("Blip"
; }
on_rez(integer start_param) {
Blip_Chan = start_param;
llListen(Blip_Chan, "", "",""
;}
listen(integer number, string name, key id, string message) {
if (message != "Die"
{ llSetTimerEvent(1);
} else {
llSay(0, "Die Message"
;llDie();
llSetTimerEvent(0);
}
}
timer() {
list src = llParseString2List(message,[","],[]);
string ship = (llList2String(src, 1));
key PilotKey = (llList2Key(src, 2));
string Pilot = (llList2String(src, 3));
float x = (llList2Float(src, 4));
float y = (llList2Float(src, 5));
float z = (llList2Float(src, 6));
vector My_Pos = llGetPos();
vector Target_Pos = <x,y,z>;
vector Scale_Pos = (Target_Pos - My_Pos) * 0.00390625; // Scale 1mm console = 1m Sim
//llSay(0, (string) (My_Pos + Scale_Pos));
llSetPos(My_Pos + Scale_Pos);
//string Range = (string) (llRound( llVecDist(My_Pos, Target_Pos ) * 10 ) / 10);
//llSetText(avName + "[" + avDistance + "]", <1, 1, 1 >, 1);
}
}
Main problem here is the blip does not move about the screen.
Suggestions welcome.
