Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

llWarpPos Cross-Sim Transportation

Khalek Trescothick
Registered Idiot
Join date: 28 Dec 2005
Posts: 10
06-04-2006 08:05
I have decided to release my llWarpPos Cross-Sim Transport script. The warpPos was made by , and has made this a viable option. This is open source...You may make things with it, sell things with it, but I will hunt you down if you try to scam people into buying this script as-is. When selling this script, please sell it no-modify...There are people out there who would not look in forums for this, but would steal it as their own idea from products.

CODE

//Warp Cross-Sim Teleportation
//Warp from warpPos script by Keknehv Psaltery
//Full Script by Khalek Trescothick
//This Script is classified as open-source
//Do not remove this header
vector pos;
vector my_pos;
vector g_target;
vector save;
string sim;
string dest_sim;
integer c = 92805;
integer NeedToCrossSim = FALSE;
integer near_check = FALSE;
integer target = FALSE;
llWarp2Pos( vector d )
{
if ( d.z > 768 )
d.z = 768;
integer s = (integer)(llVecMag(d-llGetPos())/10)+1;
if ( s > 100 )
s = 100;
integer e = (integer)( llLog( s ) / llLog( 2 ) );
list rules = [ PRIM_POSITION, d ];
integer i;
for ( i = 0 ; i < e ; ++i )
rules += rules;
integer r = s - (integer)llPow( 2, e );
if ( r > 0 )
rules += llList2List( rules, 0, r * 2 + 1 );
llSetPrimitiveParams( rules );
}
default
{
on_rez(integer rez)
{
llResetScript();
}
state_entry()
{
llListen(92805, "", "", "");
llSitTarget(<0,0,0>,ZERO_ROTATION);
}
dataserver(key TID, string data)
{
g_target += (vector)data;
vector G2 = g_target;
G2.z = 200;
save = llVecNorm(G2 - llGetRegionCorner());
if(llRound(save.y*2)>0)
save = <127,255,200>;
else if(llRound(save.y*2)<0)
save = <128,0,200>;
else if(llRound(save.x*2)>0)
save = <255,128,200>;
else if(llRound(save.x*2)<0)
save = <0,128,200>;
if(llEdgeOfWorld(llGetPos(), llVecNorm(save - llGetPos())))
{
save = llVecNorm(g_target - llGetRegionCorner());
if(llRound(save.x*2)>0)
save = <255,128,200>;
else if(llRound(save.x*2)<0)
save = <0,128,200>;
else if(llRound(save.y*2)>0)
save = <128,255,200>;
else if(llRound(save.y*2)<0)
save = <128,1,200>;
if(llEdgeOfWorld(llGetPos(), llVecNorm(save - llGetPos())))
{
llWhisper(0,"Pinpoint Error");
llUnSit(llAvatarOnSitTarget());
llSleep(1.0);
llDie();
}
}
NeedToCrossSim=TRUE;
llWarp2Pos(save);
llMessageLinked(-1,0,"done","");
}
link_message(integer prim,integer chan,string m, key id)
{
if(m == "done")
{
if(NeedToCrossSim)
{
vector P = llGetPos();
if(P.x==0)
P.x = -3;
else if(P.x==255)
P.x = 258;
if(P.y==0)
P.y = -3;
else if(P.y==255)
P.y = 258;
llSleep(3.5);//Needed delay so you do not crash over sim borders!
llSetPos(P);
NeedToCrossSim = FALSE;
llSleep(4);
}
sim = llGetRegionName();
if(sim != dest_sim)
{
g_target.z = 200;
save = llVecNorm(g_target - llGetRegionCorner());
if(llRound(save.y*2)>0)
save = <128,255,200>;
else if(llRound(save.y*2)<0)
save = <128,0,200>;
else if(llRound(save.x*2)>0)
save = <255,128,200>;
else if(llRound(save.x*2)<0)
save = <0,128,200>;
if(llEdgeOfWorld(llGetPos(), llVecNorm(save - llGetPos())))
{
save = llVecNorm(g_target - llGetRegionCorner());
if(llRound(save.x*2)>0)
save = <255,128,200>;
else if(llRound(save.x*2)<0)
save = <0,128,200>;
else if(llRound(save.y*2)>0)
save = <128,255,200>;
else if(llRound(save.y*2)<0)
save = <128,0,200>;
}
NeedToCrossSim = TRUE;
llWarp2Pos(save);
llMessageLinked(-1,0,"done","");
}
else if(sim == dest_sim)
{
NeedToCrossSim = FALSE;
llWarp2Pos(my_pos);
llSay(0,"Luccyy im hoomee");
llUnSit(llAvatarOnSitTarget());
llDie();
}
}
else
{
pos = g_target - llGetRegionCorner();
}
}
changed(integer change)
{
if(change & CHANGED_REGION)
{
llMessageLinked(LINK_SET, 0, "done", "");
}
}
listen(integer channel,string name,key id,string message)
{
if(message == message)
{
list d = llParseString2List(message,["*"],[]);
list p = llCSV2List(llList2String(d,0));
float x = llList2Float(p,0);
float y = llList2Float(p,1);
float z = llList2Float(p,2);
pos = <x,y,z>;
my_pos = <x,y,z>;
llMessageLinked(LINK_SET, 0, "bu", NULL_KEY);
dest_sim = llList2String(d,1);
if(llGetSubString(dest_sim,0,0) == " ")
{
dest_sim = llGetSubString(dest_sim,1,-1);
}
if(llGetRegionName() == dest_sim)
{
llWarp2Pos(my_pos);
}
else
{
llRequestSimulatorData(dest_sim, DATA_SIM_POS);
}
}
}
}


Have Fun!
Nada Epoch
The Librarian
Join date: 4 Nov 2002
Posts: 1,423
Discussion Thread
06-05-2006 21:16
/54/2e/111974/1.html
_____________________
i've got nothing. ;)
Zack Cline
Registered User
Join date: 22 Jun 2005
Posts: 59
06-05-2006 21:31
Ok, so would this allow a self propeled rocket like object to cross sim boarders? If so please tell me because I have been looking for something like this for the whole day now.
Zack Cline
Registered User
Join date: 22 Jun 2005
Posts: 59
06-05-2006 21:34
So would this allow a rocket like object to cross sim boarders? If so, do I need to edit anything in the script to allow it to work in an object?