R0J0hound's Recent Forum Activity

  • You can use the pin behavior oh the objects you want to move with the map, and pin them to the map sprite.

    Alternate idea is to set the scroll instead similar to the other suggestions.

    I like to try to simplify stuff so calminthenight’s solution probably could be simplified a bit further to something like this. I haven’t had a chance to test it.

    Var prevX
    Var prevY
    On touch
    — set prevX to touch.x
    — set prevY to touch.y
    Is touching
    — scroll to scrollx+prevX-touch.x, scrolly+prevY-touch.y
    — set prevX to touch.x
    — set prevY to touch.y
  • Sure. It has to do with when new objects can be picked. When you create new instances they can’t be picked in a general way till the next top level event (top level means an event to the far left). Basically the new instances aren’t added to the object list till the next top level event. Pick by uid is the one condition that can pick new objects regardless.

    More info here.

    construct.net/en/forum/construct-classic/help-support-using-construct-38/picking-problem-37830

    Anyways the wait 0 is a bit of a hack to work around this. It delays till the end of the event sheet before running. Which is often fine in a lot of cases.

  • Well if you didn’t change the camera scroll from the top left, and the origin of the sprite map’s image is top left then it should work from my tests. Did you check the origin?

  • Since the map sprite is the same size as the layout you can do this. Make the map sprite's origin be at the top left, give the map sprite the drag and drop behavior, and finally add this event to limit how far you can drag the map.

    every tick: map: set position to clamp(self.X, OriginalWindowWidth-LayoutWidth, 0), clamp(self.Y, OriginalWindowHeight-LayoutHeight, 0)

  • Ah, cool, didn't notice that. Things really are all over the place. On the plus side I now know how to do one more thing without construct.

  • Looks like you can't load a file as binary with the AJAX plugin, only text. You have to use javascript to do it yourself: request the file as a blob, convert blob to dataUrl, and finally extract the base64 from that. Then you can load that into the binary plugin.

    At least you can save a binary file with the browser invoke download action with BinaryData.GetURL.

    Converting to a from a hex value is fairly straightforward so I added some functions. Doing similar things for 8bit binary values should be fairly straightforward too.

    uc84e04a4c3c0117aaa72246150a.dl.dropboxusercontent.com/cd/0/get/CiAAevWhu1yPFc_uUgAvNNj0lA77533HOwoTZWv_nZw4Q0lR1EP4Onw59PM_Nqyc5I-sBR16Cfzy4b8CJjvFqUol9Lfr0rLpDVW8ESKj2YDyaQ7RQau6CTt7W8NqbsrZYxULWqOdvFjSJwrMttG5ZxDq/file

  • Getting the meanings too will be a tall order. Keep googling and you may find one, but a quick look on my part didn't yield anything.

    You'll have to probably make such a list yourself. Doing it manually would be the least ideal. Another would be to scape what you need from a website like this:

    vocabulary.com/lists/52473

    With some work you can take that and has a bunch of words and definitions. Maybe if you're clever you can find a way to automate it.

    Another idea is to get an electronic version of a dictionary and scrape the info you need out of that, but that's more rough with copyright considerations. Seems like a lot of busy work either way.

  • Here's an example of parsing the tilemap.asjson directly. It grabs the width, height and rle data then expands it into the array. But yeah, just using the for loops is smaller and simpler.

    ucb692acc53d427ef12ec3fd060f.dl.dropboxusercontent.com/cd/0/get/CiBSJsiEPEyC7ephcEClsrUY-5mB8eGym6aXBKL2vuvxiySOK5vCwR5aomtgOyNZgNqBINzEjyiqphfyvJANQYfDFUIA0mCeKrWRwzmRS1L_xItWlB5XwhFPnUw8-u7RZupgAfBmBwfQWEqKiwwArdtU/file

  • It’s a different format. With a bit of work one could be converted to the other but it’s probably simpler to just do it tile by tile with a few for loops.

    The tilemap json is a bit more compact since the tile data is compressed with rle.

  • Hmm, The flood fill does seem finicky in your capx. I had a gander at the your code and the original capx you referenced but I can't pick out what's amiss. Admittedly it's a lot to digest.

    Actually, it looks like it's made to give up if it takes too long and sends a message to the browser console.

    I had a go at making a flood fill that doesn't give up. It ended up being very similar to the one you used. Looks like you're using not adding positions to the array if that tile is already filled, and I think you're doing bounding checking so you're not adding positions off the edge of the tilemap. But the main difference is I'm using the array as a stack instead of a queue which seems to be much faster. I tried switching it around and it was much slower to the point of hanging the game (guess that's why the one you used would give up).

    ucd396170e6e4988970a51b69703.dl.dropboxusercontent.com/cd/0/get/CiAXZXJZno4tDQ6WGLDzKwwjaqNfcyOHfbo0UnqT8TS6qI719D3I1rs1mgu2Sjy3CXrJyfawXOW6GpSsktEhFkfUdDjDI9OUOpmyLORsbIC8b8tFtA_fIsorTlKMW38NJtkyJbKGDMQvzrnPWvdaeUF0/file

  • I’m not following what specific issue you’re having with the physics behavior. You mention something about it not working with setting position?

    Box2d, chipmunk, matterjs, and most 2d physics engines are velocity based. So joints and collision response is solved by applying impulses. It still kind of handles it when object positions are set directly, but it doesn’t usually look as good.

    The physics behavior does have a little extra where when you drag a physics object and let go it updates the velocity so it’s thrown, but that’s extra. I’m guessing that is undesired behavior for you?

    There is an alternate way physics can be simulated and that’s with position based dynamics, but there isn’t a library for that as far as I know.

    However, let’s take a step back. What kind of physics simulation are you after? What would you like it to do, and how is the physics behavior failing?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • What does the 30k consist of? Before even going the compression route there may be ways to be more terse with the text generated.

    Like dop said there are ways to represent some data in a more efficient way even before compression.

    Some simple compression could be done in events with algorithms like rle and lzw.

    Or you could find a JavaScript compression library and use that with scripting.

R0J0hound's avatar

R0J0hound

Member since 15 Jun, 2009

Twitter
R0J0hound has 155 followers

Connect with R0J0hound