Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

script isn't working anymore :(

Asjbak Vandeverre
Registered User
Join date: 25 Dec 2006
Posts: 14
11-08-2007 07:15
Hi all, some weeks ago i did edit a script that can rezz an object. When i want to change something in it now i get an error. When I rezz an older made prim with this script it's functioning fine but even when i place some // in front of other slashes and try to save it doesn't work anymore.

I get this message: (0, 7) Syntax error

this is the code:

string OBJECT_NAME = "test123123"; // Name of object to rez
vector OBJECT_OFFSET_POS = <-3,3,0>; // Position to rez object at
rotation OBJECT_OFFSET_ROT = ZERO_ROTATION; // Rotation to rez object at
vector OBJECT_VELOCITY = ZERO_VECTOR; // Velocity to rez object at

string verwijder = "die"; // Name of the die script
integer PIN_MAX = 2147483647; // INT_MAX
integer PIN_MIN = 1; // avoid 0 because it is used as the
// start param when rezzed from inv

integer OWNER_ONLY = FALSE; // If only owner can use

key object_key = NULL_KEY; // Key of rezzed object
integer object_rezzed = FALSE; // Whether object is rezzed
integer object_pin; // PIN for rezzed object

integer random_pin() {
return llCeil( llFrand(PIN_MAX - PIN_MIN) ) + PIN_MIN;
}

default {
touch_start(integer num) {
if ( OWNER_ONLY && (llDetectedKey(0) != llGetOwner()) )
return;

if ( object_rezzed ) { // Object is already rezzed
llRemoteLoadScriptPin( object_key, verwijder, object_pin, TRUE, TRUE );
object_key = NULL_KEY;
object_rezzed = FALSE;
} else {
object_pin = random_pin();
llRezObject(
OBJECT_NAME, llGetPos() + OBJECT_OFFSET_POS, OBJECT_VELOCITY,
llGetRot() * OBJECT_OFFSET_ROT, object_pin
);
object_rezzed = TRUE;
}
}

object_rez(key id) {
object_key = id;
}
}
Debbie Trilling
Our Lady of Peenemünde
Join date: 17 Oct 2006
Posts: 434
11-08-2007 07:51
"OBJECT_NAME" & "OBJECT_VELOCITY " are reserved words, and appear in Blue font in the LSL script compiler.

As a quick test, I removed the "O" from the beginning of each instance of their use within the script (that is, made them ""BJECT_NAME" & "BJECT_VELOCITY ";) and recompiled successfully. Upon touch the object is successfully rezzed.
:)
Nika Talaj
now you see her ...
Join date: 2 Jan 2007
Posts: 5,449
11-08-2007 07:57
If you are open to working offline, the LSL editor (http://www.lsleditor.org/) provides a swifter way to grind thru syntax errors than the inworld editor. It has hover tips for all LSL commands as well.

It is an IDE (integrated development environment) as well as script editor, so you can actually do preliminary debugging as well. Developed by the spectacular Alphons van der Heiden *applauds*
Debbie Trilling
Our Lady of Peenemünde
Join date: 17 Oct 2006
Posts: 434
11-08-2007 08:11
As an afterthought and for completeness sake (and 'cos I haven't yet finished my cup of tea), "OBJECT_NAME" & "OBJECT_VELOCITY " became reserved words with the introduction of function "llGetObjectDetails" in v1.18.3.(2). This explains why your script was working "some weeks ago" but not now :)

http://wiki.secondlife.com/wiki/LlGetObjectDetails
Asjbak Vandeverre
Registered User
Join date: 25 Dec 2006
Posts: 14
11-08-2007 08:19
Thanx for that info :)
You all rock!

greetz asj