Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Odd bug with llParticles...

Saijanai Kuhn
Registered User
Join date: 16 May 2007
Posts: 130
05-23-2007 21:41
I'm running a dual-G5 2GHz Mac with 1.5 GB of RAM, and several free GB of diskspace.


I create a very simple script. It just moves an object in a circle about head-height of the avatar that touches it, directly above where it was created. Add a new instance a few meters over and it draws a circle at the same height but in a different spot--usually, but not always.

However, if I add particle emission code, almost every new instance follows the same circle.


The code I add to reasonably definitely cause the problem goes within the loop to move the object. The offending code:

llParticleSystem([PSYS_PART_FLAGS,PSYS_PART_EMISSIVE_MASK,
PSYS_PART_START_COLOR, <0,1,1>,
PSYS_PART_START_SCALE,<.3,.3,.3>,
PSYS_SRC_PATTERN, PSYS_SRC_PATTERN_DROP] );

The usually non-buggy portion:

integer i;

integer alreadyDone = FALSE;

float radDeg = 3.14159;

vector currPos;
vector avPos;
vector avSize;
vector tempPos;
integer degrees = 20;

default
{
state_entry()
{
llSay(0, "Hello, Avatar!";);


}

touch_start(integer total_number)
{
llSay(0, "Touched.";);
if(!alreadyDone)
{
radDeg = degrees * radDeg/180;
currPos = llGetPos();
avPos = llDetectedPos(0);
avSize = llGetAgentSize(llDetectedKey(0));
alreadyDone = TRUE;

currPos.z = avPos.z + avSize.z;
llSetPos(currPos);
tempPos = currPos;
}

for(i=0; i<degrees - 1; i++)
{
tempPos.y = currPos.y +llSin(i*radDeg); tempPos.z = currPos.z+llCos(i*radDeg);
llSetPos(tempPos);

//offending code goes here

}




}
}
Saijanai Kuhn
Registered User
Join date: 16 May 2007
Posts: 130
05-23-2007 22:18
From: }[/QUOTE


Someone poianted out that I was editing without adding

on_rez(integer iParam) { llResetScript(); }

to my code. Once I did that, it seemed to correct the problem.
Saijanai Kuhn
Registered User
Join date: 16 May 2007
Posts: 130
05-23-2007 22:37
From: Saijanai Kuhn
From: }[/QUOTE


Someone poianted out that I was editing without adding

on_rez(integer iParam) { llResetScript(); }

to my code. Once I did that, it seemed to correct the problem.



Talarus Luan. Thanks dude. ;-)