I just found what I think it’s a bug and I would like someone to corroborate this.
I have a custom resource with a variable:
export (Array) var test0 = [null]
export (Array) var test1
var test2 = [null]
export (String) var name = ""
Then I have a node with the following function:
func set_pages():
var page1 = c_resource.new()
page1.test0.resize(13)
page1.name = str("Chest_Inventory_Tab",inv_pages.size())
inv_pages.append(page1)
var page2 = c_resource.new()
page2.test0.resize(4)
page2.name = str("Chest_Inventory_Tab",inv_pages.size())
inv_pages.append(page2)
This function generates an array with 2 resources I would expect the first Resource in inv_pages
to have an array with a size of 13 and the second resource inside inv_pages
to have an array with size 4.
The 2 new resources have their variable name
properly set but the array variable test0
has a size of 4 on every resource.
Using test1
, which doesn’t have a preset value, doesn’t have this problem and the same goes for test2
which has a value but it’s not an export variable.