Jump to content
Sign in to follow this  
JJValero Writer

Auto-Teleport HUD

Recommended Posts

This is the skeleton of a HUD for use with stargates of OpenGate network, new AGA network and Alteraan network. This uses the new teleport function and do not need the map. Just cross the horizont and teleport is automatic.

 

integer CHANNEL = -900000;

string g_sRegion = "";
vector g_vLocal = ZERO_VECTOR;
vector g_vLookAt = ZERO_VECTOR;

default {
    
    state_entry() {

        llRequestPermissions(llGetOwner(), PERMISSION_TELEPORT);
        llListen(CHANNEL, "", NULL_KEY, "");
                
    }
    
    on_rez(integer start_param) {
     
        llResetScript();
           
    }
    
    run_time_permissions(integer perm) {

        if (!(perm & PERMISSION_TELEPORT))
        {
            llOwnerSay("I need permissions to teleport you!");
            llRequestPermissions(llGetOwner(), PERMISSION_TELEPORT);
        }
    }
    

    listen(integer channel, string name, key id, string message) {
        
        list lTokens = llParseString2List(message, ["|"], []);
        
        string sMap = llList2String(lTokens, 0);
        if (sMap != "map") {
            return;
        } // if
        
        key kKey = (key)llList2String(lTokens, 1);
        if (kKey != llGetOwner()) {
            return;
        } // if
        
        g_sRegion = llList2String(lTokens, 2);
        g_vLocal = (vector)llList2String(lTokens, 3);
        rotation rRot = (rotation)llList2String(lTokens, 4);
        g_vLookAt = g_vLocal + (llRot2Fwd(rRot) * 10.0);
        
        llRequestSimulatorData(g_sRegion, DATA_SIM_POS);   //DATA_SIM_STATUS

    }
    
    dataserver(key query_id, string data) {
        
        vector vGlobal = (vector)data;
        llTeleportAgentGlobalCoords(llGetOwner(), vGlobal, g_vLocal, g_vLookAt);

    }
    
}

 

This is a minimun version and many improvements are possible. For example, sometimes the teleportation takes some time, and if you cross twice the same horizon, you can get stuck in the destination if you want you can add code to avoid duplication. Another possible improvement is to set On or Off the HUD if you click on it.

 

Share this post


Link to post
Share on other sites

One major problem with this: It responds to any teleport instruction, regardless of source. Or in other words, a nefarious griefer could write a script that TPs people in the entire sim to some random place by just spamming llRegionSay with a destination coordinate.

The easy but annoying way is to ask permission on each teleport request. A slightly more complex but still abusable way is to check owner/group of the sending object and match it with either the HUDs group, or with the land owner or group.

The proper way is probably to implement a permission system where it asks the user to either:

  • Permit the TP once
  • Permit all TPs from all of the gate owners objects
  • Permit all TPs from all of the gate groups objects

Btw, I went a different route and just hooked into the RLV spec for "forced" teleports. It's more universal and works with stargates as well as some other RLV scripted teleports.

Share this post


Link to post
Share on other sites

This is just the skeleton, which can be completed to everyone's taste.  One way to securing HUD is knowing in advance the UUID of the event horizon.  

Want a hint?:   Event Horizon whispers: touch the event horizon to teleport

The solution you propose I do not consider acceptable. If every time it is necessary to click, I prefer the map. at least i know in advance where I go.

 

Postscript: The google translator works worse every day. Perhaps it is being vandalized.

 

 

 

 

Share this post


Link to post
Share on other sites

The problem is that a script has no way of knowing it's talking to a legitimate Stargate. Or in other words: Use at your own risk. I merely believe people should know the caveats of the script as it is.

Share this post


Link to post
Share on other sites


Talia Davidov wrote:

Since llTeleportAgentGlobalCoords only works for the owner of the object, this will only allow the owner of the stargate to use that stargate.

Correction: It only allows the owner of the HUD. That does NOT have to be the owner of the stargate. While I would not recommend the script as-is for obvious reasons... drop it into a prim, attach the prim anywhere and walk through any Stargate. It'll teleport you just fine, whether you own the Stargate or not.

 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...