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
}
}
}