Issues with Code Iteration?

I posted this issue in the Base Building 1.3 discussion, but I wanted to ask here as well, because I'm starting to wonder about iteration in these scripts in general.

What I have done is taken an existing static control layout and make it dynamic; the original version is a page with 5 set-in-stone materials that can be used to build objects with, and they show whether the recipe requires them or not. What I have done is run a loop on the requirements of the recipe, and if the required number of the material in question is more than 0, I have it occupy two controls: one for the image, and one for the quantity.

Most of the recipes work just fine. The image changes, the text is appropriate for the quantity, and no extra materials are being shown.

The problem is that there are about 5 recipes in which the image and the quantity appear on different lines.

Image | text
Image |
Image | text

Note: the Image above is meant to be no image at all.

If you look at the code I posted in the other thread, there are no iterations between the activation of the controls. As for the positioning of them, the controls are actually statically positioned from within an hpp file, and I do nothing to change this.

I have looked over my loops and arrays several times, and I just can't see what would cause the problem. As far as I can tell, there is no pattern that might clue me in. There is no progression from working to not working, and the issue seems to be random.

I'm going to start looking at the namespace tonight when I begin with it, but in the meantime I was hoping maybe a second set of eyes might be able to help. At this point I am beginning to wonder if there is an inherent problem with controlling these items this way (which might explain why the original author didn't use the approach).

Thanks in advance for any help you may be able to offer.
Last edited:
New I was able to resolve this issue. It turns out that the quantity controls were not named in order of position like the images were. I switched the position of two of them and it is now working.