Jump to content
Prokofy Neva

How to you make things disappear?

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

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

Recommended Posts

If you want to make a demo that disappears after 60 seconds, or let's say a cup of tea that disappears from the user's hand so they don't have to detach it, how do you do that?

Share this post


Link to post
Share on other sites

You could attach the cup with llAttachToAvatarTemp, so that it can't be taken back to the person's avatar when detached.  Then, start a timer as the cup attaches, and use llDetachFromAvatar when the timer triggers. The cup will detach and vanish.  It's a mildly complicated bit of scripting, but there's an example (minus the timer bit)  in the LSL wiki page on llAttachToAvatarTemp that shows you how to do the hard part.

Share this post


Link to post
Share on other sites

Yes, there's that, I've seen scripts that do that. I think there's an even better thing, which Qie told me about, "rez wearable on touch" then the wearable comes right into your hand, then goes back into inventory on its own, I think it has a timer or you can put one in.

But I mean something different, or at least, I don't think I can get "rez wearable" to work with this.

While trying to put something out the other day, I noticed that it kept disappearing. I thought it was on phantom or something. It was a puddle that went with some other thing I don't even recall. But what was interesting about this object is that it had a box checked off on the object menu called TEMP. Walla! That seems to be the thing that makes objects disappear after 60 seconds. And maybe that's what merchants use for demos?

Except...I found something that doesn't work with that. If you have a scripted object that you wear, let's say in the case I'm trying to solve a rake, and it is in your hand, it simply won't disappear. On the ground by itself it will, but if you "add" or "wear" it, it won't. So I don't see how I can get "temp" to work to disappear things.

I don't know how merchants do it.

  • Like 1

Share this post


Link to post
Share on other sites
1 hour ago, Prokofy Neva said:

Except...I found something that doesn't work with that. If you have a scripted object that you wear, let's say in the case I'm trying to solve a rake, and it is in your hand, it simply won't disappear. On the ground by itself it will, but if you "add" or "wear" it, it won't. So I don't see how I can get "temp" to work to disappear things.

I don't know how merchants do it.

Good questions, Prok. I've been trying to get my head round all of this myself. As far as I can tell worn and rezzed have different script commands, which means (if I'm understanding this correctly) a wearable will behave differently when rezzed unless the creator took the time to script for both.

I've seen information saying that llDie is the only option for deleting rezzed objects, but there's a lot of obsolete info floating around. I'm hoping there's something less harsh now but haven't found it.
 

Share this post


Link to post
Share on other sites

Now we have to distinguish between what kind of item we want to make a demo of.

  • An object - be it a tea pot or vehicle
  • Wearable - for example clothes
  • Attachment - for example a cake given from a dispenser

There are several ways to do this. An object is easy made disappear using either a timer or when an person unsit from say a vehicle with llDie() - for the other kinds use llAttachToAvatarTemp(). If it is attached direct by the user from  the inventory, one has to do some extra script works and use llDetachFromAvatar() and handle it here.

Further the permissions set combined with above ensure a basic protection of abuse of the demo item.

Edited by Rachel1206
  • Like 1

Share this post


Link to post
Share on other sites

Yeah setting an item to temporary only makes it poof if it's rezzed out on the ground or something,  not if it's attached. It's to prevent things from piling up and making a mess, usually with things that throw objects (and nobody's going to want to chase down all the objects and delete them by hand). And I'm not sure if it's always 60 seconds, I think that's just the maximum time it can exist. If the sim does a cleanup thingy, it'll go then and not stay the other 30 seconds or so.

As far as attached items, you've got better advice up there already than I can give... <-<; Just chipping in.

Share this post


Link to post
Share on other sites
10 hours ago, Rachel1206 said:

Now we have to distinguish between what kind of item we want to make a demo of.

  • An object - be it a tea pot or vehicle
  • Wearable - for example clothes
  • Attachment - for example a cake given from a dispenser

There are several ways to do this. An object is easy made disappear using either a timer or when an person unsit from say a vehicle with llDie() - for the other kinds use llAttachToAvatarTemp(). If it is attached direct by the user from  the inventory, one has to do some extra script works and use llDetachFromAvatar() and handle it here.

Further the permissions set combined with above ensure a basic protection of abuse of the demo item.

There it is a nutshell.  All of that is much easier if you do it in an Experience, because you don't need to deal with requesting permissions repeatedly. As the examples in the wiki entry for llAttachToAvatarTemp illustrate, without an Experience you need to request perms at least twice.

Share this post


Link to post
Share on other sites
integer TIME_DEMO=60; // Seconds

integer gTime;

default{
	on_rez(integer Param){
		if(gTime==0&llGetOwner()!=llGetCreator()){
			gTime=llGetUnixTime();
			llSetTimerEvent(1);
		}
	}
	timer(){
		if(llGetUnixTime()-gTime>=TIME_DEMO){
			if(llGetAttached()==0){
				llDie();
			}else{
				llRequestPermissions(llGetOwner(),PERMISSION_ATTACH);
			}
		}
	}
	run_time_permissions(integer Perm){
		if(Perm&PERMISSION_ATTACH){
			llDetachFromAvatar();
		}
	}
}

That should do it.

It's also a great script to remove those pesky No Copy restrictions from rare gachas.

Edited by Arduenn Schwartzman

Share this post


Link to post
Share on other sites

@Arduenn Schwartzman But I don't want a script that defeats no-copy on rare gachas, that's wrong and against the TOS. Creators work hard to make things for gachas which are often of the highest quality in SL and I'm happy to pay them AND respect their permissions. It takes all the starch out of the whole gatcha rare thing if you just copybot stuff.

 

Share this post


Link to post
Share on other sites
On 9/13/2017 at 3:45 PM, Rolig Loon said:

There it is a nutshell.  All of that is much easier if you do it in an Experience, because you don't need to deal with requesting permissions repeatedly. As the examples in the wiki entry for llAttachToAvatarTemp illustrate, without an Experience you need to request perms at least twice.

Thank you and everyone else for explaining these things. They look easier said than done. I do wonder if the trick is to abandon scripting and do experiences but I have no idea how to do those or where to start, whereas scripting I know a tiny bit about.

Share this post


Link to post
Share on other sites
1 hour ago, Prokofy Neva said:

I do wonder if the trick is to abandon scripting and do experiences but I have no idea how to do those or where to start, whereas scripting I know a tiny bit about.

Experiences are just one more new tool in the scripting bag of tricks.  They do make some things possible that were never possible before, and they make some others -- like temporary attachment -- a bit easier. On the downside, a script written with Experience functions can only work on land where the Experience has been activated. In most cases, it means that any script you write in an Experience is only going to work in a few very specific places. So, a very powerful and interesting set of functions, but with some practical limitations.

In this particular case, you don't need to use Experience tools at all.  llAttachToAvatarTemp was introduced a year or two before Experiences were made available to SL scripters, and we learned how to use it quite well.  Take another look at the examples I pointed you toward in the LSL wiki.  When you get your head around them, the logic is really pretty straightforward.

Share this post


Link to post
Share on other sites
You are about to reply to a thread that has been inactive for 1060 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.


×
×
  • Create New...