Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Need a tweak please.

Roland Quackenbush
Registered User
Join date: 2 Jul 2006
Posts: 5
07-08-2006 19:22
I'm using this script to orbit a ball around a room.
I dont know how to write script but I can do a little tweaking.
How do I make this ball orbit slower?

I also still haven't quite figured out where it's going to orbit. I think it's going to orbit around where ever I'm standing when I place it.


float d=5; //radius
vector pos;
float x=0;
vector thrust;
integer n;
default
{
state_entry()
{
llSetBuoyancy(1.0);
llSetTimerEvent(0.1);
pos=llGetPos();
llSetStatus(STATUS_PHANTOM , TRUE);
llSetStatus(STATUS_PHYSICS , TRUE);

}

timer()
{
x+=0.1;
thrust=<llCos(x)*d,llSin(x)*d,0>;
llMoveToTarget(pos+thrust,0.2);
}


}

Thanks a million for your help.
I appreciate it.
Logan Bauer
Inept Adept
Join date: 13 Jun 2004
Posts: 2,237
07-08-2006 19:42
Adjust the line :

x+=0.1;

To make it move slower, add in a smaller float, for example:

x+=0.05;

should make it move 1/2 as fast.
Roland Quackenbush
Registered User
Join date: 2 Jul 2006
Posts: 5
07-08-2006 19:53
yes, it's slower now. Thanks!
Logan Bauer
Inept Adept
Join date: 13 Jun 2004
Posts: 2,237
07-08-2006 19:56
From: Roland Quackenbush

I also still haven't quite figured out where it's going to orbit. I think it's going to orbit around where ever I'm standing when I place it.



It looks like it moves relative to "pos", which is set by calling getpos in state entry - move it to the exact center of the area you want it to circle and then reset the script.
Roland Quackenbush
Registered User
Join date: 2 Jul 2006
Posts: 5
07-08-2006 20:30
From: Logan Bauer
It looks like it moves relative to "pos", which is set by calling getpos in state entry - move it to the exact center of the area you want it to circle and then reset the script.



ok that makes sense. thanks

If I tweak enough scripts I should start to learn something. :)