R0J0hound's Recent Forum Activity

  • This isn't a full solution, but it does show how to position a square or triangle to another square or triangle. I did in in a random way for testing, so it's not interactive like you're after yet.

    All the sides of the shapes need to be the same length. So for the triangle it's height= sqrt(3)/2*width. Except I rotated it to point right to make some of the math easier.

    Also the sprite's origins need to be in the center of the shapes. The triangle's should be (width/3, height/2)

    The angle from the center of the shape to the sides would be

    sprite.angle+(0,90,180 or 270) for the square

    sprite.angle+(60,180 or 300) for the triangle

    and the distance from the center of the shape to the edge is width/2 for the square and sqrt(3)/6*height for the triangle.

    To position shape B onto an edge of shape A you'd

    1. position B onto A

    2. set B's angle to an angle to to edge of A

    3. move B forward by A's distance to center

    4. move B forward by B's distance to center

    The final step is to see if the new shape actually fits. We do that with an overlap check between the new object and all the existing ones. In the capx I'm purposely spacing things since objects in contact count as overlapping but that gap can be removed once the new shape is found to fit.

    dropbox.com/s/eybebzudn59vns6/box_tri.capx

    To make it interactive you'd want to do basically oosyrag's idea. Loop over all the shapes, and create new ones at every edge. They stay marked as new and are only added when clicked on, which marks that as new and deletes all the other new ones.

  • Worst case duplicating events is an option instead of using or. But typically I find alternate solutions to using or on a case by case basis. Best I can do is offer possible work arounds or help confirm or figure out its behavior when I get time.

    Dev may weigh in on this later but he’ll probably refer to the manual, or refer to the suggestions platform or bug tracker. At this point in time the way or works probably won’t change because they are worried about keeping backwards comparability.

  • - Has this been discussed before?

    Probably. Kind of hard to search for those discussions though. Or with picking has seemed to be a sticking point over the years for many users.

    - Is there a reason why "OR" works the way it does? it probably made sense at the time. Personally I use it sparingly as I haven’t reasoned how it works in a simple way. Intuitively it tries a condition at a time until one of them is true. The picking handling has been a bit hazy to me. Your observation show that it doesn’t reset the picking after each false condition. There’s probably some utility in that.

    - Has it always been like this?

    The behavior of or has basically been the same since the early versions of Construct 2.

    - Are there any plans for adding a "True OR" condition? I'd love to see a "TOR".

    When just using non picking conditions like system->compare the or behaves just like a logical or in most programming languages. Also the dev seems to keep plans to himself. We only see what they were planning once the feature was added.

    Actually unless you have multiple instances of things using system compares is an ideal solution to avoid the picking or non picking.

  • I guess by default javascript converts numbers into text with as many decimal places as possible.

    The browser console typing 4.8*6 gives 28.799999999999997

    when you use the str expression you get the same: str(4.8*6) -> 28.799999999999997

    But fun fact, if you just try setting text without str construct rounds it slightly to give cleaner values.

    AKA set text to 4.8*6 gives 28.8

    Anyways, that subtlety isn't worth keeping track of. You can use the roundToDp to round to a number of decimal places so the text looks cleaner.

    roundToDp(4.8*6, 10) -> 28.8

  • Here's another test. It let's you distort the mesh with as many or as few points you like. The points act like bones with no rotation and each meshpoint are influenced by four bones to various degrees. It's a different way to manipulate a mesh I suppose.

    dropbox.com/s/9edglsbc529muco/skinning_test4.c3p

    An improvement would be to make it work with rotatable rectangles as bones. The

  • You probably can improve the situation by disabling the rotation setting with the 8direction behavior. Likely there are other tweaks to be had.

    Alternatively here is an event based 8dir like motion using the angle of the sprite. It has turning and strafe with settings for max speed, acceleration and deceleration. For the collision response it considers the player as a perfect circle and uses signed distance fields to allow smooth wall collisions. Basically it gives better collision handling than what usually is done.

    dropbox.com/s/3days6yqvdj1t9w/custom_fps_controler.c3p

  • Naw. This is probably more what you’re after

    construct.net/en/tutorials/enlighten-games-dynamic-1213/normal-maps-5

    There was a more recent normal map effect, but I was didn’t look too hard. It’s made by user Everade.

  • You can change those formals slightly to use there or just do it in a set position action after the crest action. All the clamp is doing is move the box so that it fits on screen.

  • You can use clamp for that. Assuming the origin of that window is top left.

    X = clamp(self.x, 0, viewportWidth-self.width)

    Y = clamp(self.y, 0, viewportHeight-self.height)

  • I don’t think we have any control over that at this point then. Maybe that’s something that can be fixed with a bug report.

    If it’s distracting enough one idea would be to use a lower z scale in the layout editor and scaling it up at the start of the layout when the game runs. It could be a somewhat doable workaround for now. So say in the editor you’d use half scale and then double it in events:

    start of layout
    — set zelevation to self.zelevation*2
    — set depth to self.depth*2

    A third idea could be to make an in game level editor. Could be an interesting thing to attempt.

  • Could it be that it just uses the image and not the repeated version?

    Possible fix could be to use multiple smaller cubes or use a mesh distort to position the tiledbg where the face would be.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Is that screenshot showing the glitch well? All I can see are the whiter pixels around the chain link.

    When 3d faces have transparency they typically need to be drawn from the furthest to closest to see through the transparent parts. That works best when the faces are facing the camera as angled faces or faces intersecting other polygons will often still have the issue.

    Construct seems to do this for you somewhat. I haven’t messed with it a lot. What you can do is change the z order of things to control what gets drawn first.

    Besides that there is a shader floating around somewhere called alpha discard or something that lets you see through transparent textures. But it’s a hard off/on, it doesn’t handle semi transparency.

    So anyways the two tools you have to deal with transparent textures in 3d is that discard shader, and maybe messing with the zorder of things.

R0J0hound's avatar

R0J0hound

Member since 15 Jun, 2009

Twitter
R0J0hound has 155 followers

Connect with R0J0hound