I struggle with instances. I've written below what kind of feature I am trying to implement, but in short - I don't know how to call for variables of an instance and modify an instance by its properity outside it.
Please, write me a short code that would call a value from a specific instance, so I can use it in a code. I understand little from the manual in this topic and it is very unintuitive for me, so please explain it as simple as possible.
Thank you a lot for any help.
I've made a grid, in which objects can be placed. Each grid element has a separate id (whole numbers between 1 and 16, depending on the grid size).
To not confuse myself, I avoid using built ".id" thing for now.
Each grid element should be free=false when an element is place in it, which is not an issue for me.
I need to check which first grid element (with the loswest ID) is free to take an element in order to send it there, if the player tries to put a placable object outside the grid.
I got the objects numbered correctly in order as I wanted, but how do I call and modify their properties separatley?
My plan is to make function returning coordinates of an object that is free (empty) with the lowest ID.
I'd do that with a loop, checking for each grid object if it is empty.
Please, write me a short code that would call a value from a specific instance, so I can use it in a code. I understand little from the manual in this topic and it is very unintuitive for me, so please explain it as simple as possible.
Thank you a lot for any help.
I've made a grid, in which objects can be placed. Each grid element has a separate id (whole numbers between 1 and 16, depending on the grid size).
To not confuse myself, I avoid using built ".id" thing for now.
Each grid element should be free=false when an element is place in it, which is not an issue for me.
I need to check which first grid element (with the loswest ID) is free to take an element in order to send it there, if the player tries to put a placable object outside the grid.
I got the objects numbered correctly in order as I wanted, but how do I call and modify their properties separatley?
My plan is to make function returning coordinates of an object that is free (empty) with the lowest ID.
I'd do that with a loop, checking for each grid object if it is empty.