Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Unwanted particles

Xylo Quisling
Registered User
Join date: 1 Feb 2007
Posts: 146
04-22-2007 23:22
Hello knowledgeable people,

I've just made a script which regularly changes the colours on the faces of a few boxes. Works fine - but around my boxes a big circle of streaming particles shows up; entirely uninvited! Anyone know what this is, and how to remove it?

Thanks,
Xylo

(the particles are round and white)
Osgeld Barmy
Registered User
Join date: 22 Mar 2005
Posts: 3,336
04-22-2007 23:38
does the box talk?
Xylo Quisling
Registered User
Join date: 1 Feb 2007
Posts: 146
04-22-2007 23:48
Ah, is that it? Yes, it does talk. Are there particles streaming every time an object talks?
Winter Ventura
Eclectic Randomness
Join date: 18 Jul 2006
Posts: 2,579
04-23-2007 00:14
yes, this is a "Feature" to let you know "which" box is talking.

to disable the particles, make it stop talking. if you use llOwnerSay, only the owner will see it talk, and therefore, only the owner will see the "swirly".

you can use other communication methods if the swirlies concern you. llSetText will make floating text (which I personally loathe). Obviously you can script it to set certain colours to communcate functional states. Also, you could create a dedicated HUD item.. which would listen on a given channel, and relay anything said on that channel, to channel 0. Then the object(s) you build in world could speak on that channel.

the upshot of a HUD attachment "translator/repeater"... is that HUDs cannot generate particles.

CODE
default
{
state_entry()
{
llListen(999, "", NULL_KEY, "");
}

listen( integer channel, string name, key id, string message )
{
if(llGetOwnerKey(id) != llGetOwner()) return;
// limits "repeated" text to that spoken by objects
// owned by the HUD owner. Comment this out if
// you want to hear other people's objects also.

// remove the double slash before ONE of the 4 lines below.

//llOwnerSay(message); // private (HUD owner only)
//llWhisper(0, message); // 10m range (open chat)
llSay(0, message); // 30m range (open chat)
//llShout(0, message); // 100m range (open chat)
}
}


Place this script in a prim, and attach it to your HUD. Then in the future, make your objects "speak" on channel 999. Now, when you're in range, the object will be hearable, and otherwise it will broadcast it's information uselessly into the ether.

Admittedly, this isn't the tidiest way to get communications from a script, but if you need it to give you verbal feedback, and cannot stomach the swirlies.. this will get you through.
_____________________

● Inworld Store: http://slurl.eclectic-randomness.com
● Website: http://www.eclectic-randomness.com
● Twitter: @WinterVentura
Xylo Quisling
Registered User
Join date: 1 Feb 2007
Posts: 146
04-23-2007 20:14
Thank you Osgeld, and thank you, Winter. All your wise words shall be taken into consideration, and gratefully used.
Xylo Quisling
Registered User
Join date: 1 Feb 2007
Posts: 146
04-24-2007 23:11
To Winter:

You and I are as one, on the issue of floating texts. I not only loathe them, like you do, but despise them, spit on them, deeply resent them, and wish they were dead.

Alas - now I have one! It's in a visitor tracker script, and short though the script is, I just cannot ferret it out. It's only the tiny word ON, but it hovers self-righteously and mockingly above my floor, making my life a misery. Sometimes, when I've had too much to drink (I never used to drink before IT appeared), I believe it's laughing at me. I want it back in the dark underworld it came from. But I cannot fight it anymore, Winter. I am worn out. Can you find it, in here?

CODE

// Global variables
list visitor_list;
float range = 10.0; // in meters
float rate = 1.0; // in seconds


// Functions
integer isNameOnList( string name )
{
integer len = llGetListLength( visitor_list );
integer i;
for( i = 0; i < len; i++ )
{
if( llList2String(visitor_list, i) == name )
{
return TRUE;
}
}
return FALSE;
}

// States
default
{
state_entry()
{
llSay(0, "Visitor List Maker started...");
llSay(0, "The owner can say 'help' for instructions.");
llSensorRepeat( "", "", AGENT, range, TWO_PI, rate );
llListen(0, "", llGetOwner(), "");
}


sensor( integer number_detected )
{
integer i;
for( i = 0; i < number_detected; i++ )
{
if( llDetectedKey( i ) != llGetOwner() )
{
string detected_name = llDetectedName( i );
if( isNameOnList( detected_name ) == FALSE )
{
visitor_list += detected_name;
}
}
}
}

listen( integer channel, string name, key id, string message )
{
if( id != llGetOwner() )
{
return;
}

if( message == "help" )
{
llSay( 0, "This object records the names of everyone who" );
llSay( 0, "comes within "+ (string)range + " meters." );
llSay( 0, "Commands the owner can say:" );
llSay( 0, "'help' - Shows these instructions." );
llSay( 0, "'say list' - Says the names of all visitors on the list.");
llSay( 0, "'reset list' - Removes all the names from the list." );
}
else
if( message == "say list" )
{
llSay( 0, "Visitor List:" );
integer len = llGetListLength( visitor_list );
integer i;
for( i = 0; i < len; i++ )
{
llSay( 0, llList2String(visitor_list, i) );
}
llSay( 0, "Total = " + (string)len );
}
else
if( message == "reset list" )
{
visitor_list = llDeleteSubList(visitor_list, 0, llGetListLength(visitor_list));
llSay( 0, "Done resetting.");
}
}
}

Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
04-24-2007 23:49
You're not going made, The script posted does not use any llSitText.
Remember that Sit text is a property of the prim not the script, i.e. you can set it then remove the script and it will still be shown.

The visitor script you have posted looks like one of my incredibly early attempts, written back before I had read enough of the forums and wikki to know better. It really is awful.
Change the channel to something other than zero and preferably make it touch activated. The isNameOnList can be repalced with the following:

CODE

integer isNameOnList( string name )
{
integer index= llListFindList( visitor_list , [ name ] );
return (index >= 0);
}
Osgeld Barmy
Registered User
Join date: 22 Mar 2005
Posts: 3,336
04-24-2007 23:57
all of this
CODE

integer isNameOnList( string name )
{
integer len = llGetListLength( visitor_list );
integer i;
for( i = 0; i < len; i++ )
{
if( llList2String(visitor_list, i) == name )
{
return TRUE;
}
}
return FALSE;
}


could be replaced with this
CODE

if (llListFindList(visitor_list, [name]) == -1) // not on list
else
Xylo Quisling
Registered User
Join date: 1 Feb 2007
Posts: 146
04-25-2007 03:20
Will try to do that. Bought the script for 2 Lindens on Exchange.
Xylo Quisling
Registered User
Join date: 1 Feb 2007
Posts: 146
04-25-2007 03:25
Did that. To the scripting ingenue (what a lovely word) it doesn't make any difference. And the hideous ON is still there. Thing is - it isn't even in the same prim that the author provided. I put the script in a different prim. We have a defiance of the Laws of Nature, here.
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
04-25-2007 03:26
From: Xylo Quisling
Will try to do that. Bought the script for 2 Lindens on Exchange.


it was originally posted it here on the forums for free.
Xylo Quisling
Registered User
Join date: 1 Feb 2007
Posts: 146
04-25-2007 03:28
Oh, and as I notice only now, with your adjustment in it, the script gives a syntax error.
Xylo Quisling
Registered User
Join date: 1 Feb 2007
Posts: 146
04-25-2007 03:30
Although it's a different prim, putting the Scrubber in it has solved the problem.
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
04-25-2007 03:33
From: Xylo Quisling
Oh, and as I notice only now, with your adjustment in it, the script gives a syntax error.


Hmm? where?
Xylo Quisling
Registered User
Join date: 1 Feb 2007
Posts: 146
04-25-2007 03:34
Drat. Just logged off. Think it said line 7 or 8.
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
04-25-2007 03:49
From: Xylo Quisling
Drat. Just logged off. Think it said line 7 or 8.


Post the offending script and will take a look but I know the amended function works.
Xylo Quisling
Registered User
Join date: 1 Feb 2007
Posts: 146
04-25-2007 17:31
I believe you entirely. It could well be due to a pasting mistake of mine, though I tried not to make any. Here we go:

CODE

// Global variables
list visitor_list;
float range = 10.0; // in meters
float rate = 1.0; // in seconds


// Functions
if (llListFindList(visitor_list, [name]) == -1) // not on list
else


// States
default
{
state_entry()
{
llSay(0, "Visitor List Maker started...");
llSay(0, "The owner can say 'help' for instructions.");
llSensorRepeat( "", "", AGENT, range, TWO_PI, rate );
llListen(0, "", llGetOwner(), "");
}


sensor( integer number_detected )
{
integer i;
for( i = 0; i < number_detected; i++ )
{
if( llDetectedKey( i ) != llGetOwner() )
{
string detected_name = llDetectedName( i );
if( isNameOnList( detected_name ) == FALSE )
{
visitor_list += detected_name;
}
}
}
}

listen( integer channel, string name, key id, string message )
{
if( id != llGetOwner() )
{
return;
}

if( message == "help" )
{
llSay( 0, "This object records the names of everyone who" );
llSay( 0, "comes within "+ (string)range + " meters." );
llSay( 0, "Commands the owner can say:" );
llSay( 0, "'help' - Shows these instructions." );
llSay( 0, "'say list' - Says the names of all visitors on the list.");
llSay( 0, "'reset list' - Removes all the names from the list." );
}
else
if( message == "say list" )
{
llSay( 0, "Visitor List:" );
integer len = llGetListLength( visitor_list );
integer i;
for( i = 0; i < len; i++ )
{
llSay( 0, llList2String(visitor_list, i) );
}
llSay( 0, "Total = " + (string)len );
}
else
if( message == "reset list" )
{
visitor_list = llDeleteSubList(visitor_list, 0, llGetListLength(visitor_list));
llSay( 0, "Done resetting.");
}
}
}

Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
04-26-2007 01:06
LOL, yes its down to what you have done.
You have pasted Osgeld's suggestion in place of the function itself.
What Osgeld meant was to replace the line where you called IsNameOnList with the code he gave. i.e.

CODE

sensor( integer number_detected )
{
integer i;
for( i = 0; i < number_detected; i++ )
{
if( llDetectedKey( i ) != llGetOwner() )
{
string detected_name = llDetectedName( i );
if (llListFindList(visitor_list, [name]) == -1)
{
visitor_list += detected_name;
}
}
}
}
Osgeld Barmy
Registered User
Join date: 22 Mar 2005
Posts: 3,336
04-26-2007 01:13
quicky rewrite

uses owner say, you will still see the particles but noone else will

uses owner say, you will see the output but noone else will

uses llDialog i HATE command line interfaces when a pushbutton will do

uses random negitive chat channels

shuts off listener after 30 seconds, or after a command is issued, whichever first

uses do-while loops instead of for loops = faster

has a memory meter, now i just choose 512 bytes out of thin air, dunno if its to little or too much, some testing should be done there, but half a kb seems safe

still uses a sensor .. me no likey sensors, in my experiance you can set a box out with "touch here for a free gift" written on it and get a more accurate picture of your visitors, + they get a thingie ...
but whatever

all that and its 433 bytes smaller, altho since i ploped in a 512 byte safety, thats a moot point
CODE

//<----------------------------------------------------------------------------->//
//<----------------------------- VISITOR LIST MAKER ---------------------------->//
//<----------------------------------------------------------------------------->//

// options
float sensor_range = 10.0; // in meters
float sensor_rate = 5.0; // in seconds

// varibles
list visitors;
key owner;
integer listener;

// script
default
{
on_rez(integer rez) {llResetScript();}

state_entry()
{
owner = llGetOwner();

llOwnerSay("Visitor List Maker started");
llSensorRepeat("", "", AGENT, sensor_range, TWO_PI, sensor_rate);
}

sensor( integer number_detected )
{
integer x;

if (llGetFreeMemory() > 512)
{
do
{
if (llDetectedKey(x) != owner)
{
string detected_name = llDetectedName(x);

if (llListFindList(visitors, [detected_name]) != -1)
{
visitors += detected_name;
}
}
}

while (++x < number_detected);
}

else llOwnerSay("visitor list is out of memory");
}

touch_start(integer total_number)
{
if (llDetectedKey(0) == owner)
{
integer channel = llRound(llFrand(-10000.0));
listener = llListen(channel,"",owner,"");

llDialog(owner,"please choose",["Show List", "Clear List"], channel);
llSetTimerEvent(30);
}
}

listen(integer channel, string name, key id, string msg)
{
if (msg == "Show List")
{
integer x;

do {llOwnerSay(llList2String(visitors, x));}
while (++x < llGetListLength(visitors));
}

else
{
visitors = [];
llOwnerSay("list cleared");
}

llListenRemove(listener);
llSetTimerEvent(0);
}

timer()
{
llListenRemove(listener);
llSetTimerEvent(0);
}
}


my scripts always get abit garbled in the forums, but ive copied and pasted from this post to a inworld script window and it formats back out just fine

edit PS llGetFreeMemory is not exactly accurate, nor totally reliable altho ive had good luck with it, it can give "false" readings which is more like historic readings, its ok but its the best we got atm
Xylo Quisling
Registered User
Join date: 1 Feb 2007
Posts: 146
04-26-2007 14:30
Hmn I don't get it. You must understand, I speak LSL as much as I speak Bantu. And that isn't very much. I put your script in, instead - and now it doesn't respond anymore to my commands. How does one get the visitor list, with your script?
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
04-26-2007 15:17
From: Xylo Quisling
Hmn I don't get it. You must understand, I speak LSL as much as I speak Bantu. And that isn't very much. I put your script in, instead - and now it doesn't respond anymore to my commands. How does one get the visitor list, with your script?



Which 'your' are you talking about? Newgy (Me) or Osgeld?
Osgeld stated in his post he has added a dialog, rather than chat commands, and made the script touch activated
Xylo Quisling
Registered User
Join date: 1 Feb 2007
Posts: 146
04-27-2007 03:34
By god you are right.