User Tag List

Page 1 of 2 1 2 LastLast
Results 1 to 10 of 11

Thread: Animation stuck while holding a fire button.

  1. #1
    No Products Registered

    Join Date
    Jan 2008
    Location
    Santiago, Chile
    Posts
    27
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Animation stuck while holding a fire button.

    I can't get this to work properly.
    I'm trying to get an animation in this way:

    + Repeat while Pressed fire 1
    > Set "Animation Value" of "Sprite" = 1

    + NOT Repeat while Pressed fire 1
    > Set "Animation Value" of "Sprite" = 0

    + "Animation Value" of "Sprite" = 1
    > Change animation of "Sprite" to "TestAnimation"

    + "Animation Value" of "Sprite" = 0
    > Change animation of "Sprite" to "Stopped"


    But all I get is just a static first frame.
    That's weird, because I'm using this same technique with the "Walking" animation, but pressing a direction instead of pressing a Fire button, and it works perfectly.

    And yes, the new animation is configured with a correct min/max speed and looping enabled.

    Is there a solution to this?

    Thanks!

  2. #2
    Forum Moderator Fusion 2.5 DeveloperHTML5 Export ModuleiOS Export ModuleSWF Export Module
    DavidN's Avatar
    Join Date
    Jun 2006
    Location
    Boston, MA, USA
    Posts
    4,044
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Animation stuck while holding a fire button.

    I think you could add conditions to your "Animation Value = ..." events to check if the animation you want is already playing before trying to change it... not sure, though.

  3. #3
    Clicker Multimedia Fusion 2
    Skeets's Avatar
    Join Date
    Apr 2007
    Location
    Utah, USA
    Posts
    360
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Animation stuck while holding a fire button.

    Here is your problem, he is repeating the animation over and over from the beginning so fast that it never gets to the next frame! Add "+One condition when event loops" to the top condition

  4. #4
    No Products Registered

    Join Date
    Jan 2008
    Location
    Santiago, Chile
    Posts
    27
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Animation stuck while holding a fire button.

    I already tried that, Skeets.

    I really don't know why it works only with directional buttons, but not with fire buttons.


    @DavidN:
    That's definitely not it, thanks anyway!

  5. #5
    Clicker Multimedia Fusion 2
    Skeets's Avatar
    Join Date
    Apr 2007
    Location
    Utah, USA
    Posts
    360
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Animation stuck while holding a fire button.

    Oh!! I got it. add "only one action when event loops" on the one with the set animation to test animation.

  6. #6
    No Products Registered

    Join Date
    Jan 2008
    Location
    Santiago, Chile
    Posts
    27
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Animation stuck while holding a fire button.

    That doesn't work either, Skeets.
    That just causes to show the first frame of the animation for less than a second.



    ---Later---

    Ok I solved it!

    Instead of making the code all nice and simple like I was trying to do it, I had to use many conditions and many OR instances, and absolutely no use of Variables to trigger the animations.

    It's kind of messy, but it works exactly how I wanted to!

  7. #7
    No Products Registered

    Join Date
    May 2008
    Posts
    103
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Animation stuck while holding a fire button.

    I am having a similar issue to yours it sounds like. Do you think you could post your solution?

    I'm simply trying to set an animation (attack) for an enemy when they're within a certain range of the player, and when that animation is done it sets the animation back to their running anim. When ever I set the attack anim it only displays the first frame of the animation for the duration the full animation should take to play, and then returns to the running one. Here is the code that causes that -

    npcState=ALERT
    +npcSeePlayer=YES
    +npcOnFloor=YES
    +npcOnEdge=NO
    +X position of npc >=X(player)-192
    +npcCombatState=1
    --- Change animation sequence to Attack


    *and then later*

    animation Attack is over
    --- Change animation sequence to Running


    After reading this post I added the "only once per loop" condition. However like someone mentioned above that causes the animation to flicker to the first frame quickly and then switch back to the Running animation. I've tried multiple animations in the place of "Attack", and I've tried adjusting the speed of its playback, but nothing seems to work.

    Any help is appreciated!


  8. #8
    No Products Registered

    Join Date
    May 2008
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Animation stuck while holding a fire button.

    So was it pretty much just adding "If animation X is NOT playing" to the event where it changes the animation, and copy pasting the event except changing "If animation X is playing" plus removing the part where it changes the animation?

    Taking artician's case, like so:

    npcState=ALERT
    +npcSeePlayer=YES
    +npcOnFloor=YES
    +npcOnEdge=NO
    +X position of npc >=X(player)-192
    +npcCombatState=1
    +animation sequence Attack is NOT playing
    --- Change animation sequence to Attack

    npcState=ALERT
    +npcSeePlayer=YES
    +npcOnFloor=YES
    +npcOnEdge=NO
    +X position of npc >=X(player)-192
    +npcCombatState=1
    +animation sequence Attack is playing
    --- Any other actions regarding attacking (if not in another event altogether)

  9. #9
    No Products Registered

    Join Date
    May 2008
    Posts
    103
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Animation stuck while holding a fire button.

    Thanks for the reply. I tried this, and a couple variations of it, but nothing changed.

  10. #10
    No Products Registered

    Join Date
    May 2008
    Posts
    26
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Animation stuck while holding a fire button.

    Do you have any other events that make the enemy start running? It may be fighting with these guys over which animation is to be played.

    If it's attached to an event that makes the enemy start moving towards the player, try adding the "animation sequence Attack isn't playing" to it.

Page 1 of 2 1 2 LastLast

Similar Threads

  1. Touch Joystick, Fire 1 Button, Fire 2 Button
    By ProdigyX in forum Android Export Module Version 2.0
    Replies: 0
    Last Post: 13th February 2012, 01:37 AM
  2. Problem with fire 1 and fire button 2 in beta 11
    By Koji_Kabuto in forum iOS Export Module Version 2.0
    Replies: 1
    Last Post: 31st January 2011, 07:51 PM
  3. Animation not playing when holding a mouse button
    By mobichan in forum Multimedia Fusion 2 - Technical Support
    Replies: 8
    Last Post: 10th March 2009, 05:56 PM
  4. Holding one button and pressing another
    By aeroshock in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 19th September 2008, 03:42 AM
  5. user holding down mouse button on object
    By TwistidChimp in forum The Games Factory 2 - Technical Support
    Replies: 14
    Last Post: 7th May 2007, 11:04 AM

Posting Permissions

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