Dynamic JS resources used into Plugin Help

For developers using the Construct 2 Javascript SDK

Post » Fri May 02, 2014 3:03 pm

Hi all,

I'm new to Construct2. It looks to me awesome.
I'm currently writting a pluggin for Nuggeta Game Services.

I'm facing the problem is i'm need from the plugin load a game specific JS and i don't know how to tell the plugin the JS needed to load since it's dynamic each time.

At deployment time it could be easy... by asking game developer to add a <script> load directive but
At development & test time i don't know how to make this work.

In fact i think it would be nice to be able to add an external JS file to the project and give its name to the pluggin. The pluggin has to load it then but i don't know where it will be located in between the local server test and real deployment configuration...

[EDIT1]
- Succeed to add a JS Files in the project explorer. It is well exported when project is deployed but not included <script> directive
- How to reference and load this JS file from the local test server

Thank you for your advice.
B
4
Posts: 9
Reputation: 218

Post » Tue May 06, 2014 4:04 pm

You can load scripts at runtime by inserting a script tag to the page.
Scirra Founder
B
387
S
230
G
88
Posts: 24,251
Reputation: 192,464

Post » Tue May 06, 2014 8:11 pm

Message: bidon0007 is not yet permitted to post plain text URLS (300 rep required). 1 URLS removed. Why?
HI Ashley,

Thanks for the advice.

I finally compiled all in the runtime.js file :) Maybe not the best but working like charm.

In fact i need to compile it on demand. So parallel loading was a bad idea i think.

Here is the progress of the Nuggeta game services plugin for Construct2. I hope to release it in 2-3 daysThank you for the support and your nice game editor definitely sweet.
B
4
Posts: 9
Reputation: 218


Return to Javascript SDK

Who is online

Users browsing this forum: No registered users and 0 guests