PDA

View Full Version : Unstable vortex protection


Henning Lionheart
28-06-2009, 12:00 PM
Lately I've had lots of accidents at my gate, as landing point is located right in front of it, and some days I have someone constantly dialling my gate, then shutting down the wormhole right after it's been established.


Some days I consider just leaving the iris closed, but that's not terribly useful in most cases, so I put some added security into a script.


[START]

<pre>integer mw;
integer peg;
default
{
state_entry()
{
mw = llListen(-905000,"",NULL_KEY,"");
peg = llListen(-805000, "",NULL_KEY,"");
llListen(0, "", NULL_KEY, "");
llListen(123, "", NULL_KEY, "");
}

listen(integer channel, string name, key id, string message)
{
if( message == "status|incoming" )
{
llListenRemove(mw);
llListenRemove(peg);
llSay(123, "/stargate raise");
llSleep(8);
llSay(123, "/stargate lower");
llSleep(30);
llResetScript();
}
else if(llGetSubString(message, 0, 4) == "/dial")
{
llSay(123, "/dial" + llGetSubString(message, 5, -1));
llSay(123, "/stargate raise");
llSleep(16);
llSay(123, "/stargate lower");
}
else if(llGetSubString(message, 0, 1) == "/d")
{
llSay(123, "/dial" + llGetSubString(message, 2, -1));
llSay(123, "/stargate raise");
llSleep(16);
llSay(123, "/stargate lower");
}
}
}</pre>


[END]


Please note that is you do not remove the listen right away, the iris will close again as soon as it opens, due to receiving the message twice. Once when the gate starts dialing and once when the wormhole has been established.


Generally 5 seconds should be enough to avoid accidents, and 8 seconds might be too long and could cause an incoming traveler to meet a terrible fate. Adjust to your own liking.


The script also makes sure to close the iris/shield when someone dials out. 15 seconds is usually enough, however sometimes you'll find yourself waiting for it to close, while at other times you have to dash for safety when it opens too soon.

I thought I'd rather wait a few seconds longer than get killed..


I put this in the death box.. Without death, these would be rather pointless.

Henning Lionheart
28-06-2009, 12:46 PM
Actually, I think this version is sufficient for performing the same functions with much less code.. And it shouldn't open the iris/shield too early or late.


But at my current location, I do not have the ability to test this..


[START]

´


default

{

state_entry()

{

llListen(-905000,"",NULL_KEY,"");

llListen(-805000, "",NULL_KEY,"");

}


listen(integer channel, string name, key id, string message)

{

if( message == "status|dialing" )

{

llSay(123, "/stargate raise");

}

else if( message == "stargate open" )

{

llSleep(5);

llSay(123, "/stargate lower");

}

}

}


´

[END]


One thing I'm not entirely sure of.. Does an incoming wormhole produce status|dialing ?

Henning Lionheart
28-06-2009, 01:55 PM
This is the final and tested code.. Sorry about the spam, could an admin take care of that, please?


[START]

<pre>//unstable vortex protection.lsl

integer mw;
integer peg;
default
{
state_entry()
{
mw = llListen(-905000,"",NULL_KEY,"");
peg = llListen(-805000, "",NULL_KEY,"");
}

listen(integer channel, string name, key id, string message)
{
if( message == "status|incoming" )
{
llListenRemove(mw);
llListenRemove(peg);
llSay(123, "/stargate raise");
llSleep(8);
llSay(123, "/stargate lower");
llSleep(30);
llResetScript();
} else if( message == "status|dialing" )
{
llSay(123, "/stargate raise");
}
else if( message == "stargate open" )
{
llSleep(5);
llSay(123, "/stargate lower");
}
}
}</pre>


[END]

Jeri Carter
30-06-2009, 10:09 PM
Well you could always not stand in front of it that works too

Kira Wolkenberg
30-06-2009, 10:45 PM
You could also come up with a way to not allow wormholes to jump from one gate to another, say two pegasus in 20 meters of each other dials, they have a tendency to either cancel both out or only one takes. that is on the Pegasus and Forerunner that I tested that on, kinda dislike that, but I rarely use two of the same gates in close proximaty of each other.

Jeri Carter
30-06-2009, 10:57 PM
Per sim only one gate of each kind Milkyway and Pegasus can be active at a time that is why the second fails to dial every time.

Kira Wolkenberg
01-07-2009, 07:39 AM
Okay now I understand, thats a weird feature, but makes sense.

Henning Lionheart
01-07-2009, 12:33 PM
Okay, the script is now in 3 parts. One for the general iris control, one to close to iris on incoming wormholes, and one to cut the gate after 38 minutes, in case the other end has a script constantly sending EMP signals.


I've noticed lots of connections to my gate lasting well over that time, which is unrealistic (unless the other side is very close to a wormhole)


So here goes:

[START]

<pre>//unstable vortex protection.lsl

default
{
state_entry()
{
llListen(-905000,"",NULL_KEY,"");
llListen(-805000, "",NULL_KEY,"");
}

listen(integer channel, string name, key id, string message)
{
if( message == "status|dialing" )
{
llSay(123, "/stargate raise");
}
else if( message == "status|outgoing" )
{
llSleep(0.5);
llSay(123, "/stargate lower");
}
else if( message == "status|idle" )
{
llSleep(0.5);
llSay(123, "/stargate lower");
llResetOtherScript("38m.lsl");
llResetOtherScript("incoming");
}
else if( message == "stargate open" )
{
llSleep(.5);
llSay(123, "/stargate lower");
llResetOtherScript("incoming.lsl");
}
}
}</pre>


[END]


[START]

<pre>//incoming.lsl

integer mw;
integer peg;
default
{
state_entry()
{
mw = llListen(-905000,"",NULL_KEY,"");
peg = llListen(-805000, "",NULL_KEY,"");
}

listen(integer channel, string name, key id, string message)
{
if( message == "status|incoming" )
{
llListenRemove(mw);
llListenRemove(peg);
llSay(123, "/stargate raise");
}
}
}</pre>


[END]


[START]

<pre>//38m.lsl

default
{
state_entry()
{
llListen(-905000,"",NULL_KEY,"");
llListen(-805000, "",NULL_KEY,"");
}

listen(integer channel, string name, key id, string message)
{
if( message == "stargate open" )
{
llSleep(2280);
llSay(-904000, "cut wormhole");
llSay(-804000, "cut wormhole");
}
}
}</pre>


[END]


Just put them all in 1 prim. Save a prim by putting them in Death, if you wish.

Jeri Carter
01-07-2009, 02:56 PM
The 38 min rule is strictly followed by the network. No gate, no matter what can stay open after 38 min. Even with an EMP script forcing the gate open It will close at about 38min.


Also zach said in the forum

"I believe that next update I will make it so if it's not an avatar it will ignore non-avatars."

In reference to the /123 commands. So next update this will not work if he follows through with it.

Henning Lionheart
01-07-2009, 08:31 PM
Well in that case, simply replace



llSay(123, "/stargate raise");

with

llSay(-904000, "raise shield");

llSay(-804000, "raise shield");


and

llSay(123, "/stargate lower");

with

llSay(-904000, "lower shield");

llSay(-804000, "lower shield");



Or should I post the entire code?


Regarding the 38 minutes, I've experiences wormholes of up to 41 minutes on my gate.

True, the log here says less than 38 minutes, but my tests with a stopwatch says otherwise. I know it's a small thing, but I'm gonna keep 38m.lsl running here :)

Kira Wolkenberg
02-07-2009, 06:59 PM
Wait Jeri, so your saying that in the future releases the force spin command channel /123 won't work for anything? or is that just the stargate emp pulse...


And so much for a satellite weapon like the Asurans used in Stargate Atlantis. the Stargate satellite weapon was powered by a load of ZPMs on the other side of the gate. and it was able to keep the gate open for 38+ minutes almost indefinitely. I also thought they was a reference to a stargate SG-1 episode where it was used too.

Jeri Carter
04-07-2009, 01:37 PM
no the /123 will still work for all commands available if said by an avatar, but not by an object. Gestures should be unaffected by this change because the avi still says the command.


Yes it is true that a zpm or black hole can maintain a wormhole almost indefinitely but the network does not support such options. and really it is unrealistic to think that it should. even in a Role Play an emp device holding the gate open for 38 minutes should be enough i would think. and if you really need to make it indefinitely you could build your own event horizon and make it kill from one side and offer the tp map from the other.