Lightsaber Moves*solved*

For questions about using Classic.

Post » Sat Jul 03, 2010 11:38 am

I have finished the most basic movement in my project. Since I have all the basics done, I decided to start working on the combat. The first thing I wanted to do is to make sure that animations play properly. Heres the problem: When I have all the animations in place I put in the appropriate events but when I run it, the animations don't play properly or otherwise get stuck.

This is the event:

Event
(Player) is on ground
(Player) Value 'canslash' Equal to 1
(invert)(Player) is moving
Key Enter is down

Action
(Player): Set animation to "Lightsaber"

The object (Player) is the character I'm using. The private variable 'canslash' is activated if it is equal to 1 if not the event won't be executed. The animation "Lightsaber" is the animation name I'm using for the animation.

I tried fiddling around with the frame speed, animation speed, events, etc. But nothing has worked so far. I hope someone can help me solve this problem as I need to get into full development soon.

Heres the cap:[url]Removed[/url]
(Note: I created this mock-up in a few minutes using exactly the same events as in my game to show the problem, I ripped the sprites and backgrounds from platform school as I had no time to put in original sprites.)

Thanks.

EDIT: Uploaded version with Lightsaber animations.
EDIT2: The problem has been solved.
B
2
G
2
Posts: 18
Reputation: 686

Post » Sat Jul 03, 2010 7:17 pm

As far as I can see, there is no animation named "Lightsaber". I've tried replacing it with the fall animation (in the Event Sheet)) and it works.
B
4
G
2
Posts: 10
Reputation: 720

Post » Sun Jul 04, 2010 1:00 am

The Lightsaber animations are here now, hopefully you can help me solve the problem
B
2
G
2
Posts: 18
Reputation: 686

Post » Sun Jul 04, 2010 5:40 am

In the Animation event sheet, your idle animation overrides the Lightsaber almost immediately. I added the condition in bold after else in the else event to get it working, though the animation is too fast in this mock up.

+ Player: is walking
-> Anakin: Set animation to "Walking"
-> Anakin: Set animation speed to 20
+ System: Else
+ MouseKeyboard: [negated] Player 1 "Action" is down
-> Anakin: Set animation to "Idle"

Depending upon the desired behavior, you may need to make the conditions a bit more complex. I haven't worked with animations much, but I found it puzzling that I couldn't get the 'On animation playing' and 'On animation finished' conditions to work (I set the Lightsaber animation so it wasn't looping.) Not sure what that's about... I'll have to try that again later.

You may notice that I used [negated] Player 1 "Action" is down above to keep the idle animation from overriding the Lightsaber animation. I replaced the 'Key Enter is down' below (in the Lightsabe events) with an action check as well, as it's a bit more friendly toward changing controls and such that way.

+ Player: is on ground
+ Player: Value 'canslash' Equal to 1
+ Player: [negated] is moving
+ MouseKeyboard: Player 1 "Action" is down
-> Anakin: Set animation to "Lightsaber"
B
3
S
2
G
2
Posts: 187
Reputation: 1,449

Post » Sun Jul 04, 2010 6:52 am

[quote="Silent Cacophony":378ogppo]In the Animation event sheet, your idle animation overrides the Lightsaber almost immediately. I added the condition in bold after else in the else event to get it working, though the animation is too fast in this mock up.

+ Player: is walking
-> Anakin: Set animation to "Walking"
-> Anakin: Set animation speed to 20
+ System: Else
+ MouseKeyboard: [negated] Player 1 "Action" is down
-> Anakin: Set animation to "Idle"

Depending upon the desired behavior, you may need to make the conditions a bit more complex. I haven't worked with animations much, but I found it puzzling that I couldn't get the 'On animation playing' and 'On animation finished' conditions to work (I set the Lightsaber animation so it wasn't looping.) Not sure what that's about... I'll have to try that again later.

You may notice that I used [negated] Player 1 "Action" is down above to keep the idle animation from overriding the Lightsaber animation. I replaced the 'Key Enter is down' below (in the Lightsabe events) with an action check as well, as it's a bit more friendly toward changing controls and such that way.

+ Player: is on ground
+ Player: Value 'canslash' Equal to 1
+ Player: [negated] is moving
+ MouseKeyboard: Player 1 "Action" is down
-> Anakin: Set animation to "Lightsaber"[/quote:378ogppo]Thanks a lot! I finally got the animations working properly. The fast animations can easily be fixed by setting the animation speed. Now I just need set the timing of the actions, create the enemies, lifebar, lives, etc. Now I'm getting a feeling that I'm gonna bump into a whole new bunch of new problems...

Thanks Again!
B
2
G
2
Posts: 18
Reputation: 686

Post » Sun Jul 04, 2010 10:43 am

This is quite helpful but what if I want to do tap a button to slash similar to Zero in Megaman X and Zero series? moreover doing combos like tap 1 for a simple slash, tap twice to do a slash and a different slash as long as the first slash animation is playing until 3 slashes, would like to know that, also how do I make it so that the sword does damage when it hits something and not get hurt yourself in the process? I presume doing a hitbox but the difficulty is that the sword is part of the main sprite making it so you also get damaged if you hit an enemy with your sword, is there a way to fix this? do I need to make several hitboxes or so to make proper melee combat?
B
9
S
2
G
3
Posts: 176
Reputation: 1,954

Post » Tue Jul 06, 2010 8:34 pm

What happened to the .cap?
B
3
S
1
G
2
Posts: 57
Reputation: 964

Post » Wed Jul 07, 2010 5:30 am

He deleted it because it was solved, I have the .cap myself if you want it but I will not upload it without permission but I can give it to you by PM.
B
9
S
2
G
3
Posts: 176
Reputation: 1,954

Post » Thu Jul 08, 2010 2:39 am

[quote="LavaWave":2tw1a02x]He deleted it because it was solved, I have the .cap myself if you want it but I will not upload it without permission but I can give it to you by PM.[/quote:2tw1a02x]

That would be nice :D

It's always great to have more examples to learn from. Would have been helpful to others to leave up!
B
3
S
1
G
2
Posts: 57
Reputation: 964


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 1 guest