Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

object rotation, (landing gear)

Mrc Homewood
Mentor of Randomness
Join date: 24 Feb 2007
Posts: 779
11-02-2007 18:00
im working on a plane, and im trying to make a landing gear what will rotate inwar insted of up and down, i was told by a friend a wile back that there needs to be a script to link a set of objects like a door, to a car, and when you touch it, it will close, ect ect

how would i go about doing that if posible?
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
11-02-2007 18:57
yay another chance to spam my super simple door script =)
CODE

//--// v7-D Feebie Type 1 Door Script //--//
//--// Works At ANY Angle //--//

//-- works in ANY single prim door, linked or un-linked
//-- works in muti prim doors NOT linked to a larger structure
//-- REQUIREMENTS: a cut root prim, suggest cube, pathcut start=.125, end=.625
//-- CAVEAT: single prim doors are limited to 5m width

//--// USERS MODIFY HERE v
integer vgIntDoorSwing = 90;
//-- use -# to reverse the direction of swing, eg. -90;


rotation vgRotDoorSwing;

default{
state_entry(){
vgRotDoorSwing = llEuler2Rot( <.0, .0, (float)vgIntDoorSwing * DEG_TO_RAD> );
}

touch_start( integer vIntTouches ){
//- small hack to reverse direction of swing on each
//- touch & avoid lsl funkiness regarding rotation division
vgRotDoorSwing.s *= -1;

llSetLocalRot( vgRotDoorSwing * llGetLocalRot() );
}
}

//-- IF Redistributing as-is:
//-- Please leave script full permissions & include all comments


each landing gear peice is going to need to be a single prim for this application (just think textures) since they'll be linked... move the touch event contents to a link message handler....

the other option is multi-move, which will handle multiple prims, but can be very complex

I have another door script that may make it here in a day or two when I clean it up, which will move individual parts... but as with anything that moves individual linked parts, lag can cause certain pieces to move at different times...
_____________________
|
| . "Cat-Like Typing Detected"
| . This post may contain errors in logic, spelling, and
| . grammar known to the SL populace to cause confusion
|
| - Please Use PHP tags when posting scripts/code, Thanks.
| - Can't See PHP or URL Tags Correctly? Check Out This Link...
| -