Jump to content

Is this possible in lsl?


NicholasKulp
 Share

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

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

Recommended Posts

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

Link to comment
Share on other sites

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)

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 4649 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
 Share

×
×
  • Create New...