Hello everyone. I have following field.script
go.property("left_field" , hash("unknown"))
go.property("right_field" , hash("unknown"))
go.property("top_field" , hash("unknown"))
go.property("bottom_field", hash("unknown"))
and this script is attached to root gameobject in collection
then in another collection i have controller which spawn this fields and then assign neighbors
for x = 0, board_width - 1 do
pos.x = cell_size / 2 + cell_size * x
self.board[x] = {}
for y = 0, board_height -1 do
pos.y = cell_size / 2 + cell_size * y
local all_ids = collectionfactory.create("#field_factory", pos, null, {} )
self.board[x][y] = {all_ids = all_ids, field = all_ids[hash("/field")], field_url = msg.url(all_ids[hash("/field")])}
end
end
for x = 0, board_width - 1 do
for y = 0, board_height -1 do
go.set(self.board[x][y].field_url, hash("left_field"), get_field_at(self, x - 1, y))
go.set(self.board[x][y].field, hash("right_field"), get_field_at( self, x + 1, y))
go.set(self.board[x][y].field, hash("bottom_field"), get_field_at(self, x, y - 1))
go.set(self.board[x][y].field, hash("top_field"), get_field_at(self, x, y + 1))
end
end
and then i get an error when trying to assign value (go.set(…))
ERROR:SCRIPT: board/board.script:38: ‘[default:/collection0/field]’ does not have any property called ‘left_field’