Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Question on this script

Echo Dragonfly
Surely You Jest
Join date: 22 Aug 2004
Posts: 325
05-07-2005 12:14
I am trying to set up a tp system on our group land, that uses this script to hide it when not in use. Thing is, when I set it up,and make it to share and deed to group, it still only will listen to my commands. So I tried making the object group owned first, then dropped in the script, thinking that was the problem, but then it won't work at all.
Is there a way to mod the script so any officer of the group can cloak and uncloak it?

default
{
state_entry()
{
key owner = llGetOwner();
llWhisper(0,"Cloaking ready";);
llListen(0,"",owner,"";);
}

listen( integer channel, string name, key id, string message )
{
if( message == "cloak" )
{
llSetStatus(STATUS_PHANTOM, TRUE);
llWhisper(0,"Cloaking";);
llSetAlpha(0,ALL_SIDES);
}
if( message == "uncloak" )
{
llSetStatus(STATUS_PHANTOM, FALSE);
llWhisper(0,"Uncloaking";);
llSetAlpha(1,ALL_SIDES);
}
}
}
_____________________
Creativity represents a miraculous coming together of the uninhibited energy of the child with its apparent opposite and enemy, the sense of order imposed on the disciplined adult intelligence.
Norman Podhoretz
......................
If quizzes are quizzical, what are tests? :eek:
............................
Do illiterate people get the full effect of Alphabet Soup? :rolleyes:
Jillian Callahan
Rotary-winged Neko Girl
Join date: 24 Jun 2004
Posts: 3,766
05-07-2005 12:26
Change the listen to listen to everything on that channel: (And you want this to be off zero)

llListen(303, "", NULL_KEY, "";);

And you can do a couple of things with that:

For any group member wearing thier group tag (or any object set to the group):
CODE
listen(integer chan, string name, key id, string msg)
{
if ( llSameGroup(id) )
{
//stuff
}
}
or you can compare the returned name to a list of authorised users:
CODE
list users = ["name one", "name two"]; // this would be a global
listen(integer chan, string name, key id, string msg)
{
integer index = llListFindList(users, [name]);
if ( index >= 0 )
{
//stuff
}
}
There isn't a way to easily limit the use to group officers that I'm aware of.
_____________________
Echo Dragonfly
Surely You Jest
Join date: 22 Aug 2004
Posts: 325
05-07-2005 12:36
Thx Jillian, I do have the scripts on the objects set to listen on another channel rather than the public one:) I'll give this another go round then , THX again for the response :)
_____________________
Creativity represents a miraculous coming together of the uninhibited energy of the child with its apparent opposite and enemy, the sense of order imposed on the disciplined adult intelligence.
Norman Podhoretz
......................
If quizzes are quizzical, what are tests? :eek:
............................
Do illiterate people get the full effect of Alphabet Soup? :rolleyes:
Jillian Callahan
Rotary-winged Neko Girl
Join date: 24 Jun 2004
Posts: 3,766
05-07-2005 13:11
You're welcome. And it occurs to me the second method isn't such a great idea... it doesn't differentiate between an agent and an object. Better to do it by key instead of name.
_____________________