Creating Plugin for JS Library Help

0 favourites
  • 2 posts
From the Asset Store
Strange Game Ambient Loops 2 library is a meticulously designed & game ready ambience loop library.
  • Hey you Javascript people out there!

    I'm very beginner when it comes to Javascript but I can sort of get it when reading through code. Anyways..

    I wanted to practice by incorporating a generally simple JS library called PathFindingJS (https://github.com/qiao/PathFinding.js), into a plugin for C2. But I'm having some issues with the runtime.js I think. I copied over one of rexrainbow s plugins he made that referenced a JS library but I might have missed something. The plugin installs fine but I get an error when I run a basic template project that I added the plugin to.

    Here is a screenshot of the error when the game starts

    So basically for the plugin I made one expression that is supposed to call a function in the JS library to create a grid with a width and height that is specified.

    Could anyone take a look at my couple js files and see if anything stands out as broken or set up incorrectly?

    Also, if I am incorporating a JS library in the plugin, do you put ALL of that library's related files in the base folder with the runtime.js and such or do you keep them in a separate folder inside that folder?

    Any help or suggestions would be greatly appreciated!

    Thanks!

    FILES:

    https://dl.dropboxusercontent.com/u/96803504/JSPathFindingPluginFiles.zip

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • In the edittime you declared the js library as a dependany. That will load the js file into the application. So remove the items within the runtime that create the script tag. I think all that is what is messing you up. The expression you created returns a bunch of text. Not sure what pf.grid does but unless it returns a bunch of text, you might generate another error.

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