Jump to content
Sign in to follow this  
NicholasKulp

Is this possible in lsl?

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

Share this post


Link to post
Share on other sites

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.

 

Share this post


Link to post
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)

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

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?

Share this post


Link to post
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.

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
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 :)

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

Ah.. Oops.   Right thought..   My brain went left on me. Still, you can pack many numerical variables together as a single integer.

Share this post


Link to post
Share on other sites
You are about to reply to a thread that has been inactive for 3294 days.

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...