NicholasKulp Posted August 2, 2011 Posted August 2, 2011 Is it possible for a script in a hud to interact with a script inside of an object which is contained in the hud?Example: Button on hud to change the color of certain prims in the object contained within. I click red and then take the object out of the hud (or have it sent to me or w/e)and the specified part's color is changed (not the whole object).
Rufus Darkfold Posted August 2, 2011 Posted August 2, 2011 If by "object" you mean an object in the HUD's inventory, the answer is no. If you mean a child prim of the HUD, yes, though increasingly it is becoming unnecessary due to new APIs that allow manipulating more properties of child prims directly.
Void Singer Posted August 2, 2011 Posted August 2, 2011 currently the only things we can do to contents is read a few properties of them (creator, permissions, text in notecards, and landmark data), move them around to other places (different prims, avatars, deleteion) or identify them for use (animations, textures, sounds) there is very little we can't do with child prims now (set pins, trigger sounds), although some of it requires workarounds (child prim positions, etc)
DoteDote Edison Posted August 2, 2011 Posted August 2, 2011 While it's not possible to modify an object inside contents or inventory, technically it's possible to do something like you describe - with some limitations and communications methods. If you'll give the object to inventory (even to another avatar), you could send the preset configuration to a server database which the new object reads when rezzed in order to configure itself. For instance, if you sell custom teddy bears with more variations than you can possibly store in contents... maybe you offer a HUD which the customer uses to precisely customize their bear. When the order is placed, send all the variables to a database along with the customer UUID. Then, give the customer a generic bear. When the customer rezzes the bear, its script reads the database, matches the owner UUID to the customer UUID, applies the configuration, then clears that line from the DB. For simple things like setting the color of a single prim in the object when rezzed, you could use the integer variable of the on_rez() event. In the HUD, encode the desired color vector as an integer and send that with the llRezObject() "param". When the new object is rezzed, it could read the param from on_rez(), decode it back to a vector and apply the color. You could also use chat/listen to send configuration info to a newly rezzed object. Of course, these require the object to be rezzed in a script-enabled area.
NicholasKulp Posted August 3, 2011 Author Posted August 3, 2011 Would it be possible to set the description and then when it is rezzed or worn it could have a script that reads it's own description and sets the color?
NicholasKulp Posted August 3, 2011 Author Posted August 3, 2011 Oh and to clear the confusion, yes I'm talking about an object in contents. Not a child prim
Darkie Minotaur Posted August 3, 2011 Posted August 3, 2011 It is possible to read the description of a rezzed object and do something with the information - e.g. set the colour of an object. It however isn't possible to set description while the object is in the inventory. There could be other solutions, as has been suggested, but that depends on the context.
Innula Zenovka Posted August 3, 2011 Posted August 3, 2011 It's probably best to remind yourself -- I keep on forgetting -- that the object isn't actually inside the hud at all, any more than it's inside your inventory. What's there is an icon representing a pointer to an entry on the asset server somewhere, and what you want to manipulate is a particular instance of that asset that the script fetches for you by rezzing it.
NicholasKulp Posted August 3, 2011 Author Posted August 3, 2011 Okay so, y'all are saying the only way to change the objects color on the asset server or w/e you were trying to tell me is by rezzing it?
Darkie Minotaur Posted August 3, 2011 Posted August 3, 2011 *chuckles* 'Does this train leave for New York?", "Yes, it does?", "Are you sure it's the train to New York?", "Yes, asolutly positive.", "Ahh - ok - so, I can take this train to new York?" Either you have a hard time believing people or this was a funny troll attack.
Void Singer Posted August 3, 2011 Posted August 3, 2011 yes, must rez before anything can be changed.
NicholasKulp Posted August 3, 2011 Author Posted August 3, 2011 Excuse me, but "While it's not possible to modify an object inside contents or inventory, technically it's possible to do something like you describe - with some limitations and communications methods." tells me there could be a way. We're talking about code here, not trains. There are a lot of ways to do the same thing in LSL. Although it might be impossible with the obvious methods, sometimes there are ways around this. This is how great scripts are born. But thanks for trying to make me look dumb. Now that you are clearly out of ideas and of no use, you may leave this thread
NicholasKulp Posted August 3, 2011 Author Posted August 3, 2011 Thank you very much, this is all I needed .
Void Singer Posted August 3, 2011 Posted August 3, 2011 simplest fastest communication with a newly rezzed object would be via the rez parameter... hack the color code into bits and stuff them into an integer, let a script in the rezzed object catch it and reconstitue the color code. works for pretty much anything you can stuff into an integer by bit packing.... colors, flags, alpha, rotation, etc 1
NicholasKulp Posted August 3, 2011 Author Posted August 3, 2011 Ah, very interesting. So basically a start parameter can be used for many things, and can can be useful to store some data or what not about the object being rezzed.
Void Singer Posted August 3, 2011 Posted August 3, 2011 not about the object being rezzed necessarily, but for it to use? yes.
Rolig Loon Posted August 3, 2011 Posted August 3, 2011 It's a way to pass information from the rezzing script to another object as it is being rezzed. I suppose you can think of it as "storage" if you like, but the storage is in the sending script, not the object in inventory. After all, as others have pointed out, that object does not exist until it is rezzed in world. Void's observation is just that if you have updated information that an object will need when rezzed, you can pass it at that moment ...... if you can cast it as a string variable. If you have many variables to pass, concatenate them with a unique delimeter between them and then unpack them on arrival and recast them to their proper data types.
Rufus Darkfold Posted August 4, 2011 Posted August 4, 2011 It is an integer, not a string, unfortunately.
Rolig Loon Posted August 4, 2011 Posted August 4, 2011 Ah.. Oops. Right thought.. My brain went left on me. Still, you can pack many numerical variables together as a single integer.
Recommended Posts
Please take a moment to consider if this thread is worth bumping.
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now