Scalar Tardis
SL Scientist/Engineer
Join date: 5 Nov 2005
Posts: 249
|
01-22-2006 14:09
So anyway I'm trying to make a geometry builder that makes curves, spirals, large circles, etc. I want the script to command the child to set its own primitive params, so that I can dymanically reshape the children one at a time, and make organic twisting forms. But message passing through open sim channels seems way too complicated, and has the potential for conflict with anyone else's open-sim-channel scripting projects. I'm looking for KISS here.  The simplest message-pass to set the child prim parameters seems to be: Parent/builder object: 1. Rez linked 2. Send string message to linked object 3. Unlink without waiting 4. Do next step Child object: 1. Wait for message 2. Reshape using message 3. Remove script Has anyone tried this before?
|
Scalar Tardis
SL Scientist/Engineer
Join date: 5 Nov 2005
Posts: 249
|
01-22-2006 17:51
Well, back to the drawing board.
I've seen people talking about rezzing an object and auto-linking it to the parent but I can't find anything in the Wiki describing that. "Rez linked" may be a meaningless term.
The child object could contain a script to link itself to the builder object on-rez, but it needs to know the builder object key. And.... if the key changes everytime I save the script while exploring/debugging, I'd have to constantly keep updating that new key in the child object for it to still find and link to the parent. Doh.
|
Zepp Zaftig
Unregistered Abuser
Join date: 20 Mar 2005
Posts: 470
|
01-22-2006 18:17
Is something like this what you are looking for? default { state_entry() { llRequestPermissions(llGetOwner(), PERMISSION_CHANGE_LINKS); }
run_time_permissions(integer perm) { if(perm & PERMISSION_CHANGE_LINKS) { llRezObject("Object", llGetPos(), ZERO_VECTOR, ZERO_ROTATION, 0); } } object_rez(key child) { integer perm = llGetPermissions(); if(perm & PERMISSION_CHANGE_LINKS) { llCreateLink(child, TRUE); } } }
|
Ben Bacon
Registered User
Join date: 14 Jul 2005
Posts: 809
|
01-23-2006 02:28
As Zepp has shown, the concept you need is rez-then-link, rather than rez-already-linked. As far as your this From: Scalar Tradis Parent/builder object: 1. Rez linked 2. Send string message to linked object 3. Unlink without waiting 4. Do next step is concerned, step 3 is problematic. Other have had problems before when unlinking while link messages are still in the queue. At times it appears that the message can be lost. You do still want the parent to do the unlinking (so that you dont have every single child asking for link perms) so you'll have to have the child acknowledge the message before the parent unlinks it.
|
Christopher Omega
Oxymoron
Join date: 28 Mar 2003
Posts: 1,828
|
01-23-2006 07:12
To be totally honest, the process is going to run much slower and become much more complicated if you use dynamic linking to accomplish your goal. What's wrong with passing a randomly-generated channel to your rezzed object via llRezObject's int parameter, and passing the string via llShout? Don't worry about cross-chat, the situations where it would cause damage can be filtered by using llGetOwnerKey. Also, auto-linking encounters random permissions problems when the owner is not in the same sim as the linking objects - at least last I checked. So if you wanted to have something that links while youre not staring at it, you may run into trouble. Examples: //Rezzor: default { state_entry() { // Rez a child object: integer chan = (integer)llFrand(209429) + 1; llRezObject("child", llGetPos(), <0, 0, 0>, llGetRot(), chan); llShout(chan, "primitive params"); } }
//Child: integer rezzorListen; default { on_rez(integer params) { if (params != 0) { // We were rezzed by an object. llListenRemove(rezzorListen); rezzorListen = llListen(params, "", NULL_KEY, ""); } } listen(integer chan, string name, key id, string message) { if (llGetOwnerKey(id) == llGetOwner()) { // Do stuff with message. // ... llListenRemove(rezzorListen); } } }
Youre going to have to use something like Keknehv's list to string conversion functions to encode the list of primitive params beforehand whether you use linking or chat if you want to pass the primparams list directly from rezzor to child. ==Chris
|
Argent Stonecutter
Emergency Mustelid
Join date: 20 Sep 2005
Posts: 20,263
|
01-23-2006 07:19
My question is... would this be faster and less laggy than using listens?
Listens that are open for a short period shouldn't lag the sim much. If I understand the way object creation works, linking and unlinking requires a round trip through the asset system each time, so you're making three trips instead of just the one for the rez...
|