Jump to content
You are about to reply to a thread that has been inactive for 70 days.

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

Recommended Posts

Posted

Hi all, hopefully this is the right area for this question.

I was looking on marketplace for a script that would allow a group member wearing the group tag to get a discount on items in the store.

The store is on land owned by me, not by the group.

But all the scripts I have looked at so far have reviewers stating that for the script to work the item on sale needs to be set to the relevant group.

Is this essential?

Does anyone know of a script that will work based on the group tag the purchaser is wearing without any other conditions, so that the item being sold does not have to be set to the group.

Ideally, the owner would be able to identify the relevant group during the set up for the discount to apply.

If the customer is not wearing the tag, they are charged full price.

If they are wearing the tag, they get a refund for the discount.

Just can't seem to find such a simple script yet that does this.

Am I missing something? Am I confused?  🙂

 

Posted (edited)

you might want to put a ad in Wanted if you want a custom script as is a number of ways to do this. One way is to get the person's group id indirectly and give them a cashback

for example the pcode basics of cashback

 

// global var
key mygroup_id = "... whichever..";

key transaction_id;

state_entry()
{
    // you give your script permission to debit money from your account
    llRequestPermissions(llGetOwner(), PERMISSION_DEBIT);
}

money(key id, integer amount)
{
   // here we have to get the group of the person indirectly
   // a way to do this is by getting the first object they are wearing
   // a caveat is that if they aren't wearing any objects but are wearing group tag then this will fail
   // in this caveat case you decide whether to give the cashback anyways

   list persons_attachments = llGetAttachedList(id);
   // get the group id of the 1st attachment
   key persons_group = llGetObjectDetails(llList2Key(persons_attachments, 0), OBJECT_GROUP);
   
   // when person is in my group give them a cashback
   if (persons_group == mygroup_id)
   {
       integer cashyback_payment = amount * 0.10;  // 10 percent cashback
       transaction_id = llTransferLindenDollars(id, cashback_payment);
   }
}

more info on doing debit payments here: https://wiki.secondlife.com/wiki/LlTransferLindenDollars

Edited by elleevelyn
code typo
  • Like 1
Posted

Thanks for the reply.

You wrote

 // here we have to get the group of the person indirectly
   // a way to do this is by getting the first object they are wearing
   

Is there no way of directly ascertaining the group that the avatar has activated at that moment?

Each time I have done this as a consumer the transaction has not failed, I was assuming this meant the script was correctly identifying my active group.

I appreciate your input 🙂

Space

Posted
3 hours ago, Space Zehetbauer said:

Is there no way of directly ascertaining the group that the avatar has activated at that moment?

Bizarrely, no. You can get the text in the tag they have on, but on order to know exactly what group they're in, they need to be wearing at least one non-HUD attachment.

Unless the group you're interested in happens to be the group the object is set to (not deeded, that's a very different thing) in which case llSameGroup() works well enough.

  • Like 1
Posted
7 minutes ago, Quistess Alpha said:
3 hours ago, Space Zehetbauer said:

Is there no way of directly ascertaining the group that the avatar has activated at that moment?

Bizarrely, no. You can get the text in the tag they have on, but on order to know exactly what group they're in, they need to be wearing at least one non-HUD attachment.

Unless the group you're interested in happens to be the group the object is set to (not deeded, that's a very different thing) in which case llSameGroup() works well enough.

Why can't llSameGroup() be used? So long as the user has the group "as the currently active group".  One of the use-cases at https://wiki.secondlife.com/wiki/LlSameGroup (see highlighted part below, assuming if the object is deeded to the group):

<snip>

The group of the uuid is...

If uuid is a prim (known to the region)...

and it is an attachment, the active group of the owner*

The group the prim is set-to

The group the prim is deeded-to

The group the prim is otherwise owned by

If no group information is set, the group-uuid used for this is NULL_KEY.

If uuid is an avatar (known to the region)...

The active group of the avatar.

If no group information is set, the group-uuid used for this is NULL_KEY.

Otherwise, treat uuid AS the group-uuid.

This means that instead of doing "Is the script's prim in the same group as uuid?", it becomes "Is the group-uuid of the script's prim equal to uuid?"

</snip>

I assume this is how most scripts work that require you to "set the group active" if you want a discount..

 

 

  • Like 1
Posted
18 minutes ago, Love Zhaoying said:

Why can't llSameGroup() be used?

Because the OP doesn't want to set the group of the object. (which is a strange constraint, it's pretty easy to do in the first tab of the build menu, has no limitation other than the needing to be in the group, and barely changes anything else about the object.)

Settogroup.png.f69bda9a0d3b62535bd8cdf629db756a.png(Do not check 'share' or 'deed')

  • Like 1
Posted
1 minute ago, Quistess Alpha said:
26 minutes ago, Love Zhaoying said:

Why can't llSameGroup() be used?

Because the OP doesn't want to set the group of the object. (which is a strange constraint, it's pretty easy to do in the first tab of the build menu, has no limitation other than the needing to be in the group, and barely changes anything else about the object.)

Settogroup.png.f69bda9a0d3b62535bd8cdf629db756a.png(Do not check

Well gee whiz, it would be an awfully easy solve for their requirements otherwise.

It's not like setting the object's group will cause other issues, if you setup your groups right. It won't, for example, cause the object to display text above it stating what group it is in (like Avatars who don't have the "don't show" option set).

  • Like 1
Posted (edited)
On 9/28/2024 at 9:44 PM, Space Zehetbauer said:

The store is on land owned by me, not by the group.

for llSameGroup to work the prim containing the script has to be deeded to (owned by) the group

in your case the vendor prim (owned by the group) has a different owner to the land owner (you)

the simplest current fix is to deed your land to your group

edit: this is not correct anymore. It works now when the prim is set to group

see Tessa below

edit more: I never tested this in the money event tho. I tested only in the touch event. llSameGroup(llDetectedKey(0))

 

a thing: OBJECT_GROUP returns NULL_KEY when an avatar uuid is passed to llGetObjectDetails. If it returned the avatar's active group id it would solve this issue. Has been requested but Linden haven't given to us yet - maybe oneday someday

Edited by elleevelyn
  • Like 2
Posted (edited)
21 minutes ago, Love Zhaoying said:

Well gee whiz, it would be an awfully easy solve for their requirements otherwise.

With the added benefit that it makes figuring out which group you need to be in to get the discount more obvious.

20 minutes ago, elleevelyn said:

for llSameGroup to work the prim containing the script has to be deeded to (owned by) the group

Untrue. It just needs to be ~set to the group, which is distinctly different than deeding.

ETA: In fact, deeding a vendor to a group is a bad idea. That will cause all payments handled by it to be done in the group's account, which settles (debit/credit depending) to group members with a specific group permission on Tuesdays*. It would be ~very important to ensure that only the right members of the group have the permission; you don't want to accidentally distribute the proceeds of the sales to all the members of the discount group.

* fun fact, if the L$ isn't evenly divisible by the number of members to distribute to, the remainder stays locked in the group's account. I'm pretty sure I have a group or two with 1L$ tied up in their vaults.

Edited by Quistess Alpha
  • Like 1
  • Thanks 2
Posted

Thanks for all the replies.

Let us talk about the "constraint"

This came up when I was searching for a script in MP.

I read the reviews of some of these scripts available for sale and many of the reviewers were making the same observation, i.e. they didn't want to set all of their objects to the group in order for the discount to work. And they were questioning as to why it wouldn't be possible for the script to allow them to input the name of the group, thus giving the script the group name and not needing to take it from the object.

When I read the reviews their idea appealed to me. Yes, why couldnt the script just ask me to input the group name once?

I am not a scripter and have virtually no knowledge of SL scripting so my questions and constraints might seem whacky to experts 🙂

Obviously the very simple solution for me would be to set the objects to my group, and I could do so as I don't have too many objects for sale yet. And it seems I might have to take this path.

I do appreciate the effort you are taking to see if there is a solution to the idea I put forward, and to the idea that others in the MP had put forward and it is interesting seeing how the system works.

 

 

 

  • Thanks 1
Posted
6 minutes ago, Space Zehetbauer said:

Thanks for all the replies.

Let us talk about the "constraint"

This came up when I was searching for a script in MP.

I read the reviews of some of these scripts available for sale and many of the reviewers were making the same observation, i.e. they didn't want to set all of their objects to the group in order for the discount to work. And they were questioning as to why it wouldn't be possible for the script to allow them to input the name of the group, thus giving the script the group name and not needing to take it from the object.

When I read the reviews their idea appealed to me. Yes, why couldnt the script just ask me to input the group name once?

I am not a scripter and have virtually no knowledge of SL scripting so my questions and constraints might seem whacky to experts 🙂

Obviously the very simple solution for me would be to set the objects to my group, and I could do so as I don't have too many objects for sale yet. And it seems I might have to take this path.

I do appreciate the effort you are taking to see if there is a solution to the idea I put forward, and to the idea that others in the MP had put forward and it is interesting seeing how the system works.

 

 

 

Well, now you know!!

  • Like 1
Posted

Ex: In a mall or other rental situation vendors must be set to the mall group, not your own sales group.

In this case you can however, set a linked prim in the vendor to your group.

Only the root prim has to be in the land group. But the script has to be in the prim with your group to utilize llSameGroup().

  • Like 1
You are about to reply to a thread that has been inactive for 70 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
×
×
  • Create New...