Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

titler problem : stuck with channels...

Keiko Doji
Registered User
Join date: 30 Jul 2006
Posts: 23
01-10-2010 20:51
hi all,

i recently attempted to script a flip titler for myself and a friend to use in an RP enviroment. I got the flip titler to work fine for me but I've run into a problem. After giving my friend a copy, whenever I change my title via the channel of /20 the same change occurs on my friends titler.

the question im asking is how do you use channels on an object but keep them private so they don't change other scripts in this case, the titler i scripted.

thanks in advance for any help you all can give

byeeee
SuezanneC Baskerville
Forums Rock!
Join date: 22 Dec 2003
Posts: 14,229
01-10-2010 20:58
Could you make the llListen command only listen for messages from the owner?

Something vaguely like:
llListen( 20, "", llGetOwner(), "" );
_____________________
-

So long to these forums, the vBulletin forums that used to be at forums.secondlife.com. I will miss them.

I can be found on the web by searching for "SuezanneC Baskerville", or go to

http://www.google.com/profiles/suezanne

-

http://lindenlab.tribe.net/ created on 11/19/03.

Members: Ben, Catherine, Colin, Cory, Dan, Doug, Jim, Philip, Phoenix, Richard,
Robin, and Ryan

-
Keiko Doji
Registered User
Join date: 30 Jul 2006
Posts: 23
01-10-2010 21:00
I'll give that a try, thanks for the reply ^^
Johan Laurasia
Fully Rezzed
Join date: 31 Oct 2006
Posts: 1,394
01-10-2010 21:10
also, toss an llResetScript() into an on_rez() event so that when you give a copy to your friend, the script resets. Otherwise, the script will still think you're the owner (and thus respond to your chats) despite your friend now owning the object.
Keiko Doji
Registered User
Join date: 30 Jul 2006
Posts: 23
01-11-2010 16:40
okie the issue now is that when the small tagger i added to the script, so that others can input a tag line on another new line isnt working

if one flipper sends a message on channel 20 to change the tag string on the target flipper nothing happens
Innula Zenovka
Registered User
Join date: 20 Jun 2007
Posts: 1,825
01-11-2010 17:32
That's cos you've just told it to listen only to the owner, because you didn't want to change your friend's title by accident. Scripts need telling when they're supposed to be listening only to you and when they're supposed to be listening to anyone.

There's several ways to do it. Try something like this, which uses your initials to identify you if necessary. You, and only you, can change your title (and not anyone else's) just by saying /20 new title. Everyone else has to say, /20 kd new title (or /20KDnew title -- it's not case sensitive and it'll ignore spaces between your initials and the title).
CODE
string prefix;
string title;

default {

state_entry() {
string owner_name = llKey2Name(llGetOwner());
string first_name = llList2String(llParseString2List(owner_name,[" "],[]),0);
string last_name = llList2String(llParseString2List(owner_name,[" "],[]),1);
prefix = llToLower(llGetSubString(first_name,0,0))+llToLower(llGetSubString(last_name,0,0);
llListen(20,"","","");

}

listen(integer channel, string name, key id, string msg) {

msg = llStringTrim(msg,STRING_TRIM);
if(id==llGetOwner()||llToLower(llGetSubString(msg,0,1))==prefix){
if(id==llGetOwner()){
title = msg;
}
else if (llToLower(llGetSubString(msg,0,1))==prefix){
title = llStringTrim(llDeleteSubString(msg,0,1),STRING_TRIM);
}
llSetText(title,<1.0,0.0,0.0>, 1.0);
}

}

on_rez(integer start_param) {
llResetScript();
}

}


(quote me if necessary to get it to indent properly, and ignore the php tags if they display for you). So you say /20 new title to change your title and /20 iz new title to change mine. And I say /20 new title to to change mine and /20kd new title to change yours.

I've not tested it but I think it should be OK.
Kara Spengler
Pink Cat
Join date: 11 Jun 2007
Posts: 1,227
01-11-2010 17:37
From: Keiko Doji
the question im asking is how do you use channels on an object but keep them private so they don't change other scripts in this case, the titler i scripted.


Use a random function or derive a number from the key. I scripted one of those titlers that prompts anyone around it (except for the owner) to say a new title on a certain channel, then to keep things even more variable I change the channel number for next time.

A bunch of kid avatars with that titler all using it and no conflicts. IM me inworld if you want the code.
_____________________
Those Lindening Lindens!

'O predictable experience,
O predictable experience,
Never shalt we define thee.
Our users think that means no lagging,
But we say they want no shagging.
O predictable experience,
O predictable experience,
We love you null expression.'