How do I fix this sword fight system

Get help using Construct 2

Post » Sat Sep 27, 2014 6:22 pm

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.
B
43
S
12
G
14
Posts: 488
Reputation: 10,570

Post » Sat Sep 27, 2014 7:12 pm

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.
B
28
S
8
G
4
Posts: 553
Reputation: 4,924

Post » Sat Sep 27, 2014 8:53 pm

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.
B
43
S
12
G
14
Posts: 488
Reputation: 10,570

Post » Sat Sep 27, 2014 9:56 pm

I'm using the steam version of construct 2 - so...I can't check your capx lol
are you using the beta version?
B
9
S
2
G
1
Posts: 36
Reputation: 1,381

Post » Sat Sep 27, 2014 10:07 pm

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.
B
34
S
9
G
3
Posts: 517
Reputation: 5,226

Post » Sun Sep 28, 2014 1:40 am

@Effregy, yes, latest beta build.

@Katala, thanks! I didn't even think about that. I will check that out.
B
43
S
12
G
14
Posts: 488
Reputation: 10,570

Post » Sun Sep 28, 2014 3:26 pm

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.
B
43
S
12
G
14
Posts: 488
Reputation: 10,570

Post » Sun Sep 28, 2014 9:56 pm

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
B
9
S
2
G
1
Posts: 36
Reputation: 1,381

Post » Sun Sep 28, 2014 10:05 pm

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!
B
43
S
12
G
14
Posts: 488
Reputation: 10,570

Post » Thu Oct 02, 2014 11:43 am

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
B
43
S
12
G
14
Posts: 488
Reputation: 10,570


Return to How do I....?

Who is online

Users browsing this forum: evillair and 13 guests