Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Question about Permissions

Lennard Lopez
Registered User
Join date: 9 Oct 2007
Posts: 52
11-22-2008 04:20
Hello. I get an error when I sit on a prim with this script. The error:
Object: Script trying to set camera parameters but PERMISSION_CONTROL_CAMERA permission not set!

What is wrong? How do I correct this?


CODE

default
{

changed(integer change)
{
if (llAvatarOnSitTarget() != NULL_KEY)
llRequestPermissions(llAvatarOnSitTarget(), PERMISSION_CONTROL_CAMERA | PERMISSION_TRIGGER_ANIMATION );
}

run_time_permissions(integer perm)
{
if (perm & PERMISSION_CONTROL_CAMERA | PERMISSION_TRIGGER_ANIMATION)
{
string anim = llGetInventoryName(INVENTORY_ANIMATION, 0);
if (anim != "")
{
llStopAnimation("sit");
llStartAnimation(anim);
llForceMouselook(TRUE);
}
llSetCameraParams([CAMERA_ACTIVE ,TRUE,CAMERA_POSITION ,<220,255,4050>]);
}
}
}

Atom Burma
Registered User
Join date: 30 May 2006
Posts: 685
11-22-2008 04:57
you don't need a camera lock and mouselook, I usually do one ot the other, it may be that. I am so not the goto guy for scripting, but your camera coirdinates look a bit odd as well, I always put mine like so...

llSetCameraEyeOffset(<-0.5, 0, 1> );
llSetCameraAtOffset(<30.0, 10, -12.0> );


Well feel free to change the variables, but maybe you are missing the string for offset, and maybe somebody else who can read lsl better than I can comment, lol
Lennard Lopez
Registered User
Join date: 9 Oct 2007
Posts: 52
11-22-2008 05:15
Pffffffft. How can I be so stupid. The above script works but there was a second script in the object without the request permissions.

The camera coördinates are region coördinates. Still have to check your remark about mouselook.

Anyway, thanks for your answer.
Atom Burma
Registered User
Join date: 30 May 2006
Posts: 685
11-22-2008 05:29
it's not that it will be a problem, it just will not be universal, you won't have everyone having the same view using that product, if you scroll your mouse wheel to zoom in and out it may get confusing to some with both camera lock as well as forced mouselook, unless they are similar. if they are in a very similar spot they may work well together, i just find ofthe they are not, and it gets really choppy going in and out of mouselook with the camera controls locked. also you have to assume that nubies don't even know any of this if you are making a commercial product, like a car, I assume. simpler is always better in my opinion.
Lennard Lopez
Registered User
Join date: 9 Oct 2007
Posts: 52
11-22-2008 06:13
The script is in a bench and I want the ava that sits on it to look at a certain object. That's why I need the region coördinates.