Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Simple Toggling 1st person camera script

Exile Loudon
Aspiring Scripter
Join date: 10 Dec 2005
Posts: 122
03-27-2006 13:27
I wrote a simple script using the camera system that when you say "/2 front cam" it goes into an interactive first person view, and when you say "/2 normal cam" it goes back to normal. This is very simple, so I wont leave any license or something like that. Here it is :D

CODE

camera()
{
llSetCameraParams([
CAMERA_ACTIVE, TRUE,
CAMERA_POSITION, llGetPos(),
CAMERA_DISTANCE, 0.0,
CAMERA_POSITION_LAG, 0.0,
CAMERA_POSITION_THRESHOLD, 0.0,
CAMERA_BEHINDNESS_ANGLE, 0.0,
CAMERA_BEHINDNESS_LAG, 0.0,
CAMERA_FOCUS_LAG, 0.0,
CAMERA_FOCUS_THRESHOLD, 0.0,
CAMERA_FOCUS_OFFSET, <1,0,1>
]);
}

default
{
state_entry()
{
llClearCameraParams();
llListen(2,"",llGetOwner(),"");

}
listen( integer channel, string name, key id, string message )
{
if (message == "front cam")
{
llRequestPermissions(llGetOwner(), PERMISSION_CONTROL_CAMERA);
llOwnerSay("1st person camera activated");
}


if (message == "normal cam")
{
llOwnerSay("Camera back to normal.");
llClearCameraParams();
llResetScript();
}
}
run_time_permissions(integer perm)
{
if ((perm & PERMISSION_CONTROL_CAMERA) == PERMISSION_CONTROL_CAMERA)
{
camera();
}
}
}
Nada Epoch
The Librarian
Join date: 4 Nov 2002
Posts: 1,423
Discussion Thread
03-27-2006 21:28
/54/1f/96533/1.html
_____________________
i've got nothing. ;)