Jump to content

KT Kingsley

Resident
  • Posts

    1,072
  • Joined

  • Last visited

Posts posted by KT Kingsley

  1. Depending on which viewer you're using and how you've set it up, you can click on the object's name in its chat header or in Nearby Chat, or Conversations, or Chat History, or mouse over its name and click the little "i" button that shows up. This will open a little dialog telling you who owns it and where it is.

    If it shows you as the owner, and the map shows it right on top of you wherever you go, then it'll be something you're wearing.

    • Like 1
  2. I think we need to see the script being used, the linkset it's in (and specifically which textures are in which prim of the linkset... and which prim in the linkset the script is in) and the permissions of the textures involved (as they relate to the owner) to be able to get a handle on the issue.

    • Like 1
  3. You can get the map texture UUIDs from Tyche Shepherd's grid survey, as well as other places, I think. You could make a square mesh plane with four square faces for the textures which you'd move around behind a border and swap the textures around to keep the desired location central.

    • Like 1
  4. One thing to look out for when rezzing on water is that your viewer often takes the rezz point to be the land where your cursor would be pointing if there wasn't any water in the way. If you're having trouble in what you know to be a valid rez zone, try looking straight down when you try to rez something.

  5. Having just started messing around with the LSL Json functions, I thought I would be a good idea to write a function that'd chat out a JSON string neatly formatted:

    Json2Text (string json)
    {
        string TAB = "    ";
        string output;
        string line;
        string tabs;
        integer quotes;
        integer new_line;
        integer index;
        integer length = llStringLength (json);
        do
        {
            string character = llGetSubString (json, index, index);
            if (character == "\\")
            {
                ++index;
                string next_character = llGetSubString (json, index, index);
                line += "\\" + next_character;
            }
            else if (character == "\"")
            {
                line += "\"";
                quotes = !quotes;
            }
            else if (character == "," && !quotes)
            {
                line += ",\n";
                new_line = TRUE;
            }
            else if (character == "{" && !quotes)
            {
                line += "\n" + tabs + "{\n";
                tabs += TAB;
                new_line = TRUE;
            }
            else if (character == "}" && !quotes)
            {
                tabs = llDeleteSubString (tabs, 0, llStringLength (TAB) - 1);
                line += "\n" + tabs + "}";
            }
            else if (character == "]" && !quotes)
            {
                tabs = llDeleteSubString (tabs, 0, llStringLength (TAB) - 1);
                line += "\n" + tabs + "]";
            }
            else if (character == "[" && !quotes)
            {
                line += "\n" + tabs + "[\n";
                tabs += TAB;
                new_line = TRUE;
            }
            else line += character;
            if (new_line)
            {
                if (llStringLength (output + line) > 1000)
                {
                    llOwnerSay ("Json2Text working..." + llStringTrim (output, STRING_TRIM_TAIL));
                    output = "\n" + line;
                }
                else output += line;
                line = tabs;
                new_line = FALSE;
            }
        }
        while (++index < length);
        if (output + line != "") llOwnerSay ("Json2Text working..." + output + line);
        llOwnerSay ("Json2Text finished.");
    }

    I have encountered one problem that I think may be to do with LSL's implementation: when I insert a backslash as a JSON value ("\\") it seems to mess up its own and some or all subsequent llJsonGetValue calls. See the commented-out lines in the test script below.

    default
    {
        state_entry ()
        {
            integer count;
            string value = llList2Json 
            (
                JSON_OBJECT,
                [
                    "JSON test", llList2Json 
                    (
                        JSON_OBJECT, 
                        [
                            "item " + (string) (++count), PI, 
                            "item " + (string) (++count), TRUE, 
                            "item " + (string) (++count), FALSE, 
     //                      "item " + (string) (++count), "\\",
                            "item " + (string) (++count), "boring \\old text", 
                            "item " + (string) (++count), "\"", 
                            "item " + (string) (++count), "\n", 
                            "item " + (string) (++count), "\t",
                            "item " + (string) (++count), llList2Json (JSON_ARRAY, [1, "two", PI]), 
                            "item " + (string) (++count), "\nleading newline", 
                            "item " + (string) (++count), "trailing newline\n", 
                            "item " + (string) (++count), "inline\nnewline", 
    //                        "item " + (string) (++count), "\\",
                            "item " + (string) (++count), "\boring ol\d t\ext", 
                            "item " + (string) (++count), "\tleading tab", 
                            "item " + (string) (++count), "trailing tab\n", 
                            "item " + (string) (++count), "inline\ttab", 
                            "item " + (string) (++count), "boring old text", 
                            "item " + (string) (++count), JSON_TRUE, 
                            "item " + (string) (++count), JSON_TRUE, 
                            "item " + (string) (++count), JSON_FALSE, 
                            "item " + (string) (++count), JSON_NULL
                        ]
                    )
                ]
            );
            llOwnerSay (value);
            Json2Text (value);
    //        integer count0;
    //        do llOwnerSay ("item " + (string) (++count0) + ": " + llJsonGetValue (value, ["JSON test", "item " + (string) (-~count0)]));
    //        while (count0 < count);
        }
    }

    I shall, of course, welcome comments, criticisms and suggestions.

    • Like 2
    • Thanks 1
  6. 4 hours ago, ellestones said:

    i just add on a little note here about ++i vs i++

    in LSL it doesn't make any difference.

    It does work as it should LSL.

    default
    {
        state_entry ()
        {
            integer x;
            integer y;
            llOwnerSay ((string) (++x));
            llOwnerSay ((string) (y++));
        }
    }

    [11:47:06] Object: 1
    [11:47:06] Object: 0

    • Like 1
    • Thanks 1
  7. As this sounds like you'd've done a clean install of SL, it might be that the default logout settings have been reinstated.

    In Preferences/General, at the bottom is the Away timeout setting. In Firestorm there's the additional Log out after being marked away setting. In the SL viewer you'll have to set the debug setting QuitAfterSecondsOfAFK manually.

    ETA: Just looked in the SL viewer, and there doesn't seem to be a debug setting called QuitAfterSecondsOfAFK. There is one called QuitAfterSeconds, but that seems to work differently, maybe the time since login?

    So I suspect I've been talking rubbish here. Sorry.

×
×
  • Create New...