dop2000's Forum Posts

  • I use a simple trick - put some character where you want to insert a line break, then replace it with newline in runtime.

    For example: Hello there,^general Kenobi!

    Set text to replace(array.at(index), "^", newline)

  • You do not have permission to view this post

  • You can make the collision polygons 1px smaller. To pin a neighboring sprite you'll have to again check for "overlapping on offset" instead of using "on collision".

    So when the player arrived to a new position, check if it's overlapping at a small offset (say 2 pixels) any new pieces in four direction. If it does, pin these pieces to the player.

    Answering your second question - you can put small invisible sprites in the center of each cell in the target area. When all these sprites are overlapping the player will mean that the level is completed.

  • You do not have permission to view this post

  • I can think of two options -

    1. Use "Overlapping at offset" to check if it's safe to move in the selected direction on the grid. You have to repeat this check for the main Player sprite and for all connected parts.

    2. Completely different approach - use a tilemap object as a Player. So each time you need to add a new piece to the player, instead of pinning it, add it as tiles to the tilemap. Tilemap is the only object in Construct which allows to modify its collision mask.

  • Here is an example:

    .

  • You do not have permission to view this post

  • You do not have permission to view this post

  • Physics ragdoll must be made with phyiscs joints. You can't use Pin or hierarchy to connect body parts to each other.

    Hierarchy may be used only to spawn the ragdoll. Here is how you do it:

    1. Disable Physics by default for all body parts.
    2. Disable all "Transform X/Y/Width/Height" checkboxes in hierarchy properties for all body parts.
    3. Spawn the parent object, for example Body. All other body parts will also be automatically created.
    4. After "Wait 0" enable Physics for all spawned instances, pick children of this Body and create physics joints to them.

    Here is an example from my game

    (I don't need to pick children, because there is only one ragdoll on the layout at all times)

  • I think the problem has nothing to do with families. "Physics disable collisions" action affects all instances of this object, you can not disable it just for one.

    I suggest you disable Physics behavior for the dragged block, and re-enable it on drop.

    By the way, you should avoid mixing Physics with other behaviors - Pin, BoundToLayout etc. It may cause all kinds of bugs. So this is another reason why you should disable Physics while dragging the block. And when it's dropped, make it immovable instead of pinning.

  • Do you an object associated with these characters, say, are they sprite instances? Then the easiest way is to add instance variables CharName and CharHeight to the sprite. You will be able to pick a character with highest/lowest height, or iterate through them ordered by height.

    If characters exist only as data, then it's a completely different approach. For example, if there is an array of characters, you can sort it by height and get the first/last record from the array.

  • There are a few basic math expressions which you can use - min, max, clamp. You can read about them here:

    construct.net/en/make-games/manuals/construct-3/system-reference/system-expressions

    For example, you can modify your formula like this to avoid "healing" the enemy or dealing too much damage:

    Set EnemyHP to EnemyHP-clamp(((PlayerAttack + max(PlayerStat-EnemyStat, 0) - EnemyDefense), 0, 100)

    .

    Or you can use max() to pick the highest value from multiple stats - max(enemyShield, enemyArmor, enemyEnergy)

  • There is no such thing as object parallax. You need to place them on layers with different parallax. Or move them at different speeds with events.

    Or maybe you mean Z Elevation setting? This one you can set for each individual object.

  • This can be caused by collision polygons. If your sprite has an animation playing and each frame has a different polygon or different position of the origin image point - then when animation frame changes, it may collide with the marker/wall, even if the sprite has already turned and started moving away from it. As a result, it immediately turns again and walks through the wall.

    The common solution is to use a separate sprite (simple invisible rectangle) for the collision box, and pin your animated sprite to it.

    Another option is to add a "cooldown" period. After colliding with the wall, ignore further collisions for this sprite for 0.5 seconds. You can use an instance variable "lastCollision", set it to time expression. And in "On collision" event check that lastCollision<(time-0.5)

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Recruit_Zer0 You can use Bullet behavior or Physics to continue moving the object when mouse button is released.

    See "On Drop" event in this demo:

    howtoconstructdemos.com/scrolling-a-list-of-players-scores-images-etc-example-a-capx