Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

llSetPos vehicles of many parts... help

Seph DaSilva
Registered User
Join date: 26 Apr 2005
Posts: 27
04-26-2006 20:12
After successfully completing an elevator that utilizes llMessageLinked, as well as Listening for shouting call buttons to summon it, I thought I would undertake something more ambitions:

I had the bright idea that I'd make a vehicle that would use the same concept as elevator buttons for movement (not sure if llMoveToTarget would work or if I'd have to settle for llSetPos in increments) . Not something new to SL I'm quite sure. I wanted to escape the 32 prim vehicle limit. I'm sure this will work fine but then there was a further factor:

I want to escape the linking distance limit.

To do this I set up an experiment. I have 2 planes, each with a sphere set centered on an edge. Ball 1 on the edge of Plane 1 with this script:

default
{
state_entry()
{
while (1==1)
{
vector Ball1Pos=llGetPos();
string PassPos=(string)Ball1Pos;
llMessageLinked(LINK_SET , 0, PassPos, NULL_KEY);
}
}
}

***// Plane 1 receives this message (and verifies it visually) in the following script:

default
{
link_message(integer sender_num, integer num, string str, key id)
{
llSetText(str, <1,1,1>, 1.5);
llSay(12345,str);
}
}

***//Lastly, Ball 2 listens and lines up the Ball 2/Plane 2 object via:

default
{
state_entry()
{
llListen(12345,"","","";);
}

listen(integer a, string n, key id, string str)
{
vector Corner1Pos=(vector)str;
llSetPos(Corner1Pos);
}
}

My Dilemma: The llSetText in Plane 1 takes *10 SECONDS* to update. Ball 2/Plane 2 seem to take 30 secs to A WHOLE MINUTE to finally get the message and move over to match up. In one sense, I have a success. It did what I wanted. But it is waaaaay too slow to be of use. Can you imagine if I made a ship wherein the back half was a minute behind?

There has to be a speedier way to pass a vector. Or perhaps a suggestion on a different approach to this madness?
Jigsaw Partridge
A man of parts
Join date: 3 Apr 2005
Posts: 69
04-26-2006 21:22
I would suggest that you throttle the rate at which you are sending link messages in the first script - put the llMessageLinked() call into a timer event handler, and set up a timer at a rate of (for example) about 0.2s. Also, take out the call to llSetText() - if you need diagnostics, use llOwnerSay(). You should be able to get a rate of several object-object messages per second.

However, from my experience, you will not get a very satisfactory effect when trying to move an 'assembly' of objects in this way - even link messages between prims within the same object are too slow to give the illusion of 'group' motion, inter-object messages are an order of magnitude slower.
Jesrad Seraph
Nonsense
Join date: 11 Dec 2004
Posts: 1,463
04-26-2006 23:49
My Multimove set of scripts does exactly that: moving multiple objects in sync. Read these scripts and see if it helps with your own scripts :)

The time it takes to send a message, have it received, the object moved and then ready for another, is in my experience about 0.36 second. That means you should delay every new message by about 0.4 second in you while(1==1) loop.
_____________________
Either Man can enjoy universal freedom, or Man cannot. If it is possible then everyone can act freely if they don't stop anyone else from doing same. If it is not possible, then conflict will arise anyway so punch those that try to stop you. In conclusion the only strategy that wins in all cases is that of doing what you want against all adversity, as long as you respect that right in others.