Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

looking for someone to make a teleporter script....

Allana Dion
Registered User
Join date: 12 Jul 2005
Posts: 1,230
08-26-2005 19:54
I'm looking for a specific kind of teleporter script that can be placed in a prefab home. When the house is pulled out of the box and rezzed the teleporter script would reset itself and adjust for position and rotation automatically. I need the script to be full rights of course. Anyone know someone who is capable of writing something like this?
a lost user
Join date: ?
Posts: ?
08-26-2005 20:10
From: Allana Dion
I'm looking for a specific kind of teleporter script that can be placed in a prefab home. When the house is pulled out of the box and rezzed the teleporter script would reset itself and adjust for position and rotation automatically. I need the script to be full rights of course. Anyone know someone who is capable of writing something like this?


Yup I use this in my own prefabs.. I even have one that has window tinting built in, so it keeps the prims to an absolute minimum:

Be careful, the forums likes to add additional spaces and stuff.

CODE

integer listening;
integer dchannel = 482; // The channel the dialog uses
integer output = 486; // the channel the windows are listening to, to get
// the transparency value. (see Window Tinting script below)

key lastAVkey = NULL_KEY;

start_listen()
{
if(listening) llListenRemove(listening);
listening = llListen(dchannel,"","","");
}

default
{
state_entry()
{
// Because the sittarget is relative to the position of the prim, it doesn't need
// resetting. You just need to adjust the position to whereever you need it to be
// This position is -2.5 metres on Y axis, and +5.0 metres up (z axis)
llSitTarget(<0,-2.5,5.0>, <0,0,0,1>);
}

changed(integer change)
{
key currentAVkey = llAvatarOnSitTarget();
if (currentAVkey != NULL_KEY && lastAVkey == NULL_KEY)
{
lastAVkey = currentAVkey;
if (!(llGetPermissions() & PERMISSION_TRIGGER_ANIMATION))
llRequestPermissions(currentAVkey,PERMISSION_TRIGGER_ANIMATION);
llUnSit(currentAVkey);
llStopAnimation("sit");
llResetScript();
}
}


// All of this touch code is for the window tinting.
touch_start(integer total_number)
{
llDialog(llDetectedKey(0), "Choose level of transparency:",["0","25","50","75","100"],dchannel);
start_listen();
llSetTimerEvent(30.0);
}

// The listen is for the dialog generated by the Touch event
listen(integer channel, string name, key id, string message)
{
llSetTimerEvent(0);
llListenRemove(listening);
llShout(output,message);
}

// The timer turns off the listen if no select on the dialog has been made
// after 30 seconds
timer()
{
llSay(0,"Transparency dialog disabled to reduce lag.");
llListenRemove(listening);
llSetTimerEvent(0.0);
}
}


And here is the Window Tinting script that goes in each window that needs to be tinted:

CODE

integer listening;
integer input = 486;

start_listen()
{
if(listening) llListenRemove(listening);
listening = llListen(input,"","","");
}

default
{
state_entry()
{
start_listen();
}

listen(integer channel, string name, key id, string message)
{
if(message == "0")
{
llSetLinkAlpha(llGetLinkNumber(),1.0,ALL_SIDES);
llSetLinkColor(llGetLinkNumber(),<0,0,0>,ALL_SIDES);
return;
}
if(message == "25")
{
llSetLinkAlpha(llGetLinkNumber(),0.75,ALL_SIDES);
llSetLinkColor(llGetLinkNumber(),<0.1875,0.315,0.315>,ALL_SIDES);
return;
}
if(message == "50")
{
llSetLinkAlpha(llGetLinkNumber(),0.5,ALL_SIDES);
llSetLinkColor(llGetLinkNumber(),<0.25,0.5,0.5>,ALL_SIDES);
return;
}
if(message == "75")
{
llSetLinkAlpha(llGetLinkNumber(),0.25,ALL_SIDES);
llSetLinkColor(llGetLinkNumber(),<0.0,0.25,0.25>,ALL_SIDES);
return;
}
if(message == "100")
{
llSetLinkAlpha(llGetLinkNumber(),0,ALL_SIDES);
return;
}
}
}
Allana Dion
Registered User
Join date: 12 Jul 2005
Posts: 1,230
WOW thank you!
08-26-2005 20:46
I've never tried to script anything before but definately going to play with this, thank you so much!!