[BEHAVIOR] EasyStar.js pathfinding for tilemap

2 favourites
From the Asset Store
Units do not overlap each other and use different ways if there are several free ways.
  • Just went through the SDK doc, and indeed, it was all explained there :

    construct.net/en/make-games/manuals/addon-sdk/reference/specifying-dependencies

  • Hello, does this behavior work without tilemap? I'm currently trying to use a different pathfinder behavior from the original because I need it to create a path by grids, with each new path position being in the next grid position and unfortunately, the original one doesn't seems to work for me...

    but in my game, I'm not using tilemaps, I'm creating the map ramdonly with sprites basically, this behavior could work for me?

  • It has to use a tilemap, but the tilemap itself can be hidden. When you build your world, you'd have to sync the tilemap with each sprite placed, and you can use a simple binary tilemap to do so (empty tile for passable terrain and filled tile for obstacle).

  • Got an error after trying to use the Tilemap after adding the behavior. Using the tilemap without the behavior prevents the error.

    Javascript error!

    TypeError: tilegrid[y_] is undefined

    http://localhost:50000/EasystarTilemap_behavior.js, line 267 (col 5)

    This is what pops up when I try to do anything with the tilemap while it has this behavior.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Hi!

    Same here, this (fantastic) behavior worked great in C3 stable r225, but now throws this javacript error using the new stable C3 version (r234).

    I really love this behavior and would be very happy to know if there is a way to fix it : )

  • A quick fix, try using classic mode rather than module mode for 'scripts'. This worked for me.

    Perhaps Eren can do a quick update to support scripts mode (things like globalThis for globals and const C3 = self.C3 at the top of the files that reference C3.)

  • Using classic mode for scripts indeed works!

    Thank you very much for taking the time to post this fix, I'm very glad to be able to use this addon again.

  • Eren basically took under his belt the maintenance of this addon with his fantastic C3 runtime conversion. Let's see if he's still active to adapt it to the new module mode for external scripts.

  • thanks for the notification

    I made an arrangement for testing

    If it works fine, we can update it

    https://oyunkulturu.com/temp/file/easystarjs_module_mode.c3addon

  • Thanks or the update Eren.

    The update did not work (please also update the version number with changes e.g. 1.4.1 instead of 1.4.0 .)

    I think you might need globalThis.EasyStar = Easystar in the Easystar.js and then when referenced in other files, need something like const Easystar = globalThis.Easystar.

    Here's the error:

  • The update did not work (please also update the version number with changes e.g. 1.4.1 instead of 1.4.0 .)

    Hi Mikal, yes you are right i will fix it

    I think you might need globalThis.EasyStar = Easystar in the Easystar.js and then when referenced in other files, need something like const Easystar = globalThis.Easystar.

    When I tried the sample project, it worked in "modul" mode without any problem.

    I wonder if you try to delete the old plugin will it be fixed?

  • Eren - thanks, this was my user error, I got hit by the dreaded 'bundle addons' issue with one of my old projects (before I learned never to use that setting!)

    Thanks for the update, it works!

  • Thank you for the update, much appreciated!

  • Hello,

    On C3, I have this issue : Uncaught (in promise) TypeError: this.inst.GetSdkInstance(...).GetMapHeight is not a function

    Don't know if this plugin is still compatible but seems not :-(

  • Adavo Make sure to download the latest version of the plugin from Eren's comment above.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)