%position = %this.getPosition();
%radius = (%this.getDataBlock().brickSizeZ / 5) + (1 / 10);
InitContainerRadiusSearch(%position,%radius,$TypeMasks::FxBrickObjectType);
%found = false;
while((%targetObject = containerSearchNext()) !$= 0 && !%found)
{
%offset = ((%this.getDataBlock().brickSizeZ / 5) + (%targetObject.getDataBlock().brickSizeZ / 5)) / 2;
%posX = getWord(%this.position, 0);
%posY = getWord(%this.position, 1);
%posZ = getWord(%this.position, 2);
%pos = %posX SPC %posY SPC %posZ - %offset;
if(%targetObject.getPosition() $= %pos)
{
echo("found");
%found = true;
}
}
This is what I ended up doing. I know it means that the brick has to be centered directly underneath it but that works for what I want to do. If anyone has suggestions for making this more elegant please let me know.
One more quick question, how come with %radius = (%this.getDataBlock().brickSizeZ / 5) + (1 / 10); it throws an error if I try to use .1 instead of 1/10?