R0J0hound's Recent Forum Activity

  • Here's a behaviorless way to do it.

    First chain tries to replicate the stretch from pinning to pinned objects.

    The rest order from head to tail with an adjustable stretch stiffness.

    dropbox.com/scl/fi/yzrr05uk5ch8fex2hrqrv/chain_stiffness.c3p

    Might be useful or give some ideas.

  • Lionz’ suggestion is by far the easiest. Just put invisible sprites on the edges of the platforms, and have the enemy change direction when colliding with them.

    If it’s too laborious to place the sprites then there is likely a way to automate placing them, but it depends how you make your platforms.

    Another way could be to detect the edges of the platform with a small detector sprite. Say the enemy is moving right. Move the detector sprite to the bottom right corner of the enemy. If the detector isn’t overlapping a platform the change the enemy direction to left. You’d do similar logic for moving left. You could also use “pick overlapping point” instead of a small detector sprite.

    A third way could be just to pick the platform the enemy is on and change direction when getting close to the edge. Would work well if the platform is just one long object. Logic for the right edge would be the following. Left edge is similar.

    For each enemy

    Enemy overlaps platform at offset(0,1)

    Enemy: is moving right

    Compare: enemy.bboxright>platform.bboxright

    — enemy: set direction to left

    Fourth way would be to just use the sine behavior to move the enemy. Place the enemy at the center of the platform, set the magnitude to half the platform width, set motion to horizontal and wave to triangle. I’m unsure if position would drift over time though with different frame rates.

    There are probably many other possible solutions.

  • There is a system action: Set layout vanishing point

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You can do it with physics forces. Take the sprite you want, and create a family “other” from that so you can reference two instances at the same time. Then do something like this:

    For each sprite

    For each other

    Sprite.uid <> other.uid

    — sprite: apply force 1/distance(sprite.x,sprite.y,other.x,other.y)^2 toward (other.x, other.y)

    If it’s too subtle the increase the value of 1. Try 1000 or 10000

  • Choose() will use one of the values at random. You probably wanted chooseindex()

  • If you know the speed the disk is rotating then you can rotate the sprite by the disks center by that amount.

    Sprite: overlaps disk

    — sprite: set position to (self.x-disk.x)*cos(disk.rotateSpeed*dt)-(self.y-disk.y)*sin(disk.rotateSpeed*dt)+disk.x, (self.x-disk.x)*sin(disk.rotateSpeed*dt)+(self.y-disk.y)*cos(disk.rotateSpeed*dt)+disk.y

  • I guess having backups that aren’t on your computer is a common response to this. Like an external drive or cloud storage.

    However a bad or buggy driver shouldn’t delete your files. Since you were able to fix your computer that means the hard drive wasn’t fried.

    If something happens where you can’t boot into windows to access your files you can always boot from a flash drive instead to access what’s on your hard drive. Those are pretty common to find online. They often include tools to access files even if the file system is corrupted or the file was deleted. Even if you can boot into windows and delete a file by mistake there are tools to undelete it as long as it’s not overridden by something else. The other benefit of booting from a flash drive is it won’t be creating new files on your hard drive and possibly overwriting files you deleted.

    All deleting a file does is to remove the reference to the file on the hard disk. The contents of the file is still there. However the file system is no longer protecting that portion of the drive so it can get overwritten if a new file is created that happens to use the same area. So in short, if a file is deleted you can often undelete it soon after, but wait too long and it’s probably mostly gone.

    A common way people fix a corrupted windows install if to factory reset the drive to a working state which overwrites the whole drive to how it was when you got the computer. Unfortunately there isn’t a whole lot that could be undeleted after that.

    Anyways, my point is there are ways to get deleted files back or even access files on a computer that isn’t booting. At least short of the hardware being fried or destroyed. And even for that there are companies that will do data recovery from destroyed or fried hard drives if the data is important enough to you to pay for.

  • To be clear the issue is from multiplying a number by text.

    Usually construct lets you know that it can’t do that when you write

    25*”1.3”

    So since the value is in an array it doesn’t know if it’s a number or text till runtime. And construct doesn’t really ever give runtime errors. So it just silently doesn’t do anything when trying to multiply a number by text.

  • Yeah it’s row,column instead of column,row

  • Yeah referencing the bounding box doesn’t really work for that. Mesh coords are relative to the oriented box of the sprite if it had no distort.

    Basically the unlerp would only work if the sprite wasn’t rotated and if the bounding box was the same as if there was no distort.

  • Realized you probably what the layout position from mesh point coordinates too. I made an old post about it but search isn’t cooperating.

    You’d start with the position from the json, then using the original sprite’s position and size you convert to a layout position. The third action is if the original sprite had any rotation.

    Sprite2: set position to JSON.Get("w.mesh.points.0.0.x"), JSON.Get("w.mesh.points.0.0.y")

    Sprite2: set position to (self.x-0.5)*sprite.width+sprite.x, (self.y-0.5)*sprite.height+sprite.y

    Sprite2: set position to (self.x-sprite.x)*cos(sprite.angle)-(self.y-sprite.y)*sin(sprite.angle)+sprite.x, (self.x-sprite.x)*sin(sprite.angle)+(self.y-sprite.y)*cos(sprite.angle)+sprite.y

    Anyways hope that helps.

    Edit:

    Forgot to talk about the 0.5 part in the formulas. That would be the origin position of the sprite. 0.5,0.5 for center, and 0,0 for top left.

    Edit2:

    For zelevation too it would be:

    Sprite2: set zelevation to JSON.Get("w.mesh.points.0.0.z")+sprite.zelevation

  • Add the json object to your project and in events json: parse sprite.asJSON.

    Then you can access mesh points with

    JSON.Get("w.mesh.points.0.0.x")

    The 0.0. part is the row then the column.

    Heres how I found that. I added a sprite and set the mesh size to 2,2 and then set point 0,0 to have an xy of 0.5, 0.5. Then looking at the mesh part of the sprite.json we have:

    "mesh":{"cols":2,"rows":2,"points":[[{"x":0.5,"y":0.5,"z":0,"u":0,"v":0},{"x":1,"y":0,"z":0,"u":1,"v":0}],[{"x":0,"y":1,"z":0,"u":0,"v":1},{"x":1,"y":1,"z":0,"u":1,"v":1}]]}

    So all the mesh data is fairly easily accessible.