Jump to content
You are about to reply to a thread that has been inactive for 4877 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

Posted

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). 

Posted

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.

 

Posted

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)

Posted

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.

Posted

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.

Posted

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.

Posted

*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. ;)

Posted

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 :)

Posted

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

  • Like 1
Posted

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.

Posted

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.

You are about to reply to a thread that has been inactive for 4877 days.

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
×
×
  • Create New...