Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

set movement scripting

Sam Milner
Registered User
Join date: 17 Dec 2006
Posts: 2
09-26-2007 04:22
I am fairly new to the sl scripting world and am trying to create the following.

pretty much, what I want to do is make a veichile that starts at a specific location, and moves to another location. I only want it to go to those two locations, back and forth, no where else. Yet I can't seem to find the right type of code, I have looked at the llSetPos, but I can't control the speed of it, and it only moves 10 meters at a time, and is sort of jumpy.

Any suggestions would be more than welcomed.


Thanks
Tiarnalalon Sismondi
Registered User
Join date: 1 Jun 2006
Posts: 402
09-26-2007 05:45
Try llMoveToTarget

http://rpgstats.com/wiki/index.php?title=LlMoveToTarget
Kuato Kurka
Registered User
Join date: 6 Sep 2007
Posts: 1
physical elevator script
09-29-2007 19:04
integer trgroof;
integer trgbedroom;
integer trglivingroom;
integer trgdungeon;
vector dungeon = <80.0,245.0,50.4>;
vector livingroom = <80.0,245.0,54.8>;
vector bedroom = <80.0,245.0,60.0>;
vector roof = <80.0,245.0,65.0>;



default
{



state_entry()
{
llSetStatus(STATUS_PHYSICS, TRUE);
llListen(0, "", "", "rf";);
llListen(0, "", "", "lr";);
llListen(0, "", "", "br";);
llListen(0, "", "", "dn";);
llSetStatus(STATUS_ROTATE_X|STATUS_ROTATE_Y|STATUS_ROTATE_Z,FALSE);
}


listen(integer channel, string name, key id, string msg)
{
if(msg == "rf";)
{
trgroof = llTarget( roof, .1 );

llMoveToTarget( roof, .051 );
msg = "";
}


if (msg == "lr";)
{
trgbedroom = llTarget( livingroom, .1 );

llMoveToTarget(livingroom, .051 );
msg = "";
}


if(msg == "br";)
{
trgbedroom = llTarget( bedroom, .1 );

llMoveToTarget(bedroom, .051 );
msg = "";
}


if (msg == "dn";)
{
trgdungeon = llTarget( dungeon, .1 );

llMoveToTarget(dungeon, .051 );
msg = "";
}
}


at_target (integer tnumb, vector trgpos, vector ourpos)
{
if (tnumb == trgroof)
{
llStopMoveToTarget();
llTargetRemove (trgroof);
}

if (tnumb == trgbedroom)
{
llStopMoveToTarget();
llTargetRemove (trgbedroom);
}

if (tnumb == trglivingroom)
{
llStopMoveToTarget();
llTargetRemove (trglivingroom);
}

if (tnumb == trgdungeon)
{
llStopMoveToTarget();
llTargetRemove (trgdungeon);
}
}




}
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
09-29-2007 19:54
/54/ca/210616/1.html

That one only goes up and down, not sideways and you could strip the rez function. It will mainly give you one more example to look at to help making your own.
_____________________
I (who is a she not a he) reserve the right to exercise selective comprehension of the OP's question at anytime.
From: someone
I am still around, just no longer here. See you across the aisle. Hope LL burns in hell for archiving this forum
Lee Ponzu
What Would Steve Do?
Join date: 28 Jun 2006
Posts: 1,770
09-30-2007 08:15
Look around for warp pos...it is a programming trick to get around the 10m at a time and jerkiness problem. (Not me...the jumpiness you mention.)