Yann's Forum Posts

  • I think you are probably confusing a few things.

    What I'm more or less sure about (although I haven't used C2 for a long while) is that the start/end of layout triggers in an expected way.

    // start game

    on start of layout

    every tick

    ....

    on end of layout

    // change to other layout

    on start of layout

    every tick

    ....

    on end of layout

    etc

    now, for your problem with countdown, it doesn't look like a bug really. When you use a digital stopwatch and start it, the first thing that will happen is then millisecond going down, so instantly 90seconds becom 89seconds and some miliseconds

    if your algorithm is something like:

    countDown = 90

    every tick

    -> countDown -= dt

    -> set Text to floor(countDown)

    you'll probably not see 90, and that's ok

    now for the hp problem, I can be that you lose the value of the hp after changing layout, so it's logical that the value saved would be 0

    I don't have enough details to be really conclusive, but if it's something like

    if hp <= 0:

    hp += 50

    go to layout GameOver

    // in layout GameOver

    on start of layout

    save hp to local storage

    and your hp saved is 0, it might be that either hp isn't a global variable (local variable of the same name?), or, that something else is touching it before you're saving it

    also, it's weird that you save the hp in the other layout, it looks more consistent to save the variable at the same place you update. But missing too much context to be really sure.

  • Fervir and great newt

    dunno, I don't think I'll be using construct3 that much, not really using construct2 that much either, these days my tool of choice for game is unity.

    so I'm not overly motivated in doing a port. Maybe if one day I'm bored and curious about the changes they made in the plugin API.

    In any case, as long as the API isn't stable (like, you know, they planned changes for the runtime, so things like trigger might not work exactly the same... I dunno... ), I probably won't do anything.

    Also, well, I won't critic how scirra manage their products, but since they still lock some important feature in the free version (families, creating JSON files, and, it seems, using their awesome brand new stuff like array and dictionary editor,...) I'm not sure I'll be able to properly test the plugin, like if you have a family of JSON plugin object, will it still work? I know that for this specific plugin, using families could be a bit weird, but that doesn't mean I shouldn't test this case.

    (it's really weird that even in beta you can't access those, but meh... I'm busy not making games anyway \o\)

    Well anyway, the short answer is, don't count on it... but maybe.

  • grigrizljac

    yup, it's because I'm using CircularJSON so you can import/export complex datastructure.

    There's still no way to change the special reference character (~) for another one or escape it, sorry.

  • A circle isn't a polygon. You can approximate a circle using a regular polygon with a lot of sides

    I won't provide a capx, 'cause I'm lazy, but the pseudocode would look like:

    sides  = 32
    radius = 100
    pos_x  = 200
    pos_y  = 300
    
    angle_step = 360 / sides
    for i from 0 to sides:
         angle = angle_step * i
         x = pos_x + cos(angle) * radius
         y = pos_y + sin(angle) * radius
         addVertex(x,y)
    [/code:3dq0ztn5]
    
    something like that.
  • gumshoe2029 I'm supporting it for the time being as far as bug fixes go, but as far as adding new feature I'm less inclined to do it to avoid increasing the bug fix support load (don't have that much time) and also, since it's already not that user friendly, I prefer keeping it simple.

    if you have any issue, report it on github, it's easier for me to keep track of it over there.

  • totoyan

    share a capx with a case that reproduce the bug, so I know if it comes form the plugin, or a misuse of it

    if it's a bug from the plugin, I should be able to quickly patch it =)

  • After more than 2 years I finally released a new version :D....

    Now everything is hosted on github including the documentation

    I'll edit my first post to reflect that.

  • tmntppn

    yeah, the problem is that if I start adding indexOf, I'll have to add push, pop and shift, unshift etc... the plugin will quickly turn into an array plugin.

    And also people might want something like that for object (keyOf, etc)...

    Well... I'll think about it but since I'm not as motivated as when I started it, because I'm not using c2 anymore, the more feature I'll implement, the higher the risk of bug there will be, and I'd like not to have to spend too much time in maintaining it (:

  • hlebegue tmntppn

    yeah I knew about this bug, but years ago, I started a new interesting feature and I lost interest in C2.... :D....

    so I never released a new version (at that time I was so n00b I wasn't using version control so my fix was mixed with my new feature in progress...)

    Anyway, yeah that's basically the fix. I think I'll try to release the fix with that new feature some day.... Work is eating up any will to do anything personal so well... (:

  • Bl4ckSh33p

    I see no problem here

    make sure you load a proper JSON string.

    Good test is to copy paste the exact input you try to load in http://jsonlint.com and see if it's a valid string.

    for example

    {"realms": []}[/code:15yo6a9a] is a valid json string, but [code:15yo6a9a]test({"realms": []})[/code:15yo6a9a]is obviously not.
  • mfdeveloper

    I'm not using construct that much these days. But if I remember correctly the plugin has something like

    LoadJSON "{""name"": ""test"", ""age"",""xxx""}" at root@'some','kind','of','path'[/code:iu5f956j]
    which would exactly achieve what you described without having some nasty parsing. Something like[code:iu5f956j]Set Value "{o_o}" at root@ 'smilies','0'[/code:iu5f956j] should be expected to work
    
    has for sharing things on github, yeah, I should, three years ago I wasn't really using it that much so I didn't have this reflex.
  • keepee

    Yeah I'm still roaming around sometimes like an old ghost.

    Well... These days I'm not "constructing" that much, I'm more into unity, and I've became proficient enough to feel quite limited when I try something on construct :D...

    That being said, if I remember correctly and after having reread a bit of the plugin, I'm actually drawing the polygon in a 2D (non webgl) canvas and then using the resulting texture on a WebGL quad.

    And according to that StackOverflow answer there's nothing to control the aliasing, you'd have to write things pixels by pixels using some aliasing algorithms (I used one once for grid based line of sight...)

    So well... you'd have to either tweak the plugin to just do that, or find a way to draw polygons directly with gl calls (probably sending the vertices composing the polygon on the gpu directly, and since it only accepts triangles, as far as I remember, you would also need a triangulation algorithm... there's one in the box2D/physics plugin I think, for collisions... but yeah it would be a lot of work and I don't remember what C2 is exposing to help you on that... And that's why I choosed the easy road)

    And even with that, I'm not sure where C2 activate or deactivate antialiasing for WebGL if it ever does it (I think it does when you choose point sampling... yeah long time no C2 :D)

    So yeah, no easy answer on that one, sorry...

  • newt I dunno, maybe a pizza or a burger somewhere close by, my fridge is quite empty today.

  • Hmmm...

    edwardr

    Are you sure you didn't do more than just updating?

    'cause, I already see something wrong here:

    C:\Program Files\Construct2\exporters\html5[b]behavior\json-v1.1

    the .js and .ico files of the plugin are supposed to go in

    C:\Program Files\Construct2\exporters\html5[b]plugins\json\</p>

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • CrazyVulcan

    As big as your browser/device can handle (: