User Tag List

Results 1 to 5 of 5

Thread: I can't fix this specific animation problem

  1. #1
    Clicker Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)

    Join Date
    May 2015
    Posts
    35
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    I can't fix this specific animation problem

    I'm working on an NES style Castlevania-ish game. I'm making good progress so far, but I've hit a bug. Because of the way everything is set up, the character freezes when you attack on stairs. I've managed to add/change some things to help make it better, but I haven't been able to squash the bug completely. I've run out of ideas on how to fix it and it's too big of an issue for me to ignore and skip past it. I took everything related to it and threw it into it's own application for people to look at. The controls are Z-jump, X-attack, left/right-move, up/down-move onto stairs and move up and down them.

    Animation Headache.mfa

    Here's the specifics. In the first Castlevania, you can't move while attacking. I added that in. When you're on stairs, if press/hold down either left or right, you'll move in 8 pixel steps. I found a file that had these kind of stairs, so I added them in. The way these are set up is there are two values, Up and Down. If you move up stairs, Up will be set to 8 and you'll move up the stairs. When Up hits 0, you stop moving. The same applies for Down. Both values work on left and right facing stairs. In the code I originally had it set up so that if Up or Down were between certain values, it would change the player's animations accordingly. Of course this meant that if you attacked, and because an animation was locked onto a specific frame, the attack animation wouldn't play. Since you can't move while attacking, you were stuck on the stairs with almost no ability to move (except you could still crouch). I added in various checks to help prevent this. At first this bug would happen anywhere on the stairs. Then it would only happen if Up or Down were different then 0, or you were between steps. Now when you're moving down, you can swing your sword all willy-nilly and never get stuck. However if you move up stairs, and if Up is different than 0 (or you're between steps) then you'll get locked up again.

    As I said, I've run out of ideas on how to fix this. I'm pretty familiar with Clickteam Fusion and can make a functional game with it, but honestly this is the farthest I've gotten with any project I've worked on and I'm not very familiar with the quirks of animations in Clickteam. If there's anybody that could take a look at this and help me out, please do. I would GREATLY appreciate it.

  2. #2
    Clicker

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleXNA Export ModuleUnicode Add-on
    mobichan's Avatar
    Join Date
    Oct 2007
    Location
    Buffalo, NY
    Posts
    3,300
    Mentioned
    27 Post(s)
    Tagged
    0 Thread(s)
    Please clarify a few things:

    1. Do you want to be able to move on stairs while attacking? it is not clear from your post.
    2. Have you considered making a player Flag for when you are attacking? You could use this to stop any movement code/animations from playing by checking that it is off.

  3. #3
    Clicker Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)

    Join Date
    May 2015
    Posts
    35
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    You shouldn't be able to move while attacking anywhere, whether you're on stairs or not. I do have an alterable value for when the player is attacking, not a flag. Should I use a flag instead?

  4. #4
    Clicker

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleXNA Export ModuleUnicode Add-on
    mobichan's Avatar
    Join Date
    Oct 2007
    Location
    Buffalo, NY
    Posts
    3,300
    Mentioned
    27 Post(s)
    Tagged
    0 Thread(s)
    It doesn't really matter if you use a var or flag. I just noticed you already had a flag for Player Hurt and Player Loses Control. I generally use flags to define specific states the player is in. For example, I might have a disablePlayerInput flag to control if inputs can be made or not. If the Flag is OFF (the default state) player inputs work. If it is ON, this disable all player input (I usually keep all player input in a group and just enable/disable the group based on the Flag's state. Similarly, you could have a playerOnStair flag that is toggled ON the moment you engage a staircase and a playerIsAttacking flag that is toggled ON when you are in an attack animation. Then in your movement input code, just add a check that the playerOnStair flag is ON and playerIsAttacking flag is OFF. This should prevent any movement inputs from working if the playerIsAttacking flag is ON.

    I had a bit of a hard time deciphering your code (I don't use PMO or built in inputs at all ) but hopefully this sort of approach makes sense to you and you can adapt it to your code.

  5. #5
    Clicker Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)

    Join Date
    May 2015
    Posts
    35
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    I wanted to add comments and such for that exact reason, but I was tired and short on time. So sorry about that. Also thank you so much for helping me with this!

    I already have an alterable value called Is Attacking which I use to see if the player is well, attacking. I also added a quick flag which was used just for this animation problem and... it didn't work. I added both Is Attacking and the new flag. Nothing worked. See, this is why I came to the forums with this issue because I don't know what's going on and I really don't know how to fix it.

    I should also mention that I did some testing and I think I found the exact event that's causing this problem. It's event 97 in the group Stair Animations. I'm pretty sure it's this event because as I said in my original post there's a value called Up that counts down from 8 and moves the player up staircases. In my stair animation code if Up is at 7 then it'll set the frame to a specific one, and again if Up is at 3. I noticed you only get stuck when you attack in the lower half of a step, or if Up is between 4 and 7. This also makes no sense because that event is nearly identical to the four below it so there's no reason this should be happening.

Similar Threads

  1. Replies: 2
    Last Post: 23rd May 2017, 10:16 PM
  2. Replies: 5
    Last Post: 28th June 2015, 01:38 AM
  3. how do you change the frame of an active object in a specific animation sequence?
    By Comicnight in forum Multimedia Fusion 2 - Technical Support
    Replies: 0
    Last Post: 18th March 2015, 06:21 PM
  4. specific animation has played a specific frame?
    By mobichan in forum Multimedia Fusion 2 - Technical Support
    Replies: 15
    Last Post: 22nd April 2008, 04:34 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •