Code: Select all
for i = 1, game.entityprototypes["item-name"].filter_count do
My experience with C++ tells me that the table entityprototypes is storing the abstract class of entityprototype, and smart inserter, being a child of that class has more variables. I was hoping that lua would simply be smart enough to typecast the variable for me, but it doesn't. I've looked high and low online for a way to typecast in lua and everyone says it's not possible and not needed. However, I realize that lua is in fact NOT C++, and data is stored differently. So this is me asking a simple question of how to access a child's variables when dealing with the abstracted parent's class in lua.