Vallar's Forum Posts

  • > It is slow because I am stepping through the debug window to make it easy to see what is going on.

    And? You should be able to see in the debug window why the Player sprite is moving - either in Bullet or 8direction tabs it will have non-zero speed.

    Apparently having speed or not doesn't affect this. Bullet behavior is disabled and has speed of 900. 8DirectionMovement has no speed but is enabled.

    If I set Bullet speed to 0, it doesn't affect the issue. The issue is nullified ONLY when I disable 8DirectionMovement. Moreover, I am not pressing any buttons whatsoever and the speed on 8DirectionMovement is 0.

    The only clue I have is that the Y of the player is incrementing and thus causing this movement. But I can't see any events in the sheet that increments that value only reads it.

  • Hello everyone,

    I am working on a little prototype with a sprite that has both the Bullet and the 8DirectionMovement behavior.

    For the life of me I can't find the reason why when I enable 8DirectionMovement on the player object it shoots up.

    I tried recreating the same object with the same behaviors and the new one doesn't have the same issue. My events also don't betray any sort of logic that would make this happen.

    Here are my setup and events:

    https://i.imgur.com/e0mWPZH.png[/img]

    https://i.imgur.com/NnEPMTl.png[/img]

    When I hit play I get this:

    https://i.imgur.com/SMwi4Fw.gif[/img]

    It is slow because I am stepping through the debug window to make it easy to see what is going on.

    Any idea what is happening?

  • You do not have permission to view this post

  • I see what do you mean. Thank you very much, I'll recode it using state machines with LOS :)

  • Hi all,

    I am trying to create an enemy type that when it reaches the range it can attack a player from, it dashes into the player.

    I tried to do this with LoS instead of the distance expression I am using below but I get the same exact stutter result.

    First, here is my "code":

    i.imgur.com/S8EODEd.png

    This is the result:

    i.imgur.com/GNm2oNG.gif

    I don't know why the enemy (purple) moves in "steps" towards the player. I tried to chang the speed (currently it is set to 800 as you can see from the text box) while that helped, that "steps" feeling is there but it slightly less noticeable.

    On a side note, the enemy has a Custom Movement behavior enabled on it but I only use it to stop enemy sprites from overlapping.

    Any ideas what is going on here and what I can do to fix this?

    Tagged:

  • I think you may be using by mistake the:

    Sprite "On Collision with another object"

    instead of:

    MoveTo "On Hit Solid"

    Oh, I see. Now I realize what this means. I completely misunderstood the documentation. Thanks for clarifying.

  • It looks like the moveto behavior's stop on solids property doesn't actually let the objects collide or overlap, it stops before they touch at all.

    You can use the stop moveto action on collision to stop instead of the stop on solids property if you want collision based events to fire.

    Just tried this out and you're right, thank you very much. This makes the documentation misleading -- super misleading because it says the opposite:

    Stop on solids

    If enabled, movement will stop if the object collides with something with the Solid behavior, and trigger On hit solid. If disabled solids are ignored.

    Someone needs to fix the documentation and makes sure quirks like that are mentioned in the tooltips.

  • Is your text box large enough to contain the word? If the word doesn't fit, it doesn't get displayed at all instead of being cropped.

    Yes, it is 6x the size of the word.

  • Hi everyone,

    I've got two sprites. Both of them are simply created through the fill color in C3 and their collision shape is set to bounding box.

    I have an event sheet that handles collision and I made sure it is included in the main one.

    The first sprite has a MoveTo behavior with stop on solid true. The second sprite has a solid behavior with a tag. There is NO event to exclude or include the tag as that setup isn't used for anything just yet.

    Collisions on both objects are enabled even on runtime (checked with Debug mode).

    I setup my event as such:

    - Sprite1 OnCollisionWith Sprite2 > DebugText Append "Collision!"

    Now when I run the layout Sprite1 moves towards the target I set to it. It encounters Sprite2 and stops. So far so good, the problem is the text box doesn't change and remains empty. I can see Sprite1 stuck to Sprite2. I can see it stopped moving, yet the collision event doesn't run, any idea why?

    I tried to change this to Overlapping instead of collision and it didn't work still.

    Tagged:

  • Hey everyone,

    I have a top down game and I have obstacles that I would like to vault over. How do you go about doing that?

    There are barricades in the game that the player creates. Now what I want to do is have the player be able to vault over them.

    Here is what I tried to do:

    1- Create the barricade object.

    2- Create a hidden object called "Vaultable Object"

    3- When player steps on Vaultable Object and presses Space, I stop its controls and tween from Vaultable Object on the left of the barricade to the right of the barricade.

    This works perfectly if there is one barricade only. It doesn't work well with two barricades or more as the picked instance is always the first one created. Moreover, this works along the width of the barricade and not the length, I would like the player to be able to do vault in both direction.

    Here are the events I am using:

    i.imgur.com/yVxvPCp.png

    And while at it, quick question, is there a way to have the player jump in a top down game in C3? Maybe that is a better approach so the player can jump any time they want rather it being context based?

    Tagged:

  • object.lineofsight.hitX & object.lineofsight.hitY will give you the coordinates of the intersected raycast.

    You can also use object.lineofsight.hitdistance if you need a quick measure of the distance.

    I didn't know that. Thank you very much!

  • I would do this with LOS/raycasting and MoveTo behavior. Bullet at high speeds is too unreliable and hard to deal with.

    Gotcha. Is there any way I can get the contact point of the raycast? Or perhaps get a point on a direction.

    Say, like in the GIF, I have the ball in the middle but tap on the black box. The raycast will detect collision and it won't move. Now if I can't get the contact point of the raycast, is there a way to say something like "Even if there is a collision with the raycast, move the ball X and Y pixels towards the contact point" for example?

  • Here is an example:

    https://www.dropbox.com/s/80h6upcj4mjf9d9/BulletPushOutSolid.c3p?dl=0

    Thanks. Oh, I see now what you mean.

    I tried that. So the "bullet" in my case is the player and I am trying to create a dash behavior. So when I use the method you have right now, I end up with a weird bug.

    Say I dashed towards a box (from the GIF) and say I hit its left side (coming from the left). Now if I click above the top of the box, for some odd reason the player (bullet behaviour object) teleports to where I click. It happens randomly. Sometimes it happens, other times it doesn't. But usually it is when the object is stuck to the box on one side while I am clicking on the side next to it.

  • At speed this high, even with stepping enabled the bullet will not be able to stop exactly at the edge of the solid object.

    You need to add an event that will "push" the bullet out of the obstacle. In a loop move the bullet backwards 1px and check if it's still overlapping the obstacle. When no longer overlapping - stop the loop.

    There may be better ways to do all this, for example with raycasting.

    The speed is set to 4000 which is the same speed in the Step Example in C3. I tried raycasting, didn't exactly work well (unless I did it wrong). I don't fully understand what you mean here with loop move the bullet. Could you elaborate please?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hi everyone.

    I have an object with Bullet behavior (disabled) and another with Solid behavior. I am trying to make the bullet to stop moving when it is touching a solid and never considers moving if it is touching a solid.

    Here is a GIF of the problem:

    i.imgur.com/muMDiao.gif

    The circle is the Bullet in this case.

    So my code is this:

    i.imgur.com/lA4Nk5v.png

    But as you can see from the GIF no matter what, it still goes through the solid if I spam tap.

    I tried having a subevent checking if the bullet is overlapping a solid, it won't register the tap. But the problem then would be if the bullet touched the wall, stopped and now the player wants the bullet to move OUT of the wall, they can't because the tap is ignored.

    Any idea how I can resolve this issue?