instance an object
|
|
San Fabre
Registered User
Join date: 19 Oct 2006
Posts: 2
|
10-23-2006 08:13
I have an object which I want to replicate across my lands. I can do this easy enough by dragging it from the inventory. However, when I want to change that object, I would like to change it once and have it updated automatically across all my land. At the moment I have to change each and every one manually.
Does anyone know how to achieve this? Thanks!
|
|
Ceera Murakami
Texture Artist / Builder
Join date: 9 Sep 2005
Posts: 7,750
|
10-23-2006 08:24
Change it in what way?
If it is a predictable change, you could use communications between the objects, working on a non-zero chat channel, to spread a command from one to another. For example, you could have a row of tiki torches, and giving one a command to extinguish its flame (llDie command on a rezzed object for the flame) could also transmit the "lights out" command to the other torches that you own, so they all go out at once. Or an "llResObject" so they all light at once.
Similar scripting could control specific size changes. A friend of mine makes a set of non-alpha curtains that re-size the prims for the left and right curtain, and which detects a manual edit to re-size the curtain's root prim, and adjusts the scripting accordingly. A communications command could be added to that so all the curtains in a given room would open and close on a single command.
But if you mean to make it so any change that you make to a master object is also replicated in the child objects... Well, I don't think that can be done.
_____________________
Sorry, LL won't let me tell you where I sell my textures and where I offer my services as a sim builder. Ask me in-world.
|
|
Chosen Few
Alpha Channel Slave
Join date: 16 Jan 2004
Posts: 7,496
|
10-23-2006 08:37
SL does not support instancing directly. Its 3D modeling capabilities are somewhat unique, and do not include a great many functions that you may be used to from more standard modeling programs. (Of course, the reverse is also true. You can instance a car in Maya or Max, but you can't get in it and drive it around town like you can in SL. All programs have their pluses and minuses.)
The way to do stuff like what you're talking about is through scripting, as Ceera said. You'd need to put a "transmitter" script in the master object, and a "receiver" script in each of the copies. The "transmitter" would monitor the given parameters of the master object for changes, and then instruct the "receivers" to initiate identical changes to the other objects.
It likely would be rather complicated to have the scripts handle every conceivable change, but in theory, it could probably be done. Don't ask me how though. You'll need a scripting guru to handle something like that, and that ain't me.
_____________________
.
Land now available for rent in Indigo. Low rates. Quiet, low-lag mainland sim with good neighbors. IM me in-world if you're interested.
|
|
San Fabre
Registered User
Join date: 19 Oct 2006
Posts: 2
|
10-23-2006 08:39
Thanks for your reply. It would be good to change the scripting on an object globally. For example, i'm pulling a texture off an external web server in the script. If I need to change the texture refresh, ( for example, change the image) I want to make the changes to the code once and have it update across all my structures that I have on all my lands. I have some code here:
key http_id; key VIDEO_DEFAULT = "6e0f05ad-1809-4edc-df29-fae3d2a6c9b8"; seturl(string url) { key video_texture = llList2Key(llParcelMediaQuery( [PARCEL_MEDIA_COMMAND_TEXTURE]), 0); if(video_texture == NULL_KEY) { video_texture = VIDEO_DEFAULT; llParcelMediaCommandList([PARCEL_MEDIA_COMMAND_TEXTURE, VIDEO_DEFAULT]); } llSetTexture(video_texture,ALL_SIDES); llParcelMediaCommandList([PARCEL_MEDIA_COMMAND_URL,url]); llParcelMediaCommandList([PARCEL_MEDIA_COMMAND_PLAY]); llParcelMediaCommandList([PARCEL_MEDIA_COMMAND_AUTO_ALIGN,TRUE]); } default { state_entry() { seturl("http://www.etc.com/whatever.jpg"); llSetTimerEvent(20); } timer() { seturl(""); llResetScript(); } }
It checks the server every 20 seconds for a new image, how can I change this to say, 30 and have the code update across all objects in my lands? Thanks!
|
|
Ordinal Malaprop
really very ordinary
Join date: 9 Sep 2005
Posts: 4,607
|
10-23-2006 08:42
For a complex changing object, you could have a rezzing prim which moved about to all of the known locations whenever you wanted to update.
The object to be rezzed would have to have a script in it which (a) on-rez and when moved, informed the rezzer where it was and what its rotation was (b) made it die on command
The rezzer then has a list of where it needs to rez new objects. When you update the object and tell it to go, it (a) zips to the next location (b) tells the old object to die (c) rezzes the new object at the same position and rotation (d) repeat for all objects
If your land is spread out across islands and the mainland, or between different islands, nah, you're out of luck - the rezzer wouldn't be able to travel between them. You'd need one rezzer per area. If they're just in a relatively limited area it should be okay.
_____________________
http://ordinalmalaprop.com/forum/ - visit Ordinal's Scripting Colloquium for scripting discussion with actual working BBCode!
http://ordinalmalaprop.com/engine/ - An Engine Fit For My Proceeding, my Aethernet Journal
http://www.flickr.com/groups/slgriefbuild/ - Second Life Griefbuild Digest, pictures of horrible ad griefing and land spam, and the naming of names
|
|
Ordinal Malaprop
really very ordinary
Join date: 9 Sep 2005
Posts: 4,607
|
10-23-2006 08:46
If you want to just change a script in an object you can use llRemoteLoadScriptPin, but the sender has to be in the same sim. Faster than the method I mentioned before though. Ideally, what you want is to have your objects check email and modify their own parameters based on email they receive. That way all you need is a list of their keys - your updater can email them all wherever they are to change their parameters.
_____________________
http://ordinalmalaprop.com/forum/ - visit Ordinal's Scripting Colloquium for scripting discussion with actual working BBCode!
http://ordinalmalaprop.com/engine/ - An Engine Fit For My Proceeding, my Aethernet Journal
http://www.flickr.com/groups/slgriefbuild/ - Second Life Griefbuild Digest, pictures of horrible ad griefing and land spam, and the naming of names
|
|
Chosen Few
Alpha Channel Slave
Join date: 16 Jan 2004
Posts: 7,496
|
10-23-2006 09:23
From: San Fabre Thanks for your reply. It would be good to change the scripting on an object globally. For example, i'm pulling a texture off an external web server in the script. If I need to change the texture refresh, ( for example, change the image) I want to make the changes to the code once and have it update across all my structures that I have on all my lands. I have some code here:
key http_id; key VIDEO_DEFAULT = "6e0f05ad-1809-4edc-df29-fae3d2a6c9b8"; seturl(string url) { key video_texture = llList2Key(llParcelMediaQuery( [PARCEL_MEDIA_COMMAND_TEXTURE]), 0); if(video_texture == NULL_KEY) { video_texture = VIDEO_DEFAULT; llParcelMediaCommandList([PARCEL_MEDIA_COMMAND_TEXTURE, VIDEO_DEFAULT]); } llSetTexture(video_texture,ALL_SIDES); llParcelMediaCommandList([PARCEL_MEDIA_COMMAND_URL,url]); llParcelMediaCommandList([PARCEL_MEDIA_COMMAND_PLAY]); llParcelMediaCommandList([PARCEL_MEDIA_COMMAND_AUTO_ALIGN,TRUE]); } default { state_entry() { seturl("http://www.etc.com/whatever.jpg"); llSetTimerEvent(20); } timer() { seturl(""); llResetScript(); } }
It checks the server every 20 seconds for a new image, how can I change this to say, 30 and have the code update across all objects in my lands? Thanks! I'll preface this by repeating, scripting's not my strong suit, but from what I can tell, the script you've got there is using land media settings to display a texture as video (if I'm wrong, someone please correct me). Video in SL is displayed by replacing a chosen texture with a Quicktime overlay. Any and all prims that have that texture on them (on the same land) will display the video. So, in this particular case, updating them all at once is elementary. They have to all update at once since that's how video in SL works. As for changing it to 30 seconds instead of 20, that's easy. See the line that says llSetTimerEvent(20);? Just replace that with llSetTimerEvent(30);.
_____________________
.
Land now available for rent in Indigo. Low rates. Quiet, low-lag mainland sim with good neighbors. IM me in-world if you're interested.
|