Creating Plugin for JS Library Help

For developers using the Construct 2 Javascript SDK

Post » Sun Oct 18, 2015 5:48 pm

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 (, 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 startsImage

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!



Learn to make a clicker game for cheap! ... e-game-666

Try out Pixel Golf on the Scirra Arcade! ... el-golf-67

Pudgy Platypus Games website!
Posts: 212
Reputation: 7,515

Post » Sat Oct 24, 2015 11:54 pm

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.

We are here for you!
Posts: 716
Reputation: 17,092

Return to Javascript SDK

Who is online

Users browsing this forum: No registered users and 0 guests