R0J0hound's Forum Posts

  • Hmm... I think 3D questions are confusing in general because there are lots of ways to describe things and often the questions aren’t clear.

    Unless I’m understanding wrong you are just looking for a way to rotate 3D objects on other axises? The answer you got so far looks like the start of a way to position the object at an angle from the camera, which is useful but doesn’t change the objects actual rotation.

    For 3D objects you can only rotate on the z-axis, (or on the xy plane). Construct doesn’t provide a way to rotate them any other way.

    The 3D camera can be rotated any way, but not directly. Basically the lookAt action can be used to get any rotation.

    There is a 3D third party plugin by mikal (I don’t have a link but it’s updated regularly) that lets you rotate 3D meshes on other axises too. Hopefully it has a lookAt action to allow the objects to face the camera.

    For a free solution you can make up 3D meshes with sprites using distort meshes. The orientation (or 3D rotation) of the object is a 3x3 matrix which can be represented by a 3x3 array or 9 variables. Anyways, the maths bit is needing to use matrix multiplication to apply rotation.

    RotatedVector = vector x orientation.

    Of course we can only do math with numbers, not vectors and matrices so you’ll have to expand the equations per vector component.

    Search the forum for recent posts by me for some examples of this.

  • I think the main thing you noticed is it’s not stopping at an exact location, but it gets close.

    Instead of checking if the x position is at 4050, you could check if it’s close. Say within 10 pixels away?

    Pick sprite by comparison: abs(4050-sprite.x) <10

  • I think you’d have to test the file reading/writing first to see if that works. I agree it would be a deal breaker if you had to get user permission to do it.

    In general I think you’d have to keep a list in memory of all the chunks, then you could reference that to see if you should load a chunk or just use the generator.

    Chunks could be identified by their position x&”,”&y. Then that list could just be a dictionary.

    That said, if the file saving/loading doesn’t work well you probably could go pretty far by just storing all the chunks in memory. Instead of storing every tile in a chunk you could store just the changed ones, and/or compress/decompress it when saving/loading. You may be able to utilize the binary object if you want a tighter memory usage.

    I’d imagine even in Minecraft the file streaming may have been added later.

  • While it’s a bummer to lose the capx/c3p file for your project, it would be more of a bummer if anyone could take your exported project and get a capx/c3p out of it.

    You’re better off utilizing some kind of undelete program to see if you can find your project file before you deleted it. Or maybe you system was setup to back up your files on the cloud.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • So I had a quicker idea for how to access data from a list of names or dates. Basically, for all the names you'd add it to an array along with the indices of where it was in the original array. Then you can sort that, add it to a dropdown, and when changing selection you just reference the sorted array to find the original location.

    dropbox.com/s/2cf76xirktuks2d/csv_lists.capx

    Got sidetracked by the csv file format. In your example file it uses semicolons instead of commas, and you didn't use any quotes. Made things simpler to parse. That converter c3p seems to deal with quotes but seems esoteric. Generic csv support seems more involved as it's not super standardized.

  • Can you post an image of your events?

  • Wouldn’t that be interesting. Those systems have quite a bit more limits than PCs so a lot of features even optimally done would be too slow or not possible due to memory, speed or feature limits. That and construct’s engine basically need a browser to run at all.

    I think the tighter the constraints the more the tool needs to be designed around it as it needs to be more optimized.

    A general game creating tool that can adjust its feature set and output stuff like that in addition to html5, widows and such would be pretty cool.

    I mean there’s this tool for nes games:

    thenew8bitheroes.com

    And this one whose goal initially was to make tiny windows games. But does android, sega master system, zx spectrum and a few more. Although the editor seems more buggy.

    zgameeditor.org

    Then there’s this that was made to run on as many platforms as possible. Intriguing but a bit far from a construct editor.

    100r.co/site/uxn_guide.html

    I think it comes down to the program has to be designed with other system exports in mind to support such a wide array of systems with such differing features.

  • It’s working as expected. In mine it sets the values based how A matches B.

    You’re looking at how B matches A.

  • I’m always trying to find ways to simplify the events if I can.

    Another idea instead of the Booleans is to use a dictionary. I’ll call the dictionary “pairs”. Nice way to use less variables, probably faster for a large amount of objects. The only downside is it doesn’t handle if multiple A or multiple B have the same matchId. But that may not be an issue if that can’t happen.

    for each A
    -- pairs: add key A.matchId with value A.uid
    
    for each B
    -- pairs: has key B.matchId
    -- -- pairs: remove key B.matchId
    -- else
    -- -- B: destroy
    
    pairs: for each key
    A: pick by uid pairs.curValue
    -- A: destroy
    -- pairs: remove key pairs.curKey
  • Cool, glad it was useful.

  • I had no idea what game tag you were referring to. Google linked to a game on the arcade. Looks like the camera centers between the players and zooms so all players are visible at once even when far apart.

    So here's how you'd do it for two sprites. 640,480 is the window size. Find the width and height of the bounding box that contains all the players. You can add to this so there is space around the players. Next you scale the layout. Here it's limited to 1 so it will only zoom out instead of zoom in too. Lastly scroll to the midpoint between the players. For that step you can just give the sprites the scrollto behavior instead.

    w= max(palyer1.x, player2.x)-min(palyer1.x, player2.x)
    h= max(palyer1.y, player2.y)-min(palyer1.y, player2.y)
    set layout scale to max(1, (w/h> 640/480)?640/w:480/h)
    scroll to ((player1.x+player2.x)/2, (player1.y+player2.y)/2)

    For three sprites you can change the calculation to:

    xmin = min(palyer1.x, player2.x, player3.x)
    xmax = max(palyer1.x, player2.x, player3.x)
    ymin = min(palyer1.y, player2.y, player3.y)
    ymax = max(palyer1.y, player2.y, player3.y)
    w= xmax-xmin
    h= ymax-ymin
    set layout scale to max(1, (w/h> 640/480)?640/w:480/h)
    scroll to ((xmin+xmax)/2, (ymin+ymax)/2)
  • Tested it myself with c2 and c3 and it's sorting correct with that data you're using.

    dropbox.com/s/dz762jh9t0myg9a/array_sort_test.capx

    You'll have to show your project or events.

  • Thanks. The mathiest part is the random orientation bit. And the random velocity.

  • An ugly verlet physics die.

    dropbox.com/s/zis7zp6rggxpdny/dice.c3p