Johncw87's Recent Forum Activity

  • >

    > > -quote snip-

    > >

    > > Hello! I again have the same error but this time it is in Android 4.2.2.

    > >

    > > Chrome Version: 31.0.1650.59

    > >

    > > Can you do something about it for compatibility?

    > >

    > > -image snip-

    > >

    >

    > I've updated the plugin with a fallback implementation of Math.sign from here:

    > https://developer.mozilla.org/en-US/doc ... /Math/sign

    >

    > I tested Internet Explorer very briefly, and it appears to work. It will probably also work on that outdated chrome for android, too. Download link is the same Dropbox link as always.

    >

    Hi, thanks for the update !.

    I installed the new version and suddenly now I have this error when I open my project.

    This error did not exist before, will it be due to the update of the plugin ?.

    -image snip-

    I highly doubt that this is related to updating my plugin, as I didn't change the edittime.js file at all. The only way I could see an editor bug being related is if you had previously modified my plugin's edittime.js (maybe to un-comment the incomplete "Trace Box" action), since re-installing it would undo those changes.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • -quote snip-

    Hello! I again have the same error but this time it is in Android 4.2.2.

    Chrome Version: 31.0.1650.59

    Can you do something about it for compatibility?

    -image snip-

    I've updated the plugin with a fallback implementation of Math.sign from here:

    https://developer.mozilla.org/en-US/doc ... /Math/sign

    I tested Internet Explorer very briefly, and it appears to work. It will probably also work on that outdated chrome for android, too. Download link is the same Dropbox link as always.

  • Is it possible to determine the first hit? I need to add special visualization for the first hit.

    Not sure what you mean? The HitX and HitY are the first hit. It ignores anything that isn't the first hit.

  • I found that the error only occurs in Internet Explorer 11.

    In Chrome it works well.

    That... actually helps. I re-created the error, and now see it in English.

    [quote:1xevi66t]

    Javascript error!

    Object doesn't support property or method 'sign'

    Apparently Internet Explorer doesn't support Math.sign(). At all. This is the kind of thing that makes web developers hate IE.

    This is from MSDN:

    [quote:1xevi66t]

    Supported in Microsoft Edge (Edge browser). Also supported in Store apps (Microsoft Edge on Windows 10). See Version Information.

    Not supported in the following document modes: Quirks, Internet Explorer 6 standards, Internet Explorer 7 standards, Internet Explorer 8 standards, Internet Explorer 9 standards, Internet Explorer 10 standards, Internet Explorer 11 standards. Not supported in Windows 8.1.

    I'm not really sure what I'm gonna do about that. I'm leaning heavily towards "screw Microsoft and their non-standards-compliant browser".

  • Hello, I do not know if this bug has been reported but I'll do it now.

    I guess it's a bug in the plugin.

    Any clue of the problem?

    By the way, thanks for the plugin !.

    Well, the error isn't in English, but I still see a line number. It appears to have an issue with a variable being passed to Math.sign(). The number is derived only from the start and end positions of the trace, so make sure that you aren't making those invalid somehow. Some expressions (like the parameters in the function plugin) can return both numbers and strings. Perhaps you are accidentally passing a string to something that requires a number?

  • Would it be possible to turn this into a behavior so different objects can store different trace results? I'm not a programmer so I have no idea how difficult that would be.

    Well, I could, but I don't see the utility of this. In my project, it's being used to detect ledges for the player to grab on to. After the check is complete, I no longer care about what the results are, and I can use the object again for something else. If you really need to store the results longer, you could always save them in some variables or an array, or you could add the trace object to a container. I have NOT tested this plugin in a container, but it should work just like the array object, having a unique instance (and results) for each instance of the container.

  • Colludium

    Of course. The one time I didn't update the example (which used the minifier), the minifier stops working.

    The fix turned out to be easy, though. I had added default parameters to a Javascript function, which is apparently not yet standardized (but supported by Firefox). It would seem that the minifier didn't like this, so I took that out.

    Re-download the plugin.

  • This forum needs Facepunch-level efficiency for dealing with spammers. The best solution would be more moderators in more timezones. Another thing you could try is some sort of community moderation, where if a post is reported enough times by users with C2 licenses, it will be hidden until proper moderator action can be taken. Or, if a large number of reports occur in a short timespan, send out text messages to all moderators.

  • I've updated the plugin. If a trace starts inside of an object, the hit position will now be at the start, instead of hitting the inside of the polygon. I'm not quite sure what to do with the normal in this case, so I just set it to be opposite of the trace line. I also added a HitFrac expression, which is used internally to calculate the hit position. I find it useful for checking if the trace started inside an object, but I'm sure there are other uses for it.

    Not much progress on the hull trace front. Resources on the topic are hard to find.

  • I've updated the plugin again.

    • Added padding property, to set how much space is left between the hit object and the result position
    • Added 'Hit' condition which returns true if the last trace performed hit something.
    • Fixed normal direction on flipped tiles and other polygons with alternate winding.
    • Now using a simpler calculation for reflection.

    The example now has an absurd reflection test on the tilemap layout.

    I'm planning on adding hull traces, but I'll need to do some research on the math required for that.

  • Hey, great plugin. Thanks for sharing.

    I made an icon you can use if you like it. icon

    the 16x16 looks nice, but the larger ones look like they have been upscaled from that smaller one, and don't look as nice.

    Nice plugin. Here's a quick thought on the normal being wrong on flipped tiles. Normally the collision polygon have it's points ordered in the same way (cw or ccw). This is called winding. So when a ray hits an edge you can take the angle from one point of the segment to the other, and if the points have clockwise winding you can subtract 90 and get the normal.

    Mirroring will switch the winding and so will mirroring. So if something is both flipped and mirrored the winding will be the same as they are originally. Negative sizes of sprites have the same affect as flipping and mirroring.

    Roughly it would look like this, it might need to be swapped:

    If mirrored xor flipped

    EdgeAngle+90

    Else

    EdgeAngle-90

    That can fail though if the user creates a collision polygon with a reversed winding. It's not common but it has happened before. I didn't handle it and instead had the user correct his collision polygon, but you can handle it in code by either checking the winding of the polygon or sampling a point on one side of the edge to know which side is inside the polygon.

    I am already aware of what causes it, and have been considering testing which side of the line the start point is on to fix it. But thanks anyway.

    As far as speed goes, the best improvement would be to do some kind of spacial partitioning of the objects you cast to.

    Isn't this what the collision cells do?

    Ps.

    You can also calculate the reflection angle without vector math.

    ReflectAngle = 2*normal-rayAngle

    Thanks! I'm gonna use this now.

  • I preserve 2 pixels space calculated in event.

    When I said 'small distance', I meant something more along the lines of less than 0.1 units

    I'll add the padding property to my mental to-do list.

Johncw87's avatar

Johncw87

Member since 21 Feb, 2014

Twitter
Johncw87 has 13 followers

Trophy Case

  • 10-Year Club
  • Forum Contributor Made 100 posts in the forums
  • Popular Game One of your games has over 1,000 players
  • Famous Game One of your games has over 10,000 players
  • Viral Game One of your games has over 100,000 players
  • RTFM Read the fabulous manual
  • x2
    Great Comment One of your comments gets 3 upvotes
  • Delicious Comment One of your comments gets 10 upvotes
  • Email Verified

Progress

18/44
How to earn trophies