Copons's Forum Posts

  • 6 posts
  • vtrix ah nice!

    For some reasons the online JSON editor I was using gave me errors all over the place if I tried to make arrays of objects, so I just assumed it wasn't a thing in JSON, but reading your answer I read some JSON syntax references and it is possible and actually really easy:

    [
        {"key1" : "val1"},
        {"key2" : "val2"}
    ][/code:2944uvjv]Thank you very much!
  • Hello there,

    I just stumbled upon this plugin and it seems to be amazing for my project!

    But, as I'm not currently able to try it, I was wondering if there is a way to get a random item from a structure.

    For example:

    {
       "item 0" : {
          "feature 0" : "value",
          "feature 1" : "value"
       },
       "item 1" : {
          "feature 0" : "value",
          "feature 1" : "value"
       }
    }
    [/code:2v1ddcts]
    is it possible to get a random item with something like:
    [code:2v1ddcts]JSON.Value(0, floor(random(0, 1)))[/code:2v1ddcts]
    
    In other words: are nodes' indexes numbered too or should I replace "item 0" and "item 1" with 0 and 1 and call it a day?
  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Katala I was thinking more about a super-light clone of Caesar-like games (basically for the same reasons as you: I've noticed a great lack of this genre in my Steam library ) than Sim City, with people spawning from house-buildings and going to work-buildings and back, but only able to walk on road tiles (so I guess I should recreate paths only when building something).

    But for now I'd be happy to have a sandbox-ish thing with buildings snapping to grid.

  • Katala Thank you for the answer!

    Until now I was trying to do everything directly in isometric view, but I guess it's just too hard to handle.

    As soon as I get back home I'll give your method a try!

  • Hello everyone!

    I'm Copons and I've been tinkering with C2 for a couple of weeks now and this is what I did in 3 or 4 days of actual development on the free version:

    dl.dropboxusercontent.com u/12429139/ Games/HLVGdemo/index.html

    (spaces added for lack of rep)

    Such fun to use C2, I'm loving it so far!

  • Hello, I was checking out this demo as I'm struggling in creating a dimetric city building prototype.

    Basically (and probably because I suck at math), I can't get zoning to snap to the grid.

    I have a menu where I can choose which tile I want to build, the tile is spawned and "locked" to the mouse (set position to Mouse.X, Mouse.Y, plus an offset to center the tile).

    Then when I click again the tile stops following the mouse and is "dropped" in the field.

    Just for the sake of testing, I tried to make it snap to a 16x16 grid (grid and tiles were created as 64x64 - or better, 64x32 in a square image of 64x64).

    But, sucking at math, the best way I came out is something like:

    on "drop", set tile position to

    round(Self.X) + (round(Self.X) % 16)[/code:33z43alc] (and the same with Self.Y).
    
    While I was expecting that they didn't snap to the right position on the grid, it seems they don't snap to multiples of 16, not even adding a wait after the drop action.
    
    (I'm not on my dev PC right now, so I can't provide a .capx at the moment)
    
    Long story short: is there a tutorial around explaining how to deal with isometric/dimetric zoning, and/or could you provide a .capx with the events needed for that part to work?
    I would be immensely grateful, really!
  • 6 posts