Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Moving a Prim into Position near an AV

Darkness Anubis
Registered User
Join date: 14 Jun 2004
Posts: 1,628
04-14-2006 11:26
I know this is possible since most of the big multiplayer games do it with game boards, but I am clueeless where to even start.

What I need to do is when someone touches my object a prim is rezzed and moved into position near the person who touched the object, even if that person is more than 10m away.

Can someone point me in the direction of how to do this?
_____________________
Darkness Anubis
Registered User
Join date: 14 Jun 2004
Posts: 1,628
04-14-2006 13:59
I did some more poking around. I am pretty sure I know how to move the prim into position.

Where I am getting hung up is finding the position and rotation of the AV that did the touching. Any help on this would be much appreciated.
_____________________
Ziggy Puff
Registered User
Join date: 15 Jul 2005
Posts: 1,143
04-14-2006 14:05
http://secondlife.com/badgeo/wakka.php?wakka=llDetectedPos
http://secondlife.com/badgeo/wakka.php?wakka=llDetectedRot
Leonard Churchill
Just a Horse
Join date: 19 Oct 2005
Posts: 59
04-14-2006 14:05
Would llDetectedPos and llDetectedRot captured from the touch help?
_____________________
"Give me a fish and I eat for a day. Teach me to fish and I eat for a lifetime." - Chinese Proverb

Always check the Wiki and/or Script Library
Darkness Anubis
Registered User
Join date: 14 Jun 2004
Posts: 1,628
04-14-2006 14:06
From: Leonard Churchill
Would llDetectedPos and llDetectedRot captured from the touch help?


This is exactly where I am getting messed up. How do I make these work? Specifically the object touched rezzed another object and its the other object that will move. I can't figure how to pass the pos data to the object rezzed and I haven't managed to get llDetectedRot to work at all.
_____________________
Ziggy Puff
Registered User
Join date: 15 Jul 2005
Posts: 1,143
04-14-2006 14:18
The rezzed object opens up a listener on a known channel. The rezzing object waits a bit after the object has been rezzed (which you find out in the object_rez event) and then llSay's the information over to the rezzed object, which then picks it up and does stuff with it.

It might be easier if all you told the rezzed object was the key of the person to follow. The object can then run a sensor scan for that av, and the llDetected... functions will be availabe in the sensor event.
Darkness Anubis
Registered User
Join date: 14 Jun 2004
Posts: 1,628
04-14-2006 14:24
From: Ziggy Puff
The rezzed object opens up a listener on a known channel. The rezzing object waits a bit after the object has been rezzed (which you find out in the object_rez event) and then llSay's the information over to the rezzed object, which then picks it up and does stuff with it.

It might be easier if all you told the rezzed object was the key of the person to follow. The object can then run a sensor scan for that av, and the llDetected... functions will be availabe in the sensor event.


I think you just found my problem. I didn't put in the wait before the say. so I am betting my object never heard the key I sent. GOnna give that a try TYVVM.
_____________________
Ziggy Puff
Registered User
Join date: 15 Jul 2005
Posts: 1,143
04-14-2006 14:41
From: someone
so I am betting my object never heard the key I sent.


The best way to debug stuff like that is to sprinkle temporary llOwnerSays everywhere. So put one in the sender where it says it, put on in the receiver's listen event and have it spit out the message received, stuff like that. Once everything is working, you can comment those lines out, that makes it easier to re-enable them if you change something and need to go back to fundamental debugging like this.

But yeah, I've found that not waiting can be unreliable, and if you think about it, object_rez tells you the object's been rezzed, you really don't have a guarantee that it has had a chance to run its scripts and set up its listeners. The last time I messed with this, I used a 0.5s sleep in the rezzer, in the object_rez (so the sleep started after the object_rez event was received, not after the llRezObject call returned).