Lightsaber Moves*solved*

This forum is currently in read-only mode.
  • 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:Removed

    (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.

  • 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.

  • The Lightsaber animations are here now, hopefully you can help me solve the problem

  • 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"

  • 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"

    hanks 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!

  • 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?

  • What happened to the .cap?

  • 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.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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.

    That would be nice

    It's always great to have more examples to learn from. Would have been helpful to others to leave up!

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