Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Missing a bracket?

Vilkacis Mason
Registered User
Join date: 30 Aug 2005
Posts: 49
03-24-2006 03:09
I cannot figure out what I'm doing wrong. This is supposed to run through a small series of prim changes to 'open' the piece, and then another set to 'close' it. But it keeps telling me I have a syntax error at the last bracket in the bunch. I've counted all the brackets I can and as far as I can tell I haven't missed one, but it will not let me save.

...then the sandbox started deleting. >_<

Can someone help please?

CODE

// Left Plate Open Script
// Code: integer holeshape, vector cut, float hollow, vector twist, vector dimple

// Closed State
stateClose()
{
llSetPrimitiveParams([PRIM_SIZE, <0.436, 0.439, 0.459>, PRIM_ROTATION, <-0.70536, -0.04933, 0.70540, 0.04949>, PRIM_TYPE, PRIM_TYPE_SPHERE, 0, <0.40, 0.50, 0.0>, 0.95, <0.0, 0.0, 0.0>, <0.5, 0.76, 0.0>]);
}
// Expanded State
stateExpand()
{
llSetPrimitiveParams([PRIM_SIZE, <0.466, 0.469, 0.489>, PRIM_ROTATION, <-0.70536, -0.04933, 0.70540, 0.04949>, PRIM_TYPE, PRIM_TYPE_SPHERE, 0, <0.40, 0.495, 0.0>, 0.95, <0.0, 0.0, 0.0>, <0.5, 0.76, 0.0>]);
}
// Open State
stateOpen()
{
llSetPrimitiveParams([PRIM_SIZE, <0.466, 0.469, 0.489>, PRIM_ROTATION, <0.68901, 0.25341, -0.66016, 0.15890>, PRIM_TYPE, PRIM_TYPE_SPHERE, 0, <0.40, 0.495, 0.0>, 0.95, <0.0, 0.0, 0.0>, <0.5, 0.76, 0.0>]);
}


integer gOpen = 0;

default
{
state_entry()
{
// listen on channel zero for any chat spoken by the object owner.
llListen(0,"",llGetOwner(),"");
}

listen(integer channel, string name, key id, string message)
{
if (llToLower(message) == "open") // To Open...
{
if(!gOpen)
{
// Step 1: Expand, hiss, steam
stateExpand();
// Hiss Sound Effect goes here.
// Steam Activation goes here
// Wait 2 seconds...
llSleep(2);
// Step 2: Open, sound effect
stateOpen();
// 'Woosh' sound effect goes here
// Step 3: Idle
gOpen = 1;
}
else
{
llOwnerSay(0, "Already Open.");
}
}
else if(llToLower(message) == "close") // To Close...
{
if(gOpen)
{
// Step 1: Close, sound effect
stateExpand();
// 'Woosh' sound effect here
// Step 2: Shrink, hiss, steam
// Steam, hiss sound (for 1 second)
// Wait 1 second...
llSleep(1);
stateClose();
// 'Closing' sound effect
// Step 3: Idle
gOpen = 0;
}
else
{
llOwnerSay(0, "Already Closed");
{
}
}
}


Additionally, I can't figure out the rotate commands. When I set it on the ground, it works fine. When I wear it, the rotations get all messed up. Can someone explain this to me? I'll probably figure it out after pouring through the wiki some more, but live help is always nice..
Zi Ree
Mrrrew!
Join date: 25 Feb 2006
Posts: 723
03-24-2006 03:26
Look at the fourth line from the end. There you see the error :)
_____________________
Zi!

(SuSE Linux 10.2, Kernel 2.6.13-15, AMD64 3200+, 2GB RAM, NVidia GeForce 7800GS 512MB (AGP), KDE 3.5.5, Second Life 1.13.1 (6) alpha soon beta thingie)

Blog: http://ziree.wordpress.com/ - QAvimator: http://qavimator.org

Second Life Linux Users Group IRC Channel: irc.freenode.org #secondlifelug
Vilkacis Mason
Registered User
Join date: 30 Aug 2005
Posts: 49
03-24-2006 03:41
From: Zi Ree
Look at the fourth line from the end. There you see the error :)


AHHHHHHHHHHHHH! >_<

Thank you.