Change font size
It is currently Tue Dec 18, 2018 12:16 pm

Forum rules


{L_IMAGE}



Post a new topicPost a reply Page 1 of 1   [ 1 post ]
Author Message
 Post subject: lltakecontrol - driveable box
PostPosted: Sat Oct 11, 2008 9:17 am 
Furious Typer

Joined: Sat Jul 19, 2008 10:43 am
Posts: 118
here is a simple script to make something driveable very jerky, lol (use as a remote or sit on it & drive yourself).
only thing i noticed is llreleasecontrols does not fully work yet, so will have to use release control on the viewer.

Xing


float speed=0.2;
rotation rot;
float locx;
float locy;
vector pos;
default
{ touch_start(integer total_number)
{llRequestPermissions(llDetectedKey(0), PERMISSION_TAKE_CONTROLS);}
run_time_permissions(integer perm)
{if(PERMISSION_TAKE_CONTROLS & perm)
{llTakeControls(
CONTROL_FWD |
CONTROL_BACK |
CONTROL_LEFT |
CONTROL_RIGHT |
CONTROL_ROT_LEFT |
CONTROL_ROT_RIGHT |
CONTROL_UP |
0, TRUE, FALSE);
}} control(key id, integer button, integer edge){

if (button==CONTROL_UP) {llSay(0,"Controls Released!");llReleaseControls( );}

if (button&CONTROL_ROT_LEFT) {rot = llGetRot();
rotation delta = llEuler2Rot(<0,0,(1 * PI)/45>);
rot = delta * rot;
llSetRot(rot);}

if (button&CONTROL_ROT_RIGHT) {rot = llGetRot();
rotation delta = llEuler2Rot(<0,0,(-1 * PI)/45>);
rot = delta * rot;
llSetRot(rot);}

if (button&CONTROL_FWD){vector rotvec = llRot2Euler (llGetRot());
pos = llGetPos();
locx = (llCos(rotvec.z))*speed;
locy = (llSin(rotvec.z))*speed;
pos = pos + (<locx,locy,0>);
llSetPos(pos);}
}}


Top
 Profile  
 
Display posts from previous:  Sort by  
Post a new topicPost a reply Page 1 of 1   [ 1 post ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron


Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
610nm Style by Daniel St. Jules of Gamexe.net