[Solved] Moving an object using linked tools extension

How do I…

Make an object move through a grid using the linked tools extension, like in this example

What is the expected result

I have a grid of Tile and link objects, which i link using the linked tools extension. When i click the mouse on a tile, it creates a target object and then i would like the mover object to move to the target object using the extension (so it can plot a route around obstacles)

What is the actual result

The mover object doesn’t move at all when i click. I reviewed the wiki page here and the example but even though I think I am doing it just like in the example, I must be missing something.

Screenshot of events are below.

Related screenshots

Hi, for moving your linked objects you need to have the “take into account linked objects” - condition. I am not sure if this is solving the entire problem but it is part of it. You can read about it here Linked Objects [GDevelop wiki] and it is also in the example project that you have linked:

1 Like

Hi there, the link tools extension is a bit of a passion of mine. I have spent some several days pouring over all 3 example projects, trying to solve its mysteries. I’m not there yet haha.

Anyway 3 things jumping out at me, first your condition to move the Mover is not the best, second, your Origin point is not at center or you would never make your grid at 0;0 and third you only link the Mover once, at the beginning of the scene and you never update the links.

So I tweaked your events a bit to get it moving to my satisfaction. And I did have to change the start of the grid to 32;32 since I changed the Origin point of each sprite to the center.

Oh also since I had no idea where you started your mover on screen, I had mine at 32;32.
Also my Repeat for each Target is unnecessary because I delete my targets, but I put it there in case you’re not deleting yours.

If that’s hard to read a file is here:
https://drive.google.com/file/d/1XuSbSR6x9-pYulbitPjbqzg5_bjVCDbC/view?usp=sharing

2 Likes

Turns out the main thing I was missing was that it is a requirement of the extension to change the origin point onto the center of all of the objects. My guess is that the extension considers the origin point as the location of the “node”, and not the object itself.

My mover object probably wasn’t moving because despite being linked to its starting tile, the origin point of the tile was not within the mover object so it didn’t count as being located at a node.

Changing the origin was the only change required to get it to move, but also thanks for all of the other improvements that make the game logic work better!

3 Likes

I’m glad you got it sorted out. Also I might have had the file I linked on restricted access, I fixed that in case anyone has this issue later and wants to check it out.
My biggest issue when I first tried link pathfinding was my object would start going “off grid” after awhile and it drove me crazy till I figured it out haha.
What you said about the nodes makes a lot of sense, I hadn’t thought of it. Makes me want to experiment some more.

1 Like