Jump to content

Derezz if avatar rezzes and Give Object If Object Rezzes


AllBlackSkiMask
 Share

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

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

Recommended Posts

Im trying to configure a script that will De-rez a object if a avatar were to try and cheat the system and go into the objects contents to retrieve the object they have to work for that they own.

I Want only the object able to rez the temp rez item.

So im hoping to form or get help forming a script that will de rez/delete a prim rezzed by avatar but give a object to that avatar if the object is rezzed from the prim itself.

Link to comment
Share on other sites

The easiest solution, that requires planning in the rezzer script, is to use the final parameter in the llRezObject command. Use an integer other than 0. In the object being rezzed, in the on_rez(integer rezparam) event, check that rezparam is not 0

The other solution, if for some reason you can't access the script with the rez command, is in the on_rez event, use llGetObjectDetails(llGetKey(), [OBJECT_REZZER_KEY]);

Then extract that key from the list, and compare it to the owner key, if they aren't a match, it was rezzed by an object

  • Thanks 1
Link to comment
Share on other sites

Solution 1:

use a non-zero integer in the last param of the rez command. The reason is, when an avatar rezzes an object, the on_rez event only receives a zero as the rezparam

In rezzer script:

llRezObject("object name",pos,velocity,rotation,a non zero integer);

in the object being rezzed:

on_rez(integer rezparam)
{
	if(rezparam)//will test true if it's non-zero
	{
		//give contents or whatever
	}
	else//was rezzed by avatar
	{
		llDie();
	}
}

 

solution 2:

use this for the on_rez event in the object being rezzed

on_rez(integer rezparam)
{
	list details = llGetObjectDetails(llGetKey(),[OBJECT_REZZER_KEY]);
	key rezzer = llList2Key(details,0);
	if(rezzer != llGetOwner())//if rezzer doesn't equal the owner key, then it was rezzed by an object
	{
		//give contents or whatever
	}
	else
	{
		llDie();
	}
}

 

  • Like 2
Link to comment
Share on other sites

You can also add another layer of security if the rezzer is no mod uses a unique creation time specific only to the app involved and will not be used with any other app that you create in the future.

This would prevent someone from using their own rezzers, especially if they use other prims/mesh you created.

Of course, you could also use some back and forth communications between the rezzer and rezzed object too.

  • Like 1
Link to comment
Share on other sites

But the object will be of pretty limited use if it can survive only in no-script areas.   OK, you can rez it in a no-script area but as soon as you take it out of the no-script zone, then it will vanish.

And if you're really worried about it being rezzed in a no-script area, you can always set things up so the script has to run for it to be any use (e.g. use the script's on_rez event to make it visible, texture it, set it to the correct size, and so on).

Edited by Innula Zenovka
  • Like 2
Link to comment
Share on other sites

4 hours ago, AllBlackSkiMask said:

... if a avatar were to try and cheat the system and go into the objects contents to retrieve the object they have to work for that they own.

on this part of the problem

when we want to disallow the contents of our object to be asset stripped by the user/owner then: Use at least 2 prims to make the object. Put all the contents into the linked 2nd prim which is not the root prim. Root prim - to have zero content. And set the object perms to No-Modify

Content asset copying to Inventory is the most common thing people do, by Open -> Copy to Inventory.  We have to be able to have this Copy ability from the root prim regardless of object permissions, so that shop keepers can give us stuff in boxed packages

  • Thanks 1
Link to comment
Share on other sites

6 hours ago, Innula Zenovka said:

But the object will be of pretty limited use if it can survive only in no-script areas.   OK, you can rez it in a no-script area but as soon as you take it out of the no-script zone, then it will vanish.

And if you're really worried about it being rezzed in a no-script area, you can always set things up so the script has to run for it to be any use (e.g. use the script's on_rez event to make it visible, texture it, set it to the correct size, and so on).

do you think its easy to implement a run in no script zone script into this?  i wish it was a easy way to send a object thats not inside of the objects contents but i dont have a solution yet for that.

Link to comment
Share on other sites

9 hours ago, AllBlackSkiMask said:

do you think its easy to implement a run in no script zone script into this?  i wish it was a easy way to send a object thats not inside of the objects contents but i dont have a solution yet for that.

I'm not sure I understand the question.

If you want a script to run in a no-script zone, it needs to be in something the avatar is wearing or sitting on before it enters the no-script zone.  Then it's simply a matter of calling llRequestPermissions(id, PERMISSION_TAKE_CONTROLS)  when the object is first attached/sat on and then calling llTakeControls in the run_time_permissions event.

I don't understand what you mean by " i wish it was a easy way to send a object thats not inside of the objects contents".    Can you please explain more specifically what you are trying to do?  There's all sorts of ways for a script in one object to tell a script in a second object to send  something in the second object's contents to an avatar.

Link to comment
Share on other sites

On 10/7/2018 at 10:35 AM, Innula Zenovka said:

I'm not sure I understand the question.

If you want a script to run in a no-script zone, it needs to be in something the avatar is wearing or sitting on before it enters the no-script zone.  Then it's simply a matter of calling llRequestPermissions(id, PERMISSION_TAKE_CONTROLS)  when the object is first attached/sat on and then calling llTakeControls in the run_time_permissions event.

I don't understand what you mean by " i wish it was a easy way to send a object thats not inside of the objects contents".    Can you please explain more specifically what you are trying to do?  There's all sorts of ways for a script in one object to tell a script in a second object to send  something in the second object's contents to an avatar.

7

 

what i mean by " i wish it was a easy way to send a object thats not inside of the objects contents". is to have a non copy,modify item able to be sent from a different location from a dropbox of a such once a trigger is received from another sim 

an example would be. (you rez a stove > cook some food > you have to rez the ingredients > the ingredients disappear > the item you cooked is rezzed > it privately say's a trigger word or sends a message to a dropbox > you receive the item from a different location with the same name as the item you cooked that was rezzed.)

Link to comment
Share on other sites

If the dropbox is on the same region, then simply have the stove use llRegionSay to tell the dropbox what to send and to where.   You can either send it to whoever is using the stove or have it rez on top of the stove, depending on how you want to do it.

If the dropbox is on a different region, then it's still possible to send the food to the avatar using the stove, who would then need to rez it.  It's rather more complex, though, so I won't go into the process unless that's what you want to do.

Link to comment
Share on other sites

1 hour ago, Innula Zenovka said:

If the dropbox is on the same region, then simply have the stove use llRegionSay to tell the dropbox what to send and to where.   You can either send it to whoever is using the stove or have it rez on top of the stove, depending on how you want to do it.

If the dropbox is on a different region, then it's still possible to send the food to the avatar using the stove, who would then need to rez it.  It's rather more complex, though, so I won't go into the process unless that's what you want to do.

I figured complex is somewhat a safelock but im hoping to achieve to be able to send the food to the avatar using the stove  from a dropbox or anyway i can from another region

Link to comment
Share on other sites

3 hours ago, AllBlackSkiMask said:

I figured complex is somewhat a safelock but im hoping to achieve to be able to send the food to the avatar using the stove  from a dropbox or anyway i can from another region

A scripted object can send an object from its inventory to another object or to an avatar anywhere on the same region with llGiveInventory.  It cannot send an object to another object outside the region, but it can send to an avatar anywhere in SL, again using llGiveInventory.  As long as you don't need to get involved with messaging too, that should be enough to handle your project.

Link to comment
Share on other sites

11 minutes ago, Rolig Loon said:

A scripted object can send an object from its inventory to another object or to an avatar anywhere on the same region with llGiveInventory.  It cannot send an object to another object outside the region, but it can send to an avatar anywhere in SL, again using llGiveInventory.  As long as you don't need to get involved with messaging too, that should be enough to handle your project.

i dont know how it would be other than giving them what i dont want them to have the access to just buy the product from marketplace and take the finished creation from the contents i've seen it done to where an object can send regionwide items

Link to comment
Share on other sites

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