[recherche]Besoin de script "affichage map d'une region"

Répondre
Partager Rechercher
Bonjour,

Je cherchais un script qui peut afficher le map d'une region dans un prim, donc j'en ai trouvé, et quand je met le script dans l'objet il affiche automatiquement le map de la region ou on est,

voici le lien de la script : http://www.aliciastella.com/modules/...php?storyid=43


ce que je voudrais moi c'est de pouvoir choisir la region que je veux que son map s'affiche, en ecrivant le nom de la region dans une note card de configuration ou autre...

peut être ce que je demande et trop, c'est possible de m'aider svp
Coucou,
J'ai trouvé ce script; tu crées un cube, tu mets le script dedans, ça affiche de suite la map de la sim sur laquelle tu es. Pour afficher la map d'une autre sim, tu cliques sur la prim et tu tapes le nom de la sim dans le chat.


Code:
 // Script Name: Mapmaker.lsl
// Author: Runay Roussel
//Retrieves map tile (texture UUID) from Subnova and displays it on a prim.

// Downloaded from : http://www.free-lsl-scripts.com/freescripts.plx?ID=1521

// This program is free software; you can redistribute it and/or modify it.
// License information must be included in any script you give out or use.
// This script is licensed under the Creative Commons Attribution-Share Alike 3.0 License
// from http://creativecommons.org/licenses/by-sa/3.0 unless licenses are
// included in the script or comments by the original author,in which case
// the authors license must be followed.

// Please leave any authors credits intact in any script you use or publish.
////////////////////////////////////////////////////////////////////
// Mapmaker
//
// History:
//
// - a PHP script was created by Lex Mars (founder of Subnova); it accesses the map tiles and returns a texture UUID
// - a small example script (including the URL) was published in the LSL Wiki Script Library
// - the script uses a HTTP request (I used that as a starting point) to retrieve the texture UUID of the map
//
// Added stuff:
//
// - error checking
// - 24 hour timer
// - change map on touch
// - set object name to "Map of ..." (hover mouse over map to see it)
//
// How to use:
//
// - create a cube (change texture if desired)
// - drop the script in it
// - resize as needed
//
// Author: Runay Roussel
// Released to the public domain on September 14th, 2009

float TIME = 86400.0;  // timer interval = 24 hours
integer lsn = 0;       // handle for listener
key request;           // handle for HTTP request
key user;              // key of user touching the prim
string sim;            // sim
string sim_old;        // previous sim
string URL = "http://www.subnova.com/secondlife/api/map.php";  // URL of PHP script
string full_URL;       // full URL including sim name

string capitalize (string text)
{
      return llToUpper(llGetSubString(text, 0, 0)) + llGetSubString(text, 1, -1);
}

getMap(string sim_name)
{
      full_URL = URL + "?sim=" + llEscapeURL(sim_name);
      request = llHTTPRequest(full_URL, [], "");
      llSetTimerEvent(0);
      llSetTimerEvent(TIME);
}

default
{
      state_entry()
      {
            llSetObjectDesc("Touch to change");
            llSetPrimitiveParams([PRIM_FULLBRIGHT, ALL_SIDES, TRUE]);
            user = llGetOwner();
            sim = capitalize(llGetRegionName());  // default sim = current
            sim_old = sim;
            getMap(sim);  // initial map display
      }

      on_rez(integer start_param)
      {
            llResetScript();
      }

      http_response(key request_id, integer status, list metadata, string body)
      {
            if (status != 200) {
                  sim = sim_old;
                  if (status == 499) {
                        if (user) llInstantMessage(user, "Sim not found.");
                  }
                  else {
                        if (user) {
                             llInstantMessage(user, "An unexpected error has occurred. Return code = HTTP " + (string)status);
                             llLoadURL(user, "Full error message", full_URL);
                        }
                  }
            }
            else {
                  if ((key)body) {
                        llSetTexture(body, 1);
                        llSetObjectName("Mapmaker");
                        if (user) llInstantMessage(user, "Rendering map of " + sim + "...");
                  }
                  else if ((key)body == NULL_KEY) {
                        sim = sim_old;
                        if (user) llInstantMessage(user, "Sim exists but has not yet been mapped. Please try again later.");
                  }
                  else {
                        sim = sim_old;
                        if (user) {
                             llInstantMessage(user, "An unexpected error has occurred. Return code = HTTP " + (string)status);
                             llLoadURL(user, "Full error message", full_URL);
                        }
                  }
            }
            llSetObjectName("Map of " + sim);
      }

      timer()
      {
            if (lsn) {
                  llListenRemove(lsn);
                  lsn = 0;
                  llSetTimerEvent(0);
                  llSetTimerEvent(TIME);
                  llInstantMessage(user, "Timeout.");
                  llSetObjectName("Map of " + sim);
            }
            else {
                  user = "";
                  getMap(sim);
            }
      }

      touch_start(integer total_number)
      {
            user = llDetectedKey(0);
            llListenRemove(lsn);
            lsn = llListen(0, "", user, "");
            llSetTimerEvent(0);
            llSetTimerEvent(60);
            llSetObjectName("Mapmaker");
            llInstantMessage(user, "Please type the name of a sim within the next minute.");
      }

      listen(integer channel, string name, key id, string message)
      {
            llListenRemove(lsn);
            lsn = 0;
            sim_old = sim;
            sim = capitalize(message);
            getMap(sim);
      }
}


 
__________________
Plus simple , mais ne fonctionne que sur SL2 , et les viewers basés dessus

Code PHP:

integer definemap 45689;
 
// c est le channel de chat sur lequel la prim ecoute
// dans cet exemple tu taperas "/45689 Karazhan" si tu veux regarder la sim karazhan
// change le channel a ta convenance . j avais chois un channel ou il y a peu de personnes qui parlent 
 
default
{
    
state_entry()
    {
        
llListen(definemapllKey2Name(llGetOwner()), llGetOwner(), "");
    }
 
    
listeninteger channelstring namekey idstring message )
    { 
        
string url =  "http://maps.secondlife.com/secondlife/" message ;
        
llSetPrimMediaParams0,  // Change le numero de face de la prim sur laquelle tu veux afficher
        

        
PRIM_MEDIA_CONTROLS PRIM_MEDIA_CONTROLS_STANDARD
// on affiche les controles standarts , on peut affichier les controles mini PRIM_MEDIA_CONTROLS_MINI , 
// c est plus compact , mais perso j aime bien voir l url appelée pendant le chargement sur la prim en cas de lag
// Change les autres parametres PRIM_MEDIA_AUTO* et PRIM_MEDIA_PERMS* pour controler ou non ta navigation ainsi que de quelle facon a ta convenance
        
PRIM_MEDIA_CURRENT_URLurl ,
        
PRIM_MEDIA_HOME_URLurl ,
        
PRIM_MEDIA_AUTO_LOOP  FALSE,
        
PRIM_MEDIA_AUTO_PLAYTRUE,
        
PRIM_MEDIA_AUTO_SCALE TRUE,
        
PRIM_MEDIA_AUTO_ZOOMTRUE,
        
PRIM_MEDIA_FIRST_CLICK_INTERACT TRUE,
        
PRIM_MEDIA_WIDTH_PIXELS1024,
        
PRIM_MEDIA_WHITELIST_ENABLE TRUE
// on rajoute le domaine de maps de second life dans la liste blanche pour
// empecher la navigation vers d autres domaines . Mets ENABLE a FALSE pour naviguer d autres sites
        
PRIM_MEDIA_WHITELIST"http://maps.secondlife.com",
        
PRIM_MEDIA_PERMS_INTERACTPRIM_MEDIA_PERM_OWNER ,
        
PRIM_MEDIA_PERMS_CONTROL,  PRIM_MEDIA_PERM_OWNER 
        
] );
// tout ce qui suit est la gestion d erreurs , certaines erreurs ne pourront pas se produire car elles controlent simplement l appel a la fonction llsetmediaonprim
        
if ( result == 1000 )
        {
            
llOwnerSay("Function was called with malformed parameters ");
        }
        if ( 
result == 1001 )
        {
            
llOwnerSay("Argument(s) passed to function had a type mismatch ");
        }        
        if ( 
result == 1002 )
        {
            
llOwnerSay("Argument(s) passed to function had a bounds error ");
        }
        if ( 
result == 1003 )
        {
            
llOwnerSay("Object or other item was not found ");
        }
        if ( 
result == 1004 )
        {
            
llOwnerSay("Feature not supported ");
        }                        
        if ( 
result == 1999 )
        {
            
llOwnerSay("An internal error occurred ");
        }  
        if ( 
result == 2001 )
        {
            
llOwnerSay("Whitelist Failed  ");
        }   
        if ( 
result != )
        {
            
llOwnerSay("erreur ou avertissement non documentee  ");
        }                                 
    }

Et voilà , c est tout .. une fonction , pas de services externes.
Pour l execution ,
tu ecris
/45689 le_nom_de_ata_region
Puis tu cliques sur la face sur laquelle se trouve le media on prim .
( seulement la première foispour activer les medias sur cette prim uniquement . A chaque changement de region que tu veux regarder tu n a pas pas besoin de recliquer )
Si tu ne sais pas , en survolant la souris sur chacune des faces , tu la trouveras car il s affichera la barre de controles


D uneautre facon si l url maps.secondlife.com ne te plait pas a cause de toute l intreface autor de la map
tu peux utiliser slurl
remplace dans le script
la ligne
Code PHP:

string url =  "http://maps.secondlife.com/secondlife/" message 

par
Code PHP:

string url =  "http://slurl.com/secondlife/" message 

tu peux aussi construire ton surl via cette page
http://slurl.com/build.php
Répondre

Connectés sur ce fil

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