User Tag List

Results 1 to 9 of 9

Thread: Throw knife when playing frame 4 of animation Launch

  1. #1
    Clicker Fusion 2.5 (Steam)

    Join Date
    Dec 2015
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Throw knife when playing frame 4 of animation Launch

    Hello,
    When the player hit the z key on the keyboard then I deactivate all the groups and activate the group Throw Knife. The object start to play the animation Launching. I want to launch the knife when image 4 is playing.
    When I run the game and hit the z key then I see that the animation launching begin to play. But the knife will not appear when frame 4 is playing. When the lauching animations is over I deactivate the group Throw knife and activate the other groups.
    Then something strange happens. The animation Stopped is playing and when frame 4 is playing the object throw the knife.
    What is wrong with my code?
    Can someone look at the code and look what I did wrong?
    Code.PNG

  2. #2
    Clicker

    Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export Module
    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
    Jun 2006
    Location
    Killeen, TEXAS
    Posts
    1,037
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    make sure you add in regardless; on line 37
    maybe also put a flag on it so it wont keep doing the same action if the animation is slow...

    animation Launching is playing
    + animation frame =4
    + flag 0 is off

    >> launch knife
    >> set flag 0 to on

    my guess is you probably need to restore the animation after its played. hard to say without seeing whats actually happening

  3. #3
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCiOS Export ModuleInstall Creator Pro
    Julian82's Avatar
    Join Date
    May 2012
    Location
    outbuddies.com
    Posts
    937
    Mentioned
    47 Post(s)
    Tagged
    0 Thread(s)
    Also, keep in mind that the "launch object" action re-triggers the launching animation. In Fusion the eleven first animations are auto-triggered if certain conditions are met, so if you want full control you should make sure NOT to use those and control everything with custom animations (numbers 12 and higher). Also, the problem could be your animation itself. The frames are indexed starting at zero, so frame 4 would actually be frame 5 in your picture editor (maybe you only drew 4 frames?). Made you a quick example using animation 12 as "throw" animation, works like you coded it. https://www.dropbox.com/s/keush6prul...knife.mfa?dl=0 Anyway, I would also avoid the "is animation over" condition, it is often buggy too. Better store the current animation frame in the objects alterable values and control frame-triggered events like the knife throw and animation shifts from there.

  4. #4
    Clicker Fusion 2.5Fusion 2.5 Mac
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    zip2kx's Avatar
    Join Date
    Jun 2015
    Posts
    781
    Mentioned
    17 Post(s)
    Tagged
    0 Thread(s)
    Two things:

    -Move the animation change from the button press event to the group.
    -To the frame check add When Launching animation is playing

    But I think your animation might get restarted so the better solution would be to give your knife object a bouncing ball movement and when player presses Z=change animation to launching, your frame=4 create the object (instead of launching it) and set it's direction the same as the player.

  5. #5
    Clicker Fusion 2.5 (Steam)

    Join Date
    Dec 2015
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    When I add an End application when frame 4 is playing then the application ends. But thowing a knife won't work.
    @ Julian, what do you mean with: keep in mind that the "launch object" action re-triggers the launching animation ?
    The images are more then 4
    Can you download the MFA and look at the code?
    https://1drv.ms/u/s!ArIdAn4LXRxjgcBYlfK9FMVB4yLsaQ

  6. #6
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCiOS Export ModuleInstall Creator Pro
    Julian82's Avatar
    Join Date
    May 2012
    Location
    outbuddies.com
    Posts
    937
    Mentioned
    47 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by dantehavenaar View Post
    When I add an End application when frame 4 is playing then the application ends. But thowing a knife won't work.
    @ Julian, what do you mean with: keep in mind that the "launch object" action re-triggers the launching animation ?
    The images are more then 4
    Can you download the MFA and look at the code?
    https://1drv.ms/u/s!ArIdAn4LXRxjgcBYlfK9FMVB4yLsaQ
    If your ninja launches an object it’s animation will auto-change to “launching” (only if there is a launching animation drawn, of course), in many situations this can mess up your control over what’s actually happening, so I recommend to use custom animations only which are never auto triggered.

    In my example using the launching animation instead of a custom animation lead to undesired looping of the launching animation. If you find time replace it in my example and you’ll see the buggy behavior.

    I’ll try to have a look at your .mfa.

  7. #7
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCiOS Export ModuleInstall Creator Pro
    Julian82's Avatar
    Join Date
    May 2012
    Location
    outbuddies.com
    Posts
    937
    Mentioned
    47 Post(s)
    Tagged
    0 Thread(s)
    I deleted the "launching" animation in your .mfa and replaced it with a custom animation. Works as intended now, I think the problem really just was using the launching animation. Your code is fine. Nice graphics btw^^ https://www.dropbox.com/s/adqzzk4sug...ugged.mfa?dl=0

    I cannot really comment on why using the built-in "launching" animation won't work in your example. It for sure has to do with the inner behaviour of the launching animation we don't have access to. Maye the inner frame count messes up due to the auto-trigger when launching an object. Could also be that the connection between launching an object and the built in launching animation is pre-programmed that the launch would always occure after the launching animation finished.

  8. #8
    Clicker Fusion 2.5 (Steam)

    Join Date
    Dec 2015
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks Julian
    Works like a charm. Learned a lot how to use (or not to use) the build in animation
    Kind regards,
    Dante (Neighbor Netherlands)

  9. #9
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCiOS Export ModuleInstall Creator Pro
    Julian82's Avatar
    Join Date
    May 2012
    Location
    outbuddies.com
    Posts
    937
    Mentioned
    47 Post(s)
    Tagged
    0 Thread(s)
    You're welcome Fusion has indeed some strange quirks, good thing is you'll likely always find someone in here that has already discovered it

Similar Threads

  1. Replies: 1
    Last Post: 27th January 2017, 02:18 PM
  2. Animation not playing at all
    By Outcast in forum Android Export Module 2.5
    Replies: 11
    Last Post: 2nd January 2015, 06:40 PM
  3. Launch animation problem
    By ASD in forum Multimedia Fusion 2 - Technical Support
    Replies: 0
    Last Post: 11th February 2013, 04:09 PM
  4. Replies: 0
    Last Post: 2nd April 2010, 04:45 PM
  5. Launch an object and animation question
    By ASD in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 31st January 2010, 10:16 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
  •