Im making this incremental game which i want to make infinite buttons for, and for that im using a for loop to make a lot of buttons at once, but the name i set for the button (which matters in my code for determining the price and stuff) turns all wierd, for example i give it a name of '1' because its the first button, godot produces me '@[email protected]' and that screws up all my code.
Can anyone help please?
Instancing code:
for item in range(len(copy_dict['default_costs']['Multiplier'])):
var new_button = multi_button_scene.instance()
new_button.get_node('Give').text = "+" + get_notation(copy_dict['default_costs']['Multiplier'][str(item + 1)][1]) + " Multiplier"
new_button.get_node('Cost').text = "$" + get_notation(copy_dict['default_costs']['Multiplier'][str(item + 1)][1])
new_button.name = str(item + 1)
$Buttons/Multi/VBoxContainer.add_child(new_button)
Here is the dictionary that is uses (i dont know if you need it):
var default_costs = {
'Multiplier': {
'1': [Big.new(0.1, 0), Big.new(10, 0), Big.new(0, 0)],
'2': [Big.new(0.3, 0), Big.new(60, 0), Big.new(0, 0)],
'3': [Big.new(0.7, 0), Big.new(550, 0), Big.new(0, 0)],
'4': [Big.new(1.5, 0), Big.new(1750, 0), Big.new(0, 0)],
'5': [Big.new(2.75, 0), Big.new(5500, 0), Big.new(0, 0)]
}