Jump to content

Disallowing two (or more) of the same object


ZachMatheson
 Share

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

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

Recommended Posts

Hi Team,

 

I wonder if someone could point me in the right direction here.

I have an object that avatars are supposed to attach to their skull.

If they attach multiple of these objects across their body, what is the easiest way for me to detect the extra objects so I can call a llDetachFromAvatar to remove them?

Link to comment
Share on other sites

Was thinking like a "Marco"-"Polo" type game

 

llGetAttachedList could work too if the object is no mod to where the name/description can't/won't be changed.

In that case I would put some identifying name/number to look for in the description field

You could use llGetObjectDetails and run through the list of attachments and get their descriptions. If one or more has the same identifying string, then it's a match and they already have the attachment attached

 

Link to comment
Share on other sites

How about the item, on attaching, opens a listener and asks "Am I the first?"     If it receives a reply, it detaches itself.   If it doesn't, when it receives the question "Am I the first" from an item belonging to its owner, it replies "Nope!"..

integer iItemChannel;key kOwner;default{	attach(key id)	{		if(id){			kOwner = id;			iItemChannel = (integer)("0xF" + llGetSubString(kOwner,0,6)) - 150;			llListen(iItemChannel,"","","");			llRegionSayTo(kOwner, iItemChannel, "Am I the first?");		}	}	listen(integer channel, string name, key id, string message)	{		if(llGetOwnerKey(id)==kOwner){			if("Am I the first?" == message){				llRegionSayTo(id, iItemChannel, "Nope!");			}			else if ("Nope!" == message){				llRequestPermissions(kOwner, PERMISSION_ATTACH);			}		}	}	run_time_permissions(integer perm)	{		//etc	}}
  • Like 1
Link to comment
Share on other sites


wherorangi wrote:

i would probably look at using llGetAttachedList on attach

then read some unique property of any attachments with the same name 

 

I would try wherorangi's approach first personally. Even as basic as the same name. The first one will never find a duplicate. The second one would. The only time I can figure we'd have more than two is an Add race. They only need to find one other to detach.

Link to comment
Share on other sites

anti-gamification measures are a pretty deep subject and lots depends on how the game is constructed

anti-gamification measures are pretty much all about non-trust

the game server never accepts/trusts what a player tells it without a independent way of verifying what it is told. Typically by monitoring the players actions as they play to earn the gameplay points/tokens/etc

  • Like 1
Link to comment
Share on other sites

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

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...