Jump to content

How to you make things disappear?


Prokofy Neva
 Share

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

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

Recommended Posts

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.

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

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

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

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

 

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

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

Link to comment
Share on other sites

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