Author Topic: Finding All Bricks With a Radius Search [Solved]  (Read 1902 times)

Code: [Select]
initContainerRadiusSearch(%startB,5,$TypeMasks::fxBrickObjectType);
%mats = containerSearchNext();
This only gives me the closest one.
« Last Edit: July 20, 2013, 06:24:28 AM by tommybricksetti »


http://forum.blockland.us/index.php?topic=224122.0
Great, now how do I make a variable for each brick I find in the radius? Like normally I would use
Code: [Select]
%obj.hasSavedMatCol=1;but in this case that'd make only the first brick work.

while (isObject(%obj = containerSearchNext()))
{
    %obj.hasSaedMatCol = 1;
}

Great, now how do I make a variable for each brick I find in the radius? Like normally I would use
Code: [Select]
%obj.hasSavedMatCol=1;but in this case that'd make only the first brick work.
"while(%object = containerSearchNext())
{
   //Do something with each %object here like putting them into an array or something.   
}"
could you not figure out what to do here
or did you not even bother to read
but thanks port

Figured out how to use
Code: [Select]
for()
{
}
and
Code: [Select]
while()
{
}
I wound up highlighting the %mats differently than I had originally planned to, and it looks a lot better.

"while(%object = containerSearchNext())
{
   //Do something with each %object here like putting them into an array or something.   
}"
could you not figure out what to do here
or did you not even bother to read
but thanks port
Haha, not sure what you're trying to say buddy, but I stopped using %obj.[blah]=1; to designate whether the brick was highlighted or not; I did this, again, because %obj would make the function only work for the first highlighted object. So I could have just used %mats instead of %obj, i.e. %mats.[blah]=1; but instead I just made it a temporary highlight; so the same function that highlights the brick schedules it to return to normal.