Jump to content

Modifying objects via script before giving them to an avatar, from a single base object?


alaynadelrey
 Share

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

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

Recommended Posts

I'm almost done with a script to create a small garden, but the last part is tripping me up. I need to give a small number of copies of a carrot to the avatar clicking on the prim. Not so hard, but I also want these copies to be no-copy and no-modify, and to store their own variables.

I guess I could store the variables in the Description box, but that doesn't solve the problem of how to make my script take a prim (either in its inventory or a linked prim inside) and give a few no-mod, no-copy copies to the avatar with slightly different descriptions and names.

I think this is possible, since I've seen similar items work, but those scripts are no-mod so I can't see how it was done, and I'm at a loss for how to make this happen.

Link to comment
Share on other sites

I think I understand what you're after.  You could take either one of two approaches,  One is to save several versions of your carrot in your vendor prim and then script your vendor to hand out a random selection to anyone who clicks.  Another approach is to create a single carrot with a script that changes the carrot's appearance when a new owner receives it.  In very simple form....

default{    changed (integer change)    {        if(change & CHANGED_OWNER)        {            list colors(<1.0,0.0,0.0>,<1.0,1.0,0.0>,<1,0.0.0,1.0>,<1.0,1.0,1.0>);            llSetColor(llList2Vector(colors,(integer)Frand(4.0)),ALL_SIDES);        }    }}

Either way, the person who clicks gets a random carrot from the universe of carrot models you have designed.  If you want to have information of some kind saved in the object's Description field, just put a llSetObjectDesc statement in your changed event too.

 

 

Link to comment
Share on other sites

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