Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Nexcom Transport

chad Statosky
Nexcom CEO
Join date: 3 Jun 2004
Posts: 66
04-19-2005 16:17
Cool new way to travel From Nexcom FOR free

CODE
integer display = TRUE;//Turns display on and off

string telehub_name = "Periwinkle";//the telehub we are staring at

run()//how to get to the target sim from the telehub sim
{
h(1);//go one sim right
v(7);//eight sims up
// v(-2) would go 2 sims down

execute();//Start
}

integer height = 50; //how far off the ground we want to ride until we hit the target sim

vector target=<245,150,43>; //where in the target sim we want to go
string target_sim_name = "Oculea";


//DONT EDIT ANYTHING PAST HERE


integer sim_y;//vertical
integer sim_x;//horizontal
execute()
{
list temp = movements;
llSetText("Calculating........",<1,0,0>,1);

do
{
if(llList2Integer(temp,0)==0)
{
sim_x += llList2Integer(temp,1);
}
else
{
sim_y += llList2Integer(temp,1);
}
temp=llDeleteSubList(temp,0,1);
}
while(temp!=[]);
offset.x = sim_x*256;
offset.y = sim_y*256;
offset += target;
do
{
if(llList2Integer(movements,0)==0)
{
horiz_m(llList2Integer(movements,1));
}
else
{
vertical_m(llList2Integer(movements,1));
}
movements=llDeleteSubList(movements,0,1);
}
while(movements!=[]);

}
list movements;

v(integer move)
{
movements += [1,move];
}
h(integer move)
{
movements += [0,move];
}
vertical_m(integer move)
{
pos(target+<0,256,0>*move);
}
horiz_m(integer move)
{
pos(target+<256,0,0>*move);
}
pos(vector move)
{

string host = llGetRegionName();
vector unit;
if(move.y<0)unit.y=-256;
if(move.y>255)unit.y=256;
if(move.x<0)unit.x=-256;
if(move.x>255)unit.x=256;
vector pos = llGetPos();
do
{
string region = llGetRegionName();
if(target_sim_name!=region)
{
move.z = llGround(llGetPos())+height;
}
else
{
move.z = target.z;
}
llSetPos(move);
pos = llGetPos();
pos.z = move.z;
region = llGetRegionName();
if(host!=region)
{
move -= unit;
offset -= unit;
host = region;
}
if(display)rundisp();
}
while(move!=pos);
}
vector offset;
rundisp()
{
llSetText((string)llFloor(llVecDist(llGetPos(),offset))+" meters to destination.",<1,0,0>,1);
}
default
{
state_entry()
{
llSitTarget(<0, 0, 0.1>, ZERO_ROTATION);
}
on_rez(integer rez)
{
llSetText("",<1,0,0>,1);
if(llGetRegionName()==telehub_name)
{
if(display)llSay(0,"Sit on me to start.");
llSetText("Sit on me to start.",<1,0,0>,1);
}
else
{
llSay(0, "This object cannot be used from any sim other than "+telehub_name);
}
}
changed(integer change)
{
if (change == CHANGED_LINK)
{
if (llAvatarOnSitTarget() != NULL_KEY)
{
if(llGetRegionName()!=telehub_name)
{
llDie();
}
run();
llDie();
}
}
}
}


edit-put in code markers :D, ne
_____________________
Nexcom - Connecting People.

"I can't understand why people are frightened of new ideas. I'm frightened of the old ones." - John Cage

"For a list of all the ways technology has failed to improve the quality of life, please press three." - Alice Kahn

Nada Epoch
The Librarian
Join date: 4 Nov 2002
Posts: 1,423
Discussion thread
04-21-2005 22:36
/54/b2/43854/1.html
_____________________
i've got nothing. ;)
Sydney Alexander
Registered User
Join date: 19 Feb 2005
Posts: 69
04-23-2005 12:55
This is a cool script chad.. any more info you can provide with it. I hav eit working I think but when I start off the spped seems to slow down to a crawl and 50 above the ground seems crazy, no? I woudl thik you would want ot be high up because if you run into a prim you are done...

Neat idea I have some thoughts on how to use it, but would liek to see if you have an more info on how to use it...

Thanks,!
Sydney Alexander
Registered User
Join date: 19 Feb 2005
Posts: 69
04-23-2005 13:44
Neat Script Chad. I was wondering if you had any more instructions for it? Why 50 off the ground, I would think you would want to be up pretty hinh to avoid objects? how about speed adjustments, can they be made?

I have some Ideas for this, but want to see what othe rinfo you have...

Thanks,