[-] plixel@programming.dev 1 points 3 years ago

Interesting!! Yeah that's exactly what my node structure is. So basically instead of using signals and sending from one Map child to the other, use spawn_object as a child from hexgrid and then just call the spawn object function as needed since the hexgrid script already has a reference to the index and location of each tile. Thanks so much for the advice I'll give it a shot! I ended up working out the signals issue I was having anyways but it seems like your suggestion is a cleaner solution!

[-] plixel@programming.dev 1 points 3 years ago* (last edited 3 years ago)

I see okay so I understand that the intent is to decouple scenes from each other, however from the tutorials I've seen they typically say that to establish the connection you need to run get_node() from the script you are establishing the connection to. So for example if you have:

*Parent
    **Child 1
    **Child 2

You would emit from Child1, then establish the connection from Child2 using:

var script = get_node("root/Parent/Child1")
script.some_signal.connect(some_function)

Is that the correct interpretation? Or am I misunderstanding? Thanks in advance btw I appreciate all the help in understanding this!

[-] plixel@programming.dev 1 points 3 years ago

Thank you! Okay so the tiles are part of a map, and I have a parent node called map with two separate children: hexgrid (where I'm instantiating the scenes) and spawn_objects( where I'm trying to gain access to the index and transform from hexgrid) my intent is to have hexgrid generate the grid and tiles and have spawn_objects instantiate an object within the tile at a certain position within it. Is this perhaps something I should combine into the same script? I typically like to have things modular and keep each component so a single specific task.

view more: ‹ prev next ›

plixel

0 post score
0 comment score
joined 3 years ago