|
Crazed Appin
Registered User
Join date: 13 May 2006
Posts: 7
|
09-03-2006 19:13
hi, Im starting a project involving satelites, I need a few scripts if anyone could help me out.
-Orbitting script, A script that will alow my satelite to orbit around a sim (or sims) automatically.
-Radar(?), A script that will out loud say whoes in the sim, and if there scripted or not, which will then be relayed to an object on the ground.
Thats if for now, if somthign comes up ill post again. feel free to contact me in game for more information on my project (when the logins are back on).
-Crazed Appin
|
|
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
|
09-07-2006 07:38
When you ask about orbitting, exactly what do you require? Why bother with saying it 'out loud' ? All you will do is really annoy everyone, just have the two scripts talk on the same channel i.e. Ground Control Script integer LISTENCHANNEL = -7891; integer TALKCHANNEL = -7890;
Init() { OutputMessage( llGetScriptName() + " - Initialised."); // Listen for chatter from sensor vehicle(s) llListen(LISTENCHANNEL, "","" , ""); }
default { state_entry(){ Init(); } on_rez(integer count) { Init(); }
listen( integer channel, string name, key id, string message ) { // Someone has been detected in range key id = (key)message; // do what ever it is we want to do string name = llKey2name(id); llSay("Hi there " + name); } }
Satelite Script integer Time = 20; integer Range = 50;
integer LISTENCHANNEL = -7890; integer TALKCHANNEL = -7891;
Init() { OutputMessage( llGetScriptName() + " - Initialised."); // Use if you require the ground station to be able to control the vehicle // i.e. change sensor range, time out or to direct the vehicle llListen(LISTENCHANNEL, "","" , ""); // Initiate Sensor (20 Second sweep) llSensorRepeat("", "", AGENT, Range, PI, Time); Show = 1; ShowHide(); }
ShowHide() { llSetStatus(STATUS_PHANTOM, TRUE); llSetAlpha(Show,ALL_SIDES); }
default { state_entry() { state Running; } on_rez(integer count) { llResetScript(); } }
state Running { state_entry(){ Init(); } on_rez(integer count) { Init(); }
listen( integer channel, string name, key id, string message ) { // If required } // Someone has been detected in range sensor(integer total_number) { integer i; if(Mode == LOCKED) { if(total_number > 0) { for(i = 0;i < total_number;i++) { key id = llDetectedKey(i); if(id != NULL_KEY) { // build up a string of sata to transmit back // in this case just the ID llShout(TALKCHANNEL,(string)id); } } } } } }
But be aware of the limits on 'voice' comms, 100m (I think?) for shouts, you may need to use IM or even email for greater range. IM me in world if you want to chat about it all.
|