Creating a series of objects; how are you supposed to do it?

Okay, so, I have this thing in one of my scripted functions where I want to set up a series of objects of the same class in an array, and give each of them different properties. Thing is, whenever I try to do it with a loop, even a while loop seemingly, the objects always end up undefined, which causes problems. So, what exactly am I doing wrong here?

EDIT: Apparently, it helps if you set the variable you're using to loop properly. Sorry! Can someone close this?

Original thread: https://forums.rpgmakerweb.com/threads/creating-a-series-of-objects-how-are-you-supposed-to-do-it.137282/