Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

llSetLinkPrimitiveParams() broken?

Dylan Rickenbacker
Animator
Join date: 11 Oct 2006
Posts: 365
08-08-2008 04:31
Okay, I've been fiddling a bit more with my ladder script and it seems to me that llSetLinkPrimitiveParams() has recently been broken. I'd just like to get some feedback before I post a jira entry.

To strip down the problem to the basics, I made 2 cubes, linked them and put this quick and dirty script in the child prim:

CODE

vector curPos;
vector target;
string direction;

default
{
state_entry()
{
curPos = llGetLocalPos();
llListen(1,"",NULL_KEY,"");
}

listen(integer channel, string name, key id, string msg)
{
direction = msg;

if(msg == "up")
{
target = curPos + <0.0,0.0,10.0>;
}

if(msg == "down")
{
target = curPos - <0.0,0.0,10.0>;
}
}

touch_start(integer total_number)
{
if(direction == "")
{
llSay(0,"Please specify a direction first.");
llResetScript();
}
while(curPos != target)
{
if(direction == "up")
{
curPos = curPos + <0.0,0.0,1.0>;
llSetLinkPrimitiveParams(LINK_THIS, [PRIM_POSITION,curPos]);
}

if(direction == "down")
{
curPos = curPos - <0.0,0.0,1.0>;
llSetLinkPrimitiveParams(LINK_THIS, [PRIM_POSITION,curPos]);
}
}
}
}



Right. I say "/1 up" and touch the child prim. Expectedly, the child prim should now move upwards in 1 meter steps until it is 10 meters above its original position.

Instead, it stops after 3 meters.

As I said, my ladder script used to work fine until a short while ago. Is that a new bug or am I overlooking something?

Thanks.
Jodina Patton
Registered User
Join date: 19 Nov 2005
Posts: 170
08-08-2008 07:17
Hello,

I just tried this at my place and it works fine. Goes up all 10M.
Dylan Rickenbacker
Animator
Join date: 11 Oct 2006
Posts: 365
08-08-2008 07:48
Fascinating. I heard the same from another friend who tried it. I tried it in different sims, same behaviour everywhere. Must be me then.
Laurence Corleone
Registered User
Join date: 12 Oct 2006
Posts: 126
08-08-2008 08:01
I am getting the same, up 3m and then no more.

After it moves, edit the linked part and manually move it up past the 3m point and when done editing it will snap back to the 3m point.
_____________________
There are no stupid questions, just stupid people.
Jodina Patton
Registered User
Join date: 19 Nov 2005
Posts: 170
08-08-2008 08:35
I was not doing this right I think. After re-reading your post you are expecting one prime to stay put and the other to go up 10M? They way I did it both primes go up 10M...

I just tried it as you specify and, yes, the bottom prime stays and the top one only goes 3M as you say it is.
Dekka Raymaker
thinking very hard
Join date: 4 Feb 2007
Posts: 3,898
08-08-2008 08:57
<deleted>

However, unless my memory serves me wrong, using two 0.5 cube prims to test this, I can't link them at more than 4 meters apart, is that right, if not, maybe this is part of the problem?

Edit: see below, I took the wrong positions in this my first test. but the linking of the prims still bothers me.
_____________________
Dekka Raymaker
thinking very hard
Join date: 4 Feb 2007
Posts: 3,898
08-08-2008 09:07
Second attempt recording everything.

1. 1 prim rezzed at z=500.2 (child)
2. second prim rezzed and positioned at z=503.2 (root)
3. linked prims, bottom prim child
4. script put into bottom prim
5. say /1 up
6. touch bottom prim
7. prim moves to z=506.2
8. root prim remains at z=503.2
9. say /1 down
10. touch top prim (child)
11. prim moves back to z=500.2

so in my test it does move 6 meters in total, it did in my first test, I just didn't record the facts correctly
_____________________
Dekka Raymaker
thinking very hard
Join date: 4 Feb 2007
Posts: 3,898
08-08-2008 09:18
Third attempt recording everything. I have linked the two .5 cube prims as far apart as SL will allow me to. Child is z=500.2 and Root z=503.932

1. 1 prim rezzed at z=500.2 (child)
2. second prim rezzed and positioned at z=503.932 (root)
3. linked prims, bottom prim child
4. script put into bottom prim
5. say /1 up
6. touch bottom prim
7. prim moves to z=506.932
8. root prim remains at z=503.932
9. say /1 down
10. touch top prim (child)
11. prim moves back to z=500.932 (although it started at 500.2)

Hope that helps
_____________________
Viktoria Dovgal
Join date: 29 Jul 2007
Posts: 3,593
08-08-2008 09:50
Your script is working correctly for prims, you'll find that you get a larger distance if you increase the sizes of the prims.

The limits are explained in http://wiki.secondlife.com/wiki/Linkability_Rules - and you can't use llSetLinkPrimitiveParams to move a prim outside the allowable linking distance. These distances definitely did change with Havok 4, but not more recently.

-----

But, that doesn't mean your ladder isn't having problems, because it's a ladder! Are you trying to move an avatar around with llSetLinkPrimitiveParams, instead of a prim? If so, yes, LL certainly did break that one with the 1.23 server, it caused trouble for some teleporters too :(

http://jira.secondlife.com/browse/SVC-2543 for that bug.

(eta to explain a little more: LL developers have tried to leave the limits more open for avatars, because that's the only way to reposition a sitting one. They added some anti-griefing stuff this time around but the new limits aren't calculated in a way that's always useful for scipting. I would be kind of surprised if it was tight enough to interfere with a typical ladder, but it's possible, if you can repro it with an avatar doing the moving instead of a prim.)
_____________________
Dekka Raymaker
thinking very hard
Join date: 4 Feb 2007
Posts: 3,898
08-08-2008 10:36
Viktoria, this is Dylans previous post.

/54/78/275265/1.html
_____________________
Viktoria Dovgal
Join date: 29 Jul 2007
Posts: 3,593
08-08-2008 10:50
From: Dekka Raymaker
Viktoria, this is Dylans previous post.

/54/78/275265/1.html

OK, that looks like it is SVC-2543 then. For now, about the only way I can get predictable avatar movement is to use a single unlinked prim, and keep it at zero rotation. once you try to move an avatar on a multi-prim link set, or move the rotation away from 0, all kinds of buggy behavior appears. (I'll bet that someone could find math to fit the new behavior, but quite simply it's borked.)
_____________________