zwobit
05-12-2010, 11:43 AM
hi there,
I am trying to list the particle ids of a certain position in an array so I can kill them at a specified frame. But if I want to access the array it ends up in an infinity loop.
What am I doing wrong?
//runtime
int $currentFrame = frame;
vector $pos= particleShape1.position;
int $pi;
int $IdList[];
int $IdListRemove[];
int $count = 0;
int $go = 1;
//list ids
if($pos.x < locatorKill.translateX && $pos.x > locatorKill.translateX - 0.01 && $go == 1){
$pi = particleShape1.particleId;
$count = size($IdList);
if ($pi != $IdList[$count]){
$IdList[$count] = $pi;
}
}
// kill particles at frame 1100
if ($currentFrame == 1100 && $go == 1){
$IdListRemove = $IdList;
$go = 0;
for ($i = 0; $i < $size; $i++){
particle -e -at lifespanPP -id $IdListRemove[$i] -fv 0 particle1;
}
}
thank,
I am trying to list the particle ids of a certain position in an array so I can kill them at a specified frame. But if I want to access the array it ends up in an infinity loop.
What am I doing wrong?
//runtime
int $currentFrame = frame;
vector $pos= particleShape1.position;
int $pi;
int $IdList[];
int $IdListRemove[];
int $count = 0;
int $go = 1;
//list ids
if($pos.x < locatorKill.translateX && $pos.x > locatorKill.translateX - 0.01 && $go == 1){
$pi = particleShape1.particleId;
$count = size($IdList);
if ($pi != $IdList[$count]){
$IdList[$count] = $pi;
}
}
// kill particles at frame 1100
if ($currentFrame == 1100 && $go == 1){
$IdListRemove = $IdList;
$go = 0;
for ($i = 0; $i < $size; $i++){
particle -e -at lifespanPP -id $IdListRemove[$i] -fv 0 particle1;
}
}
thank,
