How do I fix this sword fight system

  • Currently I'm having the same problem with both rolling and the sword attack animation.

    What happens is that the animation is completely triggered only after jumping or wall jumping, and then going into a loop

    I've been reviewing my other states my wasn't able to find whats causing this.

    My capx file, I added bookmarks for easier navigation:

    https://www.dropbox.com/s/p4gs5bf6hovh6xf/test_build.capx?dl=0

    Controls are: arrows to move left or right, up arrow to jump, R to attack with sword and C to roll.

    Thanks in advance.

  • I think you took the wrong idea with the "share capx", it seems you shared the full game, somebody might stole it and make it theirs though. It's your hardwork, don't give it away like that... You should present a minimal capx on the mechanism instead.

    Anyway back on topic, I tried to run it, I don't think the problem is somewhere at your bookmark, it's too much to look at. Based on what you say is, the problem might be somewhere at the jump mechanic, as I tested below:

    Before jumping, animation is incorrect for attack and roll, character movable.

    After jumping, animation is correct for attack and roll, but character is no longer movable.

    Jumping while crouching, collision bug.

    I'm not being helpful here but it feels like you haven't made it complete yet rather than made something wrong.

  • Thanks for your reply, and actually is far from the whole game. These are just the very basic platformer mechanics but I need to show the whole since the problem might be anywhere else and if I do the same actions isolated, they work perfectly.

    Still, I cannot figure out whats causing this. Might be a simple problem of wrong collision, or maybe something else. Ive been trying everything but with no result.

  • I'm using the steam version of construct 2 - so...I can't check your capx lol

    are you using the beta version?

  • I would strongly recommend using state variables. Checking only if animations play or not can get really complicated. Specially on this kind of game where animations play a big role.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Effregy, yes, latest beta build.

    Katala, thanks! I didn't even think about that. I will check that out.

  • Aren't my instance variables acting like state variables? Sorry, I think I'll need someone to get me out of my mistake here.

    I went thought several fixes last night and this morning. Some variables were still in loop even if the action was over.

    Also I went through a fix of collisions but with no luck. Just the roll and sword attack are triggered just after falling.

    I added to test a inversed isLanded and this wasn't happening for the sword attack. This would lead me to believe thats the error persists within the collisions but I cannot see why.

  • make a debug console lol

    just create a text object -- textDebug - and place it in your ui layer - can even have a key toggle it off an on -- hint hint leave it on though

    system every tic - set textDebug to -- "plState: " & pl_State & newline & "varName: " & player.varName & newline & "globalVar: " & globalVar & newline

    "Variable Name: " & root object.Variable Name & newline

    I'm using the steam version - and it's glitched - like it's been since my purchase - so that i cant download the unstable betas...so i'm sorry but i cant personally check it

    making the debugger text has saved me soo much headache though lol - it might help you resolve this issue

  • Actually I have a debugger using text. Today I put into events a system to toggle in between movement and combat mode.

    This helped me fix a bunch of issues that I didn't previously see. The attack animation still need to be activated in a weird way though. It simply stays in frame 0. Anyways, I'll keep delving into this and if anyone got any suggestions it would be more than welcome at this point.

    Thanks!

  • Finally got this. Tested it on another capx file, completely isolated and then started adding the mechanics that could be the cause. Then separated combat mode and movement mode in two different groups so I can switch in between them. Now it works great.

    Cheers

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)