Need help creating a plugin - Crash on load

For developers using the Construct 2 Javascript SDK

Post » Wed May 06, 2015 4:06 pm

Okay, so I'm trying to write a variation of the tilemap plugin to enable hexagonal tiles, plus tiles that have a z-height (I just need to add an input field to allow overlap) except that I'm running into a very strange problem: I am unable to to copy paste the plugin to even create a test bed to start with. Construct 2 crashes when I load the addon.

The steps I went through:
  • Copy tilemap folder in plugins
  • Edit edittime.js to change the name and ID
  • Edit runtime.js to change all three instances of "cr.plugins_.ID" to use the new ID
  • Launch Construct 2, create a new layout
  • Attempt to add Tilemap Copy to the layout.
  • The default tilemap image displays
  • Construct 2 stops responding

What do I need to do to get a second version of the tilemap plugin working so I can start fiddling with it?
B
10
S
2
G
2
Posts: 73
Reputation: 1,044

Post » Wed May 06, 2015 4:34 pm

One of the issues with C2 is that only official plugs can have their own parts of the gui.
C3 hopes to solve that.
Image ImageImage
B
171
S
50
G
180
Posts: 8,397
Reputation: 113,988

Post » Wed May 06, 2015 5:05 pm

Is there a way to create a plugin that modifies the way the tilemap object is drawn? I don't want to risk having to maintain a fork of the official plugin.

I can achieve the results I want by using a separate tilemap for each row of tiles, but I figure this may cause headaches in the long run as I will need a function to translate Y coords to reference separate objects. And if I want to add a Z coord (because the tiles can be stacked) then it gets even trickier.
B
10
S
2
G
2
Posts: 73
Reputation: 1,044

Post » Wed May 06, 2015 5:53 pm

Nope.
Changing official plugs is frowned on anyway, and not really an option here. It would just be written over on the next update.
You can change how the tilemap is drawn as another method. The texture would have to be offset, and put pieced together on the map.
As tiles it would be mathematically useless... pretty much.
So basically it would be for looks alone.

Edit:
What would be useful is a helper plug that does the math and converts normal xy to hex xys.
Image ImageImage
B
171
S
50
G
180
Posts: 8,397
Reputation: 113,988


Return to Javascript SDK

Who is online

Users browsing this forum: No registered users and 0 guests