have found this nice script: (from http://www.jeff-barr.com/?cat=13 )
CODE
vector OpenPos = <149.283, 75.009, 77.3681>;
vector OpenRot = <0, 270.0, 270.0>;
vector ClosedPos = <151.681, 75.009, 75.009>;
vector ClosedRot = <0, 0, 270.0>;
default
{
state_entry()
{
state closed;
}
}
state closed
{
touch_start(integer N)
{
state open;
}
state_entry()
{
llSetPos(ClosedPos); llSetRot(llEuler2Rot(ClosedRot * DEG_TO_RAD));
}
}
state open
{
touch_start(integer N)
{
state closed;
}
state_entry()
{
llSetPos(OpenPos); llSetRot(llEuler2Rot(OpenRot * DEG_TO_RAD));
}
}
(sorry if it's formatted badly! you can see it in the link, it's nicer there.)
my question is, as this code needs to be set with the open & close values on ressing the door every time (it'll be used in a sandbox environment for now), can I replace
vector ClosedPos = <x, y, z>;
with
vector ClosedPos = <llGetPrimitiveParams(PRIM_POSITION)>
and the vector OpenPos with
vector OpenPos = <llGetPrimitiveParams(PRIM_POSITION)> - <a, b, c>
?
(where <a, b, c> is some transform vector. as the doors open and close positions will have the same position relative to each other every time. )
thanks for your time
also, my syntax is obviously terrible, what's the correct way to use llGetPrimitiveParams like this?