Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

(Vehicle)Door Open?

duLuna Bosatsu
OMnomnom nom.
Join date: 4 Nov 2007
Posts: 102
02-27-2008 06:33
http://img.photobucket.com/albums/v38/neko-vamp/rotationweird.gif

/waves
back again XD; you guys're love and though you may not want it, when I finish and get this sucker correct, I'll give ye helpers one for freeee because it's cute :3 and we all like cute things >3>

error: as you can see in the picture, I spent a good while fixing the closed and open features on the locket. It looked good, so I went ahead and attached it to my avatar... when I did, the "close" function went all wonky. What could be the problem for this?

-----
//paste the postion(vec) and rotation(rot) from 'touch local rot pos' script
// below for closed and open postions
vector close_vec = <-0.0045, 0.0001, .0007>;
rotation close_rot = <0, 5, 0.09, 5>;

vector open_vec = <-0.023, 0.00001, 0.022>;
rotation open_rot = <-0.00023, 20, 0.00019, 0.1>;

//vehicle door by rickard roentge
integer open;

rotation Inverse(rotation r)
{
r.x = -r.x;
r.y = -r.y;
r.z = -r.z;
return r;
}

default
{
state_entry()
{
open = FALSE;
}

link_message(integer sender, integer num, string str, key id)
{
if(str=="CloseLid";)
{
if (open) {
open = FALSE;
llSetPrimitiveParams([PRIM_POSITION, close_vec, PRIM_ROTATION,
close_rot * Inverse(Inverse(llGetLocalRot())*llGetRot())]);
}
} else if(str=="OpenLid";) {
if(!open) {
open = TRUE;
llSetPrimitiveParams([PRIM_POSITION, open_vec, PRIM_ROTATION,
open_rot * Inverse(Inverse(llGetLocalRot())*llGetRot())]);
}
}
}
}

-----

I'm guessing somewhere in "if(str=="CloseLid";)" lies the problem, but I honestly couldn't say ^_^;
duLuna Bosatsu
OMnomnom nom.
Join date: 4 Nov 2007
Posts: 102
02-28-2008 21:00
well, somethings weird happening now. Depending on which way I'm standing (S, W, N, E) the open/close door stays put.. so right now I'm facing just a little over W to NW and the locket closes perfectly! ... so why is this thing a magnet to the West? There must be a code I'm missing to make it follow the rest of the locket and not a direction
Saint Chemistry
Registered User
Join date: 8 Aug 2007
Posts: 2
02-29-2008 00:44
I find it best when working with linked objects and modifying prim params on them to use.

llSetLinkPrimitiveParams( integer linknumber, list rules );

Where linknumber is LINK_THIS even if its in the same prim. dunno if this would fix it but its worth a try.
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
02-29-2008 01:07
makng the door halfcut like a house door usually solves the problem, make sure to use localRot functions for the movement (as there's a jira regarding the set prim params family of functions that causes annoying bugs, there is a workaround though).
_____________________
|
| . "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...
| -