Following this tutorial (which is made in Godot 3.1, if it matters):
If you skip ahead to somewhere between 16:00 - 19:00, it's the LootSelector function. You can see his and this is mine:
func LootSelector():
for i in range(1, loot_count + 1):
randomize()
var loot_selector = randi() % 100 + 1
var counter = 1
while loot_selector >= 0:
if loot_selector <= InventoryImport.loot_data[location]["Item" + str(counter) + "Chance"]: ### This is where it gets mad ###
var loot = []
loot.append(InventoryImport.loot_data[location]["Item" + str(counter) + "Chance"])
randomize()
loot.append((int(rand_range(float(InventoryImport.loot_data[location]["Item" + str(counter) + "MinQ"]), float(InventoryImport.loot_data[location]["Item" + str(counter) + "MaxQ"])))))
loot_dic[loot_dic.size() + 1] = loot
break
else:
loot_selector = loot_selector - InventoryImport.loot_data[location]["Item" + str(counter) + "Chance"]
counter = counter + 1
print(loot_dic)
I believe I copied it perfectly (with a few minor adjustments), but it still thinks I'm comparing apples and oranges. I tried getting rid of str(), and it gets mad. I tried using int() and it gets mad. I tried using float() and it gets really mad.
I feel like this is going to be a stupid easy thing I overlooked. Insight would be much appreciated because this is a long tutorial series and I don't want to trip and fall this early on.