Jump to content

Internal Server Compile Error. Any ideas?


Lilac Melodious
 Share

You are about to reply to a thread that has been inactive for 1001 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

Alright, here I am again with an odd issue. I'm working on a script that rezs an object on keyword, for roleplay purposes. I keep getting a compile error from the internal server. I have looked at a few topics and have tried a few sims, both on the main channel, one a homestead, and the other being the mainland. Nothing new, but largely in-progress, and i stopped at object_rez to test to see if it compiled, hence why it's commented out here. Here's the script:

////////////
////VARS////
////////////
key id = llGetOwner;
string trgr = "poops"; // Word to trigger.
string objName = "test"; // Name of the object to be rezed.
//integer lstChannel = 4; // Channel to listen for the trigger word on 
integer mem = 32768; // Memory limit for the script.
integer lstHandle;
//----------//

start(integer inputInteger)
{
    lstHandle = llListen(4, "", id, trgr);
    llSetMemoryLimit(inputInteger);
    llOwnerSay("Script has started.");
    llListen(4, "", id, "");
}

orez()
{
    llOwnerSay("Object is rezzed. Restarting.");
    llResetScript();
}

default
{
    state_entry()
    {
        start(mem);
        
        llGetAttached();
        if (llGetAttached() != 40)
        {
            llOwnerSay("Please add me to Avatar Center before use.");
        }
    }
    listen(integer channel, string name, key id, string message)
    {
        if (message == trgr)
        {
            llRezAtRoot(objName, (vector)llGetPos(), ZERO_VECTOR, ZERO_ROTATION, 1);
        }
    }
    /*object_rez(key id)
    {
        ;
    }
*/}

 

Edited by Lilac Melodious
Fixed a few errors from fast typing.
Link to comment
Share on other sites

Get rid of 

key id = llGetOwner;

and rewrite your start function as

start(integer inputInteger)
{
    key id = llGetOwner();
    lstHandle = llListen(4, "", id, trgr);
    llSetMemoryLimit(inputInteger);
    llOwnerSay("Script has started.");
    llListen(4, "", id, "");
}

 

  • Like 1
Link to comment
Share on other sites

Just now, Rolig Loon said:

Get rid of 

key id = llGetOwner;

and rewrite your start function as

start(integer inputInteger)
{
    key id = llGetOwner();
    lstHandle = llListen(4, "", id, trgr);
    llSetMemoryLimit(inputInteger);
    llOwnerSay("Script has started.");
    llListen(4, "", id, "");
}

 

Thanks! That worked. This was done late at night and I only just got around to testing it. lol

  • Like 1
Link to comment
Share on other sites

Yeah, that computation can't happen in the 'preamble' (global variable declarations outside of a state) has gotten me a few times.

Also makes it hard to declare a list of hardcoded keys. FWIW:

list keys =
[
  (key)"000-000..."
];
default()
{
  //...
}

fails to compile for similar reasons.

Link to comment
Share on other sites

10 minutes ago, Quistess Alpha said:

Also makes it hard to declare a list of hardcoded keys.

Although fortunately you can create 

list keys = ["5748decc-f629-461c-9a36-a35a221fe21f", "89556747-24cb-43ed-920b-47caed15465f", "8dcd4a48-2d37-4909-9f78-f7a9eb4ef903"];

and then declare the string variables in the list to be keys as you use them:

key ThisOne = (key)llList2String(keys,1);

or, in some cases just write

llSetTexture( llList2String(keys,2), 1);

  • Like 1
Link to comment
Share on other sites

2 minutes ago, Rolig Loon said:

Although fortunately you can create 

list keys = ["5748decc-f629-461c-9a36-a35a221fe21f", "89556747-24cb-43ed-920b-47caed15465f", "8dcd4a48-2d37-4909-9f78-f7a9eb4ef903"];

and then declare the string variables in the list to be keys as you use them:

key ThisOne = (key)llList2String(keys,1);

or, in some cases just write

llSetTexture( llList2String(keys,2), 1);

the problem I had is when you want to search the list for a key, as llListFindList(list,[key]) won't find key if they're different data-types. This gets annoying when you want to add keys to the list, and such. It's not a /hard/ problem to solve, just a tricky thing to notice until it bites you in the butt.

  • Like 1
Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 1001 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...