Jump to content

Detach...


bigmoe Whitfield
 Share

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

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

Recommended Posts

I'm having a bad blonde moment here. 

 

default
{
    attach(key AvatarKey)
    {//give instructions for use and prevent item from being attached to avatar
        if(AvatarKey)
        {//event is called on both attach and detatch, but Key is only valid on attach
            llOwnerSay ("
            We hope you will enjoy your purchase, 
            but if you really want to use this item properly, you should: 
            1) drag it from your inventory to the ground 
            2) Right click on it and select \"open\"
            3) copy its contents to inventory.");
 
            llRequestPermissions(AvatarKey, PERMISSION_ATTACH );
        }
    }
    run_time_permissions(integer perm)
    {
        if(perm & PERMISSION_ATTACH)
        {
            llDetachFromAvatar( );
        }
    }
}

 

 

that's the script.  for the life of me I can not figure out how to get it to work on a touch event, as I do not want it to deatch as it does,  aka they put it on, it's taking it back off.   and the other examples I've tinkred with that dealt with linked numbers refuses to even work.   so help this dumbdumb out a little bit.  

Link to comment
Share on other sites

28 minutes ago, steph Arnott said:

This has some scripts that will show you how https://www.outworldz.com/cgi/freescripts.plx?ID=389

BTW the script you supplied is off the LSL wiki and you are not supposed to copy paste it here as it is copywrite.

 

 

12 years I have been here and have posted many things to this forum and first time anyone has said this to me, so if @Tommy Linden can clarify this for us.  

 

Link to comment
Share on other sites

Just now, steph Arnott said:

Actually tells you not on the wiki.

link?  because it's never been an issue in all the years I've been here to REPOST them to the linden owned forum to get help with them.   still going to wait for tommy to actually clarify what the labs position is.

Link to comment
Share on other sites

Just now, bigmoe Whitfield said:

link?  because it's never been an issue in all the years I've been here to REPOST them to the linden owned forum to get help with them.   still going to wait for tommy to actually clarify what the labs position is.

Am not arguing about it. The wiki clearly states that. I gave you a site which has several scripts which you can use and mod to do what you wanted. End off.

Link to comment
Share on other sites

1 minute ago, Whirly Fizzle said:

Gosh, I'm getting strange sense of déjà vu here  :D

As far as I'm aware, any content posted on the wiki is licensed under the Creative Commons Attribution-Share Alike 3.0 license - https://creativecommons.org/licenses/by-sa/3.0/

So I see no problem with copy/paste of wiki scripts here.

It states not to copy paste to online pages because it is copywrite. I also think this site also states not to. Also it took me less than five minutes to find a working example of what the OP wants. They were given that link. End of.

  • Confused 1
Link to comment
Share on other sites

Ok got some links to back this up.

1) https://wiki.secondlife.com/wiki/Project:Terms_of_Service

Quote

...and you license your contributed content under the Creative Commons Attribution-Share Alike 3.0 license

2) I believe Steph is getting mixed up because of the old chat on this page: https://wiki.secondlife.com/wiki/Talk:LSL_Portal

which discusses the rights to copy wiki content from the old LSLwiki.net to the "new" (at the time)  wiki.secondlife.com

  • Like 2
Link to comment
Share on other sites

Just now, Whirly Fizzle said:

Ok got some links to back this up.

1) https://wiki.secondlife.com/wiki/Project:Terms_of_Service

2) I believe Steph is getting mixed up because of the old chat on this page: https://wiki.secondlife.com/wiki/Talk:LSL_Portal

which discusses the rights to copy wiki content from the old LSLwiki.net to the "new" (at the time)  wiki.secondlife.com

Nothing confusing at all. Your own link clearly states the reqiured notices and proceedures.

  • Confused 1
Link to comment
Share on other sites

Regarding the question at hand, the script is basically doing three things:

  1. Detecting whether it's just been attached to an avatar, and then
  2. Issuing a message to the owner
  3. Initiating a detach  - which itself involves requesting the PERMISSION_ATTACH to be granted first.

If your goal is to trigger #2 and #3 from a touch, then the first step would be to add in a touch_start event. Within the touch_start event you can check if the object is currently attached by checking the return value of llGetAttached. If it is determined that the object is attached at this time, then you can move the llOwnerSay and llRequestPermissions commands into the touch_start event, and get rid of the attach event. The run_time_permissions can be reused as is.

How exactly to set this up, I leave as an exercise to the OP. But it will follow a very similar structure to what you see in the attach event.

  • Like 3
Link to comment
Share on other sites

3 minutes ago, Fenix Eldritch said:

Regarding the question at hand, the script is basically doing three things:

  1. Detecting whether it's just been attached to an avatar, and then
  2. Issuing a message to the owner
  3. Initiating a detach  - which itself involves requesting the PERMISSION_ATTACH to be granted first.

If your goal is to trigger #2 and #3 from a touch, then the first step would be to add in a touch_start event. Within the touch_start event you can check if the object is currently attached by checking the return value of llGetAttached. If it is determined that the object is attached at this time, then you can move the llOwnerSay and llRequestPermissions commands into the touch_start event, and get rid of the attach event. The run_time_permissions can be reused as is.

How exactly to set this up, I leave as an exercise to the OP. But it will follow a very similar structure to what you see in the attach event.

What like this, which is on the link i gave?

//Ferd Frederix

default
{
	touch_start(integer num)
	{
		if(!llGetAttached())
			llRequestPermissions( llDetectedKey(0), PERMISSION_ATTACH );
		else if( llGetPermissions() & PERMISSION_ATTACH )
			llDetachFromAvatar();
	}
	attach(key id)
	{
		if(id)
			llRequestPermissions( id, PERMISSION_ATTACH | PERMISSION_TRIGGER_ANIMATION );
	}
	run_time_permissions (integer perm)
	{
		if(!llGetAttached() && (perm & PERMISSION_ATTACH) )
			llAttachToAvatarTemp( ATTACH_NOSE );
		if(perm & PERMISSION_TRIGGER_ANIMATION)
			llStartAnimation( llGetInventoryName( INVENTORY_ANIMATION, 0) );
	}
}

 

Link to comment
Share on other sites

5 hours ago, steph Arnott said:

Nothing confusing at all. Your own link clearly states the reqiured notices and proceedures.

Well... okay, just so it's clear to others: Absolutely everything on the Second Life wiki is free to copy under the terms of the Creative Commons Attribution Share-Alike 3.0 license. Copying into this forum doesn't really require the complexities of exercising that license, however, because both properties are copyright Linden Research, Inc., so they'd basically have only themselves to sue if they didn't like something.

What is shrouded in mystery, and therefore should not be copied lest some copyright ghost rears its hideous mien, is anything from lslwiki.net. That was a much lamented loss because contributors presumed that their contributions would be public domain -- but that was unfortunately never made explicit, so all that content is largely stranded now.

  • Like 2
Link to comment
Share on other sites

  • 5 months later...

Oddest part is that Steph doesn't seem to realize the url names
https://community.secondlife.com
http://wiki.secondlife.com

See the part that says "secondlife.com" ... that's the domain name for them both, meaning its the same domain. See the part that says "community" and the other that says "wiki". Those are the subdomains of "secondlife.com" .... in other words, both of those subdomains are part of the same domain. So I second what Qie said, what is Linden Lab gonna do, sue themselves? Plus like others have stated -- Creative Commons Attribution-Share Alike 3.0 license - https://creativecommons.org/licenses/by-sa/3.0/

Link to comment
Share on other sites

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