teleporteur

Répondre
Partager Rechercher
bonjour,

J ai un script pour se téléporter mais je voudrais savoir si c est possible qu il m affiche par exemple les 5 meilleurs SPLODE parmi une liste d adresse ??

vector target=<33,31,33>; // <--- Entrez les coordonnées (ici, les coordonnées de l adresse de destination)

default
{
state_entry()
{
llSetText("Aller a l adresse",<255,255,255>,5); // <--- Changer le nom de la destination
llSetSitText("Teleport");
rotation my_rot=llGetRot();
llSitTarget((target - llGetPos()) / my_rot,ZERO_ROTATION / my_rot);
}
changed(integer change)
{
llUnSit(llAvatarOnSitTarget());
}
}


Pouvez vous m aider ?

merci

chris
Salut,

Alors ci dessous un script qui te permet de référencer plusieurs destinations et les consultés dans une petite boite de dialogue, le seul problème c'est que j'ai pas trop compris comment sa fonctionne.

/!\ Script un peu long /!\

Cliquez ce bouton ou survolez le contenu pour afficher le spoiler
// TELEPORTER BEAM
// APRIL 21 2006 - CUBEY TERRA
// This is one of a two part teleporter. This part is the beam. The other part is the teleporter pad.
// The pad rezzes new beams, then loads the beam with destinations via chat messages.

// The beam use llSetPos to move the seated avatar to another location, then unsits the
// avatar and deletes itself. The pad rezzes a fresh beam once this beam has left the pad.


key agent;

integer sit;
integer line;
integer currDestNum = 0;
integer dlgChannel = 884937; //listen channel for llDialog
integer padChannel = 20060420; // listen channel for pad
integer list_len;
integer groupLock;
integer listentrack;
integer listentrack2;
integer timeOut = 60;
integer timeOutCurr;


float alphaIdle = 0.25; // transparency when the transport beam is idle
float alphaActive = 0.5; // transparency when the transport beam is energized

string notecard = "destinations"; // name of the notecard
string standAnim = "turn_180"; // name of standing animation
string tpAnim = "ball"; // name of the teleporting animation

string transport = "47117bd7-41e8-530d-439c-94bee925fbb7"; // UUID of transporter sound
string invisible = "38b86f85-2575-52a9-a531-23108d8da837"; // UUID of the nifty invisi texture
string snow = "00af7673-fe50-9c99-53c9-470a48461c0c"; // UUID of the tv snow texture

string currDestName;

string unAuthorizedMsg = "You are not authorized to use this teleporter.";

vector currDestPos;
vector startPos;
vector pos;
vector sizeLoading = <0.95,0.95,0.01>; // size of beam while loading destination data
vector sizeActive = <0.95,0.95,5.5>; // size of beam while travelling
vector sizeIdle = <0.95,0.95, 0.06>; // size of beam while idle on the pad

list destNamesList;
list destPosList;



energize() // teleport sequence
{
// dematerialization effect...
llTriggerSound(transport, 1);
llWhisper(0,"Dematerializing "+llKey2Name(agent)+" to pattern buffer...");
llSetAlpha(alphaActive,ALL_SIDES);
llSetPrimitiveParams([PRIM_SIZE, sizeActive]);
llSleep(1);
llSetAlpha(1,ALL_SIDES);
llSetTexture(invisible, ALL_SIDES);
llStopAnimation(standAnim);
llStartAnimation(tpAnim);
llWhisper(0,"Transporting...");


// move to destination...
pos = llGetPos();
while (pos != currDestPos)
{
llSetPos(currDestPos);
pos = llGetPos();
}

// arrive and materialize...
llWhisper(0,"Materializing "+llKey2Name(agent)+" from pattern buffer...");
llTriggerSound(transport, 1);
llUnSit(agent);
llSetAlpha(alphaActive, ALL_SIDES);
llSetTexture(snow,ALL_SIDES);
llSleep(2);
llWhisper(0,"Transport successful.");
llDie(); // delete beam
}

init()
{
llSetText("RECHARGHING\nPlease wait...",<1,0,0>,0.1);
listenStatus(TRUE); // start the listen
llSetPrimitiveParams([PRIM_TEMP_ON_REZ, TRUE, PRIM_SIZE, sizeLoading]);
llSetColor(<0,1,1>,ALL_SIDES);
llSetAlpha(alphaIdle, ALL_SIDES);
dlgChannel = (integer)(llFrand(10000)+1000); // randomize dialog channel to avoid conflicts with nearby teleporters
}

listenStatus(integer onOff)
{
// remove existing listens (if any)
if (listentrack)
{
llListenRemove(listentrack);
listentrack = 0;
}
if (listentrack2)
{
llListenRemove(listentrack2);
listentrack2 = 0;
}

// start new listen if told to
if (onOff == TRUE)
{
listentrack = llListen(dlgChannel, "", "", ""); // for the dialogs
listentrack2 = llListen(padChannel, "","",""); // for the pad
}
// To reduce lag, both listens are shut off after a short time.
llSetTimerEvent(1.0); // Start timer to shut off Listen
}

menu()
{
listenStatus(TRUE); // start the menu listen
string dText = "TELEPORTER CONTROL\nCurrent destination:\n\t"+(string)(currDestNum+1)+". "+currDestName+"\n\t"+llGetRegionName()+"("+(string)((integer)currDestPos.x)+", " + (string)((integer)currDestPos.y) + ", " + (string)((integer)currDestPos.z) + ")";
llDialog(agent,dText,["Previous","Next","ENERGIZE!","Say List"],dlgChannel);
}


setDest()
{
// As the name implies, it sets the destination to whatever the current dest num is.
// Destination numbers are index numbers in each list. The current number is set via the menu.
list_len = llGetListLength(destNamesList);
currDestName = llList2String(destNamesList, currDestNum);
currDestPos = (vector)llList2String(destPosList, currDestNum);
}

default
{
state_entry()
{
init();
llSitTarget(<0,0,1.0>,ZERO_ROTATION);
llSetSitText("Teleport");
llSetTextureAnim (ANIM_ON | LOOP, ALL_SIDES, 4, 4, 0, 0, 15.0);
}

on_rez(integer num)
{
llResetScript();
}

listen(integer channel, string name, key id, string message)
{
message = llToLower(message);

if (channel == padChannel) // check for messages from the teleporter pad
{
if (llSubStringIndex(message, "name") == 0) // add a new destination name
{
string newName = llGetSubString(message, 4, llStringLength(message));
destNamesList += newName;
}
else if (llSubStringIndex(message, "dest") == 0) // add a new destination vector
{
string newDest = llGetSubString(message, 4, llStringLength(message));
destPosList += newDest;
}
else if (message == "loaded") // done loading, so resize and remove hovertext
{
listenStatus(FALSE); // stop listening
llSetPrimitiveParams([PRIM_SIZE, sizeIdle]);
llSetText("",ZERO_VECTOR,1);
}
else if (message == "public") // pad says the beam is public use
{
groupLock = FALSE;
}
else if (message == "group")// pad says the beam is group-only
{
groupLock = TRUE;
}
}
else if (channel == dlgChannel) // check for messages from the dialog
{
// User clicks next/previous buttons in dialog to browse destinations
if (message == "next")
{
if (currDestNum < (list_len - 1)) currDestNum += 1;
else currDestNum = 0;
setDest();
menu();
}
else if (message == "previous")
{
if (currDestNum > 0) currDestNum -= 1;
else currDestNum = (list_len - 1);
setDest();
menu();
}
else if (message == "energize!")
{
energize();
}
}

}


changed(integer change)
{

if (change & CHANGED_LINK)
{
integer authorized = TRUE;
agent = llAvatarOnSitTarget();
if ((agent != NULL_KEY) && (!sit))
{
if (groupLock) // if locked to group use only by owner
{
if (!llSameGroup(agent)) authorized = FALSE;
}

if (authorized)
{
llRequestPermissions(agent, PERMISSION_TRIGGER_ANIMATION);
sit = TRUE;
setDest();
menu();
llStopAnimation("sit");
llStartAnimation(standAnim); // assume the position
}
else // if group-only mode and user is not group member
{
llWhisper(0,unAuthorizedMsg);
llUnSit(agent);
}
}
else if (agent == NULL_KEY && sit) // avatar stands (manually or unseated at end of trip)
{
llStopAnimation(standAnim);
llStopAnimation(tpAnim);
sit = FALSE;
}
}
}

timer()
{
// stop the Listen after timeOut seconds have past
if (timeOutCurr < timeOut)
{
timeOutCurr += 1;
}
else
{
listenStatus(FALSE); // stop the listen
timeOutCurr = 0;
//llWhisper(0,"Standby mode.");
llSetTimerEvent(0.0); // stop the timer
}

}
}
voilà j ai tester mais je n arrive pas si il y a plus simple enfaîte je veus juste qu il recherche dans la liste des adresses données qu il recherche le meilleur des splode ??


vector target=<33,31,33>; // <--- Entrez les coordonnées (ici, les coordonnées de l adresse de destination)

default
{
state_entry()
{
llSetText("Aller a l adresse",<255,255,255>,5); // <--- Changer le nom de la destination
llSetSitText("Teleport");
rotation my_rot=llGetRot();
llSitTarget((target - llGetPos()) / my_rot,ZERO_ROTATION / my_rot);
}
changed(integer change)
{
llUnSit(llAvatarOnSitTarget());
}
}


merci à vous

chris
Répondre

Connectés sur ce fil

 
1 connecté (0 membre et 1 invité) Afficher la liste détaillée des connectés