Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Rez script - position/orientation issues

Slater Trezuguet
Registered User
Join date: 20 Aug 2009
Posts: 3
08-29-2009 05:32
I've been using a freebie rez script that i found and up to now i've had no problems modding it to my requirements, but i'm now having trouble editing the Vector and Rotation lines in it - Basically i have no idea what i need to put in the script to alter these atributes. The script i am using is as follows:

default
{
state_entry()
{
llSetStatus(STATUS_PHANTOM, TRUE);
llListen(737, "", NULL_KEY, "" );
}

on_rez(integer num)
{
llResetScript();
}

listen(integer number, string name, key id, string message)
{

if(message=="Pyro Rig";){
llRezObject("MkII Pyro Rig 1", llGetPos() + <0,4,0>, ZERO_VECTOR, ZERO_ROTATION, 0);
}
}}



I'm assuming that the ZERO_VECTOR & ZERO_ROTATION lines are were i need to make the changes but i don't know what to put in there instead. I would just like to know what the string needs to be for both those attributes so i can get the rezzed object's position exact.
Anyone help?
Dora Gustafson
Registered User
Join date: 13 Mar 2007
Posts: 779
08-29-2009 05:49
From: Slater Trezuguet
llRezObject("MkII Pyro Rig 1", llGetPos() + <0,4,0>, ZERO_VECTOR, ZERO_ROTATION, 0);
Try this:
CODE
llRezObject("MkII Pyro Rig 1", llGetPos() + <0,4,0>*ROTATION, ZERO_VECTOR, ROTATION, 0);
where "ROTATION" is the rotation you want.
"ROTATION" must be a quaternion:)
And consider using llRezAtRoot over llRezObject, llRezAtRoot is not so tricky.
_____________________
From Studio Dora
Slater Trezuguet
Registered User
Join date: 20 Aug 2009
Posts: 3
08-29-2009 06:00
From: Dora Gustafson
Try this:
CODE
llRezObject("MkII Pyro Rig 1", llGetPos() + <0,4,0>*ROTATION, ZERO_VECTOR, ROTATION, 0);
where "ROTATION" is the rotation you want.
"ROTATION" must be a quaternion:)
And consider using llRezAtRoot over llRezObject, llRezAtRoot is not so tricky.


First off, thanks for the reply.
What i'm trying to do in this particular instance is to have the rezzed object rotated 180 degrees around Z axis, me being a total noob at scripting, could you re-post that string as it should be for me to achieve this please?
Dora Gustafson
Registered User
Join date: 13 Mar 2007
Posts: 779
08-29-2009 07:57
CODE
llRezObject("MkII Pyro Rig 1", llGetPos() + <0,4,0>*< 0.0, 0.0, 1.0, 0.0 >, ZERO_VECTOR, < 0.0, 0.0, 1.0, 0.0 >, 0);

Y didn't say 180 degrees with respect to what. This is the a global rotation.
_____________________
From Studio Dora
Slater Trezuguet
Registered User
Join date: 20 Aug 2009
Posts: 3
08-29-2009 08:13
Great, that worked.
Thanks for the help
:)