Tip Baker
Registered User
Join date: 12 Nov 2005
Posts: 100
|
11-16-2005 09:04
Evening all,
I can tell in a script if object A has the same group as B, but cant figure out how to get the actual name of object A's group.
How do I do: string this_objects_group_name = ???
I suspect I've missed something obvious, so if someone could point me in the right direction.
Thanks in advance.
|
Gaz Hornpipe
Registered User
Join date: 29 Sep 2005
Posts: 36
|
11-16-2005 10:58
Unfortunately there is just no way to do this at the present time. This is one of those scripting features that keeps being requested but never gets implemented. There is llSameGroup(), which you already know about... The group functions are really quite lacking making it considerably obvious how much of an afterthought groups really were in the overall design.
|
Cid Jacobs
Theoretical Meteorologist
Join date: 18 Jul 2004
Posts: 4,304
|
11-16-2005 11:55
You can not presently use the group's string name, as stated above. But you can use the groups key. key GroupKey = "0f1641a1-6827-8480-0737-e2aaa2636236"; string GroupMemberName = "Live Helper"; string GroupName = "Live Help";
default { touch_start(integer total_number) { if(llSameGroup(llGetKey()) == llSameGroup(GroupKey)) { if(llSameGroup(llDetectedKey(0))) { llSay(0,"Hello, " + GroupMemberName + " " + llKey2Name(llDetectedKey(0))); } else { llSay(0,"You must be a member of " + GroupName); } } else { llSay(0,"I am not set to the correct group, " + GroupName); } } }
This can be modded for sensors or whatever your purposes may be. Also there is currently a public Group2Key database in the works. So keep your eyes out. Good luck. 
|
Tip Baker
Registered User
Join date: 12 Nov 2005
Posts: 100
|
11-16-2005 14:06
Thanks for the replies guys.
Apart from the public database, how do you find the Key of a group?
|
Cid Jacobs
Theoretical Meteorologist
Join date: 18 Jul 2004
Posts: 4,304
|
11-16-2005 15:32
From: Tip Baker Thanks for the replies guys.
Apart from the public database, how do you find the Key of a group? There are two ways to go about it. 1. You can deed an object to the group with a script inside it that uses llGetOwner to tell you the owner, the group, of the object. 2. You can use llGetLandOwnerAt to get the groups key if you are over land that the group owns.
|