[PLUGIN] Polygon (update 2013-04-23)

Post your completed addons to share with the community

Post » Mon Apr 22, 2013 10:47 pm

@Yann many thanks for taking the time to look at this. Unfortunately I can't get it to work.

With WebGL enabled in Chrome and Canary I get the following log:

WebGL: INVALID_VALUE: texImage2D: no canvas

With WebGL disabled I get this alert:

Javascript error!Uncaught Error: InvalidStateError: DOM Exception 11http://localhost:50000/Polygon_plugin.js, line 231 (col undefined)This is either a bug in Construct 2 or a problem in a third party plugin or behavior - please report it to the developer!

Any help would be great! Thanks again!
Moderator
B
72
S
13
G
11
Posts: 900
Reputation: 11,783

Post » Tue Apr 23, 2013 12:15 am

@thehen

Oh yeah sorry, that's a bug happening when the polygon got no size, ctx.drawImage() doesn't like it.

I corrected the bug, but forgot to update :D

Should be updated in less than an hour (:

Edit:
hop! updated
not sure if I solved it the right way (I force the width and height to be at a minimum of 1)Yann2013-04-23 00:19:54
B
60
S
22
G
14
Posts: 1,479
Reputation: 16,346

Post » Tue Apr 23, 2013 10:52 am

@Yann oops doesn't look like it's updated?
Moderator
B
72
S
13
G
11
Posts: 900
Reputation: 11,783

Post » Tue Apr 23, 2013 4:24 pm

@thehen

Super weird
To be sure open runtime.js and check if there is a line with
Code: Select all
var MIN_SIZE = 1;


If it's the case, you should have the last version (same as mine).

I'm reposting the link here just in case
polygon.zip

If you have the same version, and if you still have the same bug hmmmmmmm
... trying on firefox.....
hmmm working...

Well at least double check, and if you still have the problem, I'll investigate since it would mean it's a plugin bug (:
Last edited by Yann on Sun Sep 14, 2014 7:19 pm, edited 1 time in total.
B
60
S
22
G
14
Posts: 1,479
Reputation: 16,346

Post » Tue Apr 23, 2013 4:41 pm

@Yann excellent, that works a treat! Thanks again for the work on this plugin!

I am now however getting errors in the physics demo. Not sure if that's related?
Moderator
B
72
S
13
G
11
Posts: 900
Reputation: 11,783

Post » Tue Apr 23, 2013 6:03 pm

@thehen
Neat!

Hmmm are you talking about that one? http://www.scirra.com/forum/plugin-polygon-update-20130423_topic62075_post381179.html#381179

If you do, I did mentionned in this post that there were a scary error message when you start the preview, but it works anyway.

The scary message comes from the fact that on start, since your polygon object is empty, it has no collision polygon. And Ash throw an assertion error for that. Because it seems, the physics behavior requires to be initialized with a valid collision polygon when the game start.

Anyway, as scary as the message looks, assertion are disabled on export, and it doesn't look like it makes the physics behavior bugs.
Sooooo...
B
60
S
22
G
14
Posts: 1,479
Reputation: 16,346

Post » Tue Apr 23, 2013 6:45 pm

@Yann that makes a lot of sense, awesome thanks :D
Moderator
B
72
S
13
G
11
Posts: 900
Reputation: 11,783

Post » Fri May 17, 2013 12:22 pm

Just wanted to say thanks for this plugin. I'm using it in my game SR:OPS (topic here) to create the flashlight. I wanted dynamic lighting, but couldn't get a decent frame rate with the Canvas plugin on a large layout, so I ended up using a ray-casting-like technique to find the vertex position, and then drawing the poly using that data. Since I'm only clearing/drawing on change it has helped a ton!
B
8
Posts: 32
Reputation: 1,039

Post » Fri May 17, 2013 1:19 pm

@thatjoshguy
Heh nice you're welcome (:

You probably already thought about this but as a nice mecanism, having to walk slowly/silently (maybe holding shift) when you are just behind an enemy to avoid being "heard" could be a nice addition (:

Also you should probably resize your text object, it seems some words get clipped
Like
"Move: Arrow Keys or ..." in the menu
and
"End of..." at the end

And I didn't understand at first that if the enemies where to close to me in alerted mode I would automagically lose. I think they should just shot you dead (: So something like [code]->move to player
if between such and such range
   -> stop and shot[/code]
and [code]if lose line of sight
   -> go to last known position[/code]

But nice start overall and the light effect is neat indeed (:
B
60
S
22
G
14
Posts: 1,479
Reputation: 16,346

Post » Fri May 17, 2013 3:48 pm

@Yann

[QUOTE=Yann]
You probably already thought about this but as a nice mecanism, having to walk slowly/silently (maybe holding shift) when you are just behind an enemy to avoid being "heard" could be a nice addition (:
[/QUOTE]

Thanks for the feedback! I'm actually doing this in reverse. You walk by default, which is quieter. If you hold shift you can sprint, which will allow you to out-run the guards, but you're a lot louder so you'll end up alerting more guards if you're not careful.

[QUOTE=Yann]
Also you should probably resize your text object, it seems some words get clipped
[/QUOTE]

What browser/text size/zoom level are you using? Can you post a screencap in my thread? I haven't seen this behavior myself, but good to know!


[QUOTE=Yann]
And I didn't understand at first that if the enemies where to close to me in alerted mode I would automagically lose. I think they should just shot you dead (:
[/QUOTE]

Guard AI is still in the works :)

Thanks again for all the feedback!
B
8
Posts: 32
Reputation: 1,039

PreviousNext

Return to Completed Addons

Who is online

Users browsing this forum: No registered users and 0 guests