Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Trying to set up a rental texture

Bryce Haefnir
Registered User
Join date: 15 Oct 2008
Posts: 3
11-04-2008 17:56
I was trying to set up an advertising texture so that the rentor can apply a new texture to a side of it, but i'm fairly new to LSL. I have the script set up for renting allready and it works fine, but am kind of at a dead end as far as getting it to allow the rentor to drop a new texture on it... If anyone could please help i'd greatly appreciate it!

I guess what I am saying is how do you set it to where someone(not the object owner) can hold ctrl and drop a photo or texture to the side of the object and have it actually apply and change the texture.
Klug Kuhn
Registered User
Join date: 7 Sep 2007
Posts: 126
11-04-2008 22:49
You could try something as below, using llAllowInventoryDrop() to let tenant drops texture into the box. You could put this function to enable drop anywhere in the script, however, it is most likely that it'll trigger TRUE when the tenant has just rented. Then there is a 3 minute time limit for him/her to drop texture(you could set any time of course); when the time is up, using llAllowInventoryDrop(FALSE) to stop anyone to drop anymore.

However, below is only the basic idea, there should be something more to consider, e.g.:
* delete the texture when the tenant rental is up.
* using a llMessageLinked() and the link_message() event to pass the timer, since you might already been using the timer for the rental etc..

Hope that helps :)

//_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
//_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
default
{
state_entry()
{
}
money(key tenant,integer amt)
{
llAllowInventoryDrop(TRUE);
llSetTimerEvent(180.0); // 3 minutes

// ... do the rental procedures ...

}
timer()
{
llSetTimerEvent(0.0);
llAllowInventoryDrop(FALSE);
}
changed(integer change)
{
if (change & CHANGED_ALLOWED_DROP)
{
// someone dropped items, it changes the texture on the box
// this texture is the first texture in the box's content
// ALL_SIDES is the face on the box to change, you could use 0,1,2,etc..
llSetTexture(llGetInventoryName(INVENTORY_TEXTURE,0),ALL_SIDES);
}
}
}
//_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
//_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
Bryce Haefnir
Registered User
Join date: 15 Oct 2008
Posts: 3
Thank you
11-05-2008 19:49
Thank you for the post! I couldn't figure out the llLinkMessage, I used to program a lot for hobby but am kinda out of practice. But I'm still going to look into that! I actually ended up just creating a dialog that when the rentor clicked the object it brought up a menu with "Texture" and "Landmark", and when they clicked one, it checked a counter to see if there was already one set, if not, it gave llAllowInventoryDrop=TRUE, and if so, it deleted the stored name of the texture/landmark(stored in the changed event) and then reset the texture/landmark counter to 0. Then I set a changed event that checked the inventory items one at a time to see if they were a texture or landmark (the texture didnt mess anything up because I'm using a UUID for the original texture so its not in the inventory), then it stored that items name for the texture/landmark into a string, apllied if it was a texture, and set the counter to 1. I'm sure once I figure out the basics on the message link that it might work a little better, but all is fine for now! If youd like to see the script to tell me what you think, IM me! I'm generally on around 5pm - 10-11pmish sl time.

Thanks again for the suggestion!
Klug Kuhn
Registered User
Join date: 7 Sep 2007
Posts: 126
11-05-2008 20:56
You're very welcome~ llLinkMessage() is very useful especially when you are overcoming with "event overlapping" in the same state, simply by using a separate script, you'll find the world is much better to live :P

Let me know if you require further assistance :)