You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
2D infinite map multiplayer game where each tile has some data to represent
Describe the problem or limitation you are having in your project
I have a TileMapLayer where tiles are scene collections
each scene is attatched to a script that change it's state according to some condition
I need to pass data from the TileMapLayer to the tile scene instance when I found no way to directly interact with that layer unless using get_child()
and to the point : I called this on the child node
func_ready():
print('[Tile] parent is : ', get_parent().name)
and this on the TileMapLayer
func_ready():
print('[TileMapLayer] children ', get_children())
and get this
[TileMapLayer] children []
(251) [Tile] parent is : parent_layer
the issue is clear : the TileMapLayer is fully rendered and ready, then the instances is added in places
off course this behavior should stay the same, otherwise : the _ready func of TileMapLayer wont be called
the issue now is that we can access parent from children but not the opposite when working with procedual data and tiles that are set and unset
Describe the feature / enhancement and how it helps to overcome the problem or limitation
get_cell() and get_cell_instance() are not the oposite of setter 'set_cell' as they should returnt the node of the child if the cell is not empty, and not the propereties of the TileMapLayer itself
of course you could change names to what you want
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
should be given a Victor2i representing coordinates of cell
if cell is set (either manually or via a func like set_cell( ... ) with scene collection instance : this func returns that instance ( even not ready instances if they was set )
if not set : this func returns null
If this enhancement will not be used often, can it be worked around with a few lines of script?
Not few lines but it has 2 other complex alternatives
complex global signal system ( very much code to care about )
to handle data via each instance : this impact performance a lot as each instance ( let's say in my case 1000+ ) should have the same loops and checks running in the same time, however if there is a way to get
Is there a reason why this should be core and not an add-on in the asset library?
it's cant be added as add-on ( as far as I know )
The text was updated successfully, but these errors were encountered:
the workaround wont be helpful where we need to access tile scenes inside _ready from TileMapLayer
what I suggest is similar to get_children() or get_node() but it should return the children even if not fully ready so one could schedual actions once rather than recalling the same function for each tile
Describe the project you are working on
2D infinite map multiplayer game where each tile has some data to represent
Describe the problem or limitation you are having in your project
I have a TileMapLayer where tiles are scene collections
each scene is attatched to a script that change it's state according to some condition
I need to pass data from the TileMapLayer to the tile scene instance when I found no way to directly interact with that layer unless using
get_child()
and to the point : I called this on the child node
and this on the
TileMapLayer
and get this
the issue is clear : the TileMapLayer is fully rendered and ready, then the instances is added in places
the issue now is that we can access parent from children but not the opposite when working with procedual data and tiles that are set and unset
Describe the feature / enhancement and how it helps to overcome the problem or limitation
get_cell()
andget_cell_instance()
are not the oposite of setter 'set_cell' as they should returnt the node of the child if the cell is not empty, and not the propereties of the TileMapLayer itselfDescribe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
should be given a Victor2i representing coordinates of cell
set_cell( ... )
with scene collection instance : this func returns that instance ( even not ready instances if they was set )null
If this enhancement will not be used often, can it be worked around with a few lines of script?
Not few lines but it has 2 other complex alternatives
Is there a reason why this should be core and not an add-on in the asset library?
it's cant be added as add-on ( as far as I know )
The text was updated successfully, but these errors were encountered: