Joy's Recent Forum Activity

  • Anyone? Please, I could really use some advice to try and fix this issue. I was checking tutorials half the night and couldn't find anything that helped.

  • Just want to say thanks to Monitz87 and everyone who has helped with my screwy problems so far. I'm having some new problems that I cannot find solutions for though, and I hope by posting the .capx, it will be easier to figure out.

    This is a rough 'first person fighter', a little bit like Punch Out, but movement is like Dynamite Duke where you can pan the screen and both you and enemies can move. It has a working combo system and other features, but they are not included in this .capx for easier troubleshooting.

    [attachment=0:2hasv9qg][/attachment:2hasv9qg]

    If you play it, you'll see that the player's bounding box (player_bbox) and the enemy_bbox only move along the x axis, and that the enemy is always trying to overlap its box with the player's, at which point it will attack. Everything works well except that when the enemy's bbox does overlap the player's, the enemy's walking animation needs to stop immediately. It doesn't, in fact it continues to play through all of it's remaining frames of animation before attacking. You can see this happening by just moving away from the enemy a little bit and watching the enemy's walking animation frames (it's really clear in the debugger).

    Any help would be appreciated! If I can get this working well enough, I will try to make the basic template and combo system available for everyone to use. Thanks in advance.

  • Yeah, here's the new code.

    [attachment=0:2qofx7iw][/attachment:2qofx7iw]

    The 0.10 Wait commands are actually just so the enemy pauses for a tenth of a second before beginning to follow once the player's bbox is no longer overlapping the enemy's. Disabling them has no effect on interrupting the walking animation.

    (oops, just noticed that the second Else isn't part of the second X check. Fixing it did not have any effect though).

  • Thanks, but I can't get that to work either and I need a break. Just too frustrating not being able to figure out why stuff that should work isn't working. I'll probably try to make dummy animations and just post the .capx so you and anyone else can actually see it in action and what's happening.

    Thanks again for your time, I appreciate it.

  • Here's where I put it, is this still correct? The logic seems to make sense to me, but the enemy always plays all four animation frames before switching to enemystate "attack".

    [attachment=0:20dq7r4x][/attachment:20dq7r4x]

    Could you tell me where I could find in the manual (or elsewhere) how to write the expression for checking if any of a number of animations have finished? Basically I want to do something like:

    Enter the name of the animation that has finished: Animation: "enemykick1", "enemypunch1","enemypunch2" (that doesn't work of course)

    I seem to be able to find everything I don't need to know, but never what I do.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • As an action for enemy_bbox is overlapping player_box (and I don't know why there were two of those 'overlapping playerbbox' there, I removed one).

  • It actually worked without making the last three events a subset of the first one, but I did it anyway because that could cause trouble later. Thank you very much!

    I'm not quite familiar with arrays yet, but I will make a note of what you wrote and try to put it to use later. Thanks for that too!

    One additional problem came up during the attack animation playback mess, but I hate to keep asking questions. In that large code example earlier, it shows the enemy will move towards the player's bounding box by checking X, moving, and playing the walking animation. The only thing is that in this case, the animation does not get interrupted when the enemy overlaps the player's bounding box, and enemy pauses to finish its four frame walking animation before the enemystate is set to "attack". I tried putting Stop animations, Trigger Onces, etc, but whenever they do work, they also stop the random attacks from beginning. Do I need to make another variable in order to cut off animation immediately?

    Again, thanks a lot for your time. I hope that this discussion and your advice will help other users too.

  • :deleted last post, I think I got it working: Does this look right? Thank you very much!

    [attachment=0:2bj5l5da][/attachment:2bj5l5da]

  • I'm sorry, but I don't understand how to write the code you recommended. For my example, would it be something like Add Condition -> Enemy Sprite -> Compare Frame -> Equal to -> "enemykick1" = enemy.5 -1 (I don't know how to write the last bit)?

  • I think I got it working by just having the enemy hitbox overlap an invisible player bounding box instead the two imagepoints. Probably was a combination of the overlapping imagepoints not working exactly as I thought (hope it's not a bug though) and the unusual movement system I'm trying to make. Thanks very much to everyone who suggested ideas!

    I do have another slightly-related question if you don't mind (and I'd rather not create a whole new thread for in case it's a very simple fix). Now that the enemy does stop once within range and begin to attack (by calling a random animation), I can't figure out how to force an animation to play all the way through before calling upon another random value. They keep getting interrupted as the random command is called 60 times per second.

    I tried Trigger Once While True and a few other methods I read in tutorials and none of them seem to work here. Like I said, I'm probably missing something very obvious, but I posted an example of the code with blank actions and was hoping someone could give me some advice. All of the movement that is now working is included in that example too. Hopefully it might help someone else avoid all the frustration I went through!

    Sorry to ask again and thanks in advance for your help!

    [attachment=0:2y59q18y][/attachment:2y59q18y]

  • Also, thank you Trultz for the new information (sorry I couldn't reply via PM, I don't have enough rep yet). I'm rebuilding everything slowly now and I will try your and Minor's methods as soon as I'm able. Thank you very much!

  • I appreciate it, thank you! Will take a look at it in a little bit and let you know. Hope you feel better soon!

Joy's avatar

Joy

Member since 17 Jun, 2014

None one is following Joy yet!

Trophy Case

  • 10-Year Club
  • Email Verified

Progress

11/44
How to earn trophies