Blueprint For Loops and a Programmers Mind

I have been working on an inventory system for a game in blueprint recently and noticing habits and the mindset I have as a programmer is effecting the way I do certain things. Most notably is For loops. Normally how I approach a for loop for indexing anything is



for (int i = 0; i < inventoryCount; i++) {
    // indexing my items in the menu such as
    menuItemLogic(inventory*);
}



Programmers, for the most part, rely on the condition statement in the middle to break on inventoryCount - 1 due to how things are referenced in an array.

The top part here is how I started using the blueprint. I expected it to act in the above mentioned way. I needed it to work this way because the variable I defined is suppose to be dynamic in where I can change the size of the array and get more slots in the menu as I need it

The bottom part is what I have to do in order to index my menu items. Say I have 8 menu items and I do not subtract, when I draw it, it draws 9 menu items because I need to use the indexes to calculate where to draw it on the screen. Solution to this being to make a function that does this for me.

4qiqW8P.png

With this being said one thing I would like to see is a for loop with an integrated condition in it. So I can iterate through a number and use the boolean operations without having to add extra nodes on top of it. My ideal for loop, in my opinion, should be somewhat like this.

4qiqW8P.png

Also as an afterthought, maybe having control of how the iteration works such as saying we want the condition to rely on a backwards counter such as subtraction or we need the loop to rely on an increment/decrement on something more than just one (i += 4 or i -= 4) could be there. Maybe this as an alternate or “advanced” for loop.

Also want to mention, since this is a feedback forum, I am enjoying the current UDK. It has been a pleasant experience using it, so much more than the UE3.

You can double click at ForLoop and you will see that “ForLoop” is a simple macro, not some hidden-in-c+±magic-command
You easily can make a copy of this forloop and modify it however you want, add input, output, on break output and etc

That is what I am doing for right now. My suggestion was that a more advanced for loop be a part of blueprint as default. Its something that I felt that would be useful not just for me but for everybody.