Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

llGetRot... did it die?

Yamil Dagger
Registered User
Join date: 10 Jul 2007
Posts: 36
05-21-2008 12:57
Ok guys I reeeeeeally need help this time. I'm making a minigame and the main idea is that it rezzes smaller prims in the general area and the "player" must click as many as they can before they dissapear. The prims being rezzed are small prim-versions of avatars so they need to be rezzed upright ontop the machine at certain locations.

Problem:
Right now the machine works fine but if you rotate the machine, all the little guys get rezzed in odd rotations for some reason. I've tried llGetRot as well as llGetLocalRot and both seem to have this problem once I rotate the machine. I've offered to pay some scripter friends and thus far, nobody can understand why it's not working right.


Can somebody PLEASE help me out?



right now i'm using this line and it works till i rotate the machine, then it's completely off.
llGetLocalRot()+<0,0,90,1>


also, llGetPos() doesn't seem to be working for me either, if I rotate the machine all the people being rezzed don't rezz in the correct locations either.
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
05-21-2008 14:30
Calculating a rez position with a global offset and rotation is going to look something like:
CODE

vector pos = llGetPos()+OFFSET;
rotation rot = ROTATION;


Using a relative offset and rotation (that is, one that rotates with the rezzing prim) is going to look more like.
CODE

rotation rezzerRot = llGetRot();
vector pos = llGetPos()+OFFSET*rezzerRot;
rotation rot = ROTATION*rezzerRot;


I hope that helps.
Pale Spectre
Registered User
Join date: 2 Sep 2005
Posts: 586
05-21-2008 14:49
And here's an example from some working code:

CODE

llRezObject("object",
llGetPos() + (<0.0, 0.0, 0.1> * llGetRot()),
ZERO_VECTOR,
llEuler2Rot(<0.0, 0.0, 90 * DEG_TO_RAD>) * llGetRot(),
0);