Multi-Resolution Game Development With GameBuilder Studio Check it out!
NEW Version 0.9.7 has arrived! New Blazing Fast Particle Engine & More Game Actions. Check it out
How do you use the new path tool for tower defense games?
  • Hi all,

    I wonder how the "plot a path"-tool in GBS 1.0 works. I would like to lay out about 3 paths on a road-pic for my entities to follow in my tower defense game. I did this with waypoint entities before, as described in Lavons TD-tutorial videos. But on a curved road you would need to have many, otherwise the movement would look edgy. Is it possible to do that faster with the new tool?
    So far I figured out, that you can give entities a path-component. If you select the "plot a path"-tool, you get little green crosses on those entities and you can "activate" them and draw straight lines. Can't figure out much more - I suppose you can connect those entities with the lines to create a path and then you can tell another entity to follow it, but I'm puzzled how to do so. Is there a tutorial somewhere?

  • 3 Comments sorted by
  • @Cavaron yes you are half way there. You can draw paths by adding a path component to any entity. The path that you draw will have its starting point at the registration point of the entity that it sits on. So you draw a path out from there by clicking the green points once you have the point tool active. Once you draw that path you now have a collection of points that can be used to animate an object along a path. Use the Move Along Path action and specify the Path component to move an object along that path. There are also now options to start and stop and continue moving an object along the path where it left off.

    You can also access the points in the path via the "path" property and use them as reference points but this is more of an advance trick. The points are laid out in sequence of x and y values in a list inside the path property. So the first point's x and y would be at position 0,1. The second point would be at 2,3 index in the path array. (i.e PathComponent.path[0] = X, PathComponent.path[1] = Y).

    By combining the Spatial.x and/or Spatial.y value of the spatial that the path is on plus the point's x and/or y values you could get the point's actual coordinate on screen in the scene to use for spawning objects or whatever else you can think of.
  • Yes, that helped a lot. Very nice tool! I figured out that a double klick on one of the spots creates anoter one near it - but how to remove a spot you accidentially created in the path? Undo won't work here. But great tool indeed, thanks!
  • @Cavaron, currently there is no delete you would have to start a new path by adding a new path component for now.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion