User Tag List

Results 1 to 8 of 8

Thread: Comparing animation frame to a variable

  1. #1
    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,310
    Mentioned
    28 Post(s)
    Tagged
    0 Thread(s)

    Comparing animation frame to a variable

    I am using the following to display a custom healthbar (made of 1 to 5 dots).

    +Animation frame (healthbar) <> HealthVar (player)
    - Force frame (healthbar) to HealthVar(player)

    Each frame of the animation is a state of the healthbar with more or less dots displayed. Frame 5 has 5 dots, frame 0 has no dots. I am not sure why, but sometimes when I run my frame, the animation frame will not set. It just stays stuck at frame 0.

    Any idea why this might be happening?

  2. #2
    Forum Moderator

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export ModuleXNA Export ModuleInstall Creator Pro
    nivram's Avatar
    Join Date
    Jul 2006
    Location
    Bandon, Oregon
    Posts
    6,773
    Mentioned
    12 Post(s)
    Tagged
    0 Thread(s)
    Reg. In the old days didn't we use a extra frame 0 in the animation?

    Marv
    ​458 TGF to CTF 2.5+ Examples and games
    http://www.castles-of-britain.com/mmf2examples.htm

  3. #3
    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,310
    Mentioned
    28 Post(s)
    Tagged
    0 Thread(s)
    Hey Marv, not sure what you mean. I may have stated this wrong in my original post, but there are 5 frames (frame 1 to frame 6) when you open the animation editor, since they are 1-based in the editor. But runtime code reads them as 0-based, so the frames are frame 0 to frame 5.

    Are you suggesting I make and extra first frame in the editor and change the code to "Force frame (healthbar) to Healthvar(player) + 1 ?

    Reg

  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,310
    Mentioned
    28 Post(s)
    Tagged
    0 Thread(s)
    Sorry, but does anyone know why this might be happening?

  5. #5
    Forum Moderator Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleSWF Export ModuleXNA Export Module
    ProdigyX's Avatar
    Join Date
    Jan 2011
    Posts
    1,197
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Make sure the animation speed is set to 0.

  6. #6
    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,310
    Mentioned
    28 Post(s)
    Tagged
    0 Thread(s)
    I will give that a try but it doesn't make sense to me why that would have an effect. Can you explain your reasoning? I just want to determine if this is a bug that needs to be reported.

  7. #7
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export ModuleMac Export ModuleUnicode Add-on
    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)
    AyreGuitar's Avatar
    Join Date
    Jan 2011
    Location
    Wales, UK
    Posts
    1,113
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    mobichan - I've attached a simple example based on what you suggested and it works fine for me. Maybe your problem is more to do with the rest of your program interfering, eg I'm guessing you have more than one healthbar to show health on each unit, so maybe it's more of an object pairing problem?

    BTW you could use a counter with Type Animation (instead of Numbers, Horizontal bar, etc) to do what you want instead, then you can just set the counter to the value (as long as you set the Min/Max for the counter to 0 and 5)
    Attached files Attached files

  8. #8
    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,310
    Mentioned
    28 Post(s)
    Tagged
    0 Thread(s)
    First off, thanks for the example. I never understood what the min/max functions were for and have been using an extra line of code to prevent variables from going past a certain min or max value. This should streamline my code in general. ^_^'

    Secondly, I am basically using the exact same code setup you are. It is only one healthbar active and it only exists when you use a specific character. So if the frame begins and the Global Val (PlayerType) = 4 (the character that uses this healthbar) then I create the healthbar at Start of Frame. A line near the bottom of my event list does the comparison of the frame and also includes the condition "(PlayerType) = 4". However, I just realized that when I create the healthbar at start of frame I am not setting its frame in that same event line. I assumed the event line at the bottom of the event list would just take care of that before the frame is drawn. Apparently it wasn't, because I added a set frame action in the same line as the healthbar is created and now the problem is gone.

    Not sure why this is happening, but at least I can brute force it to do what I need. Thanks for the help.

    Cheers,

    Reg

Similar Threads

  1. Set position to (x,y) from top of object, regardless of variable animation size?
    By ratty in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 9th December 2012, 10:49 PM
  2. Global variable = alterable variable
    By Jibs in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 1st November 2011, 08:54 PM
  3. Retrieve animation speed as a variable?
    By Pixelthief in forum Multimedia Fusion 2 - Technical Support
    Replies: 6
    Last Post: 21st April 2011, 01:46 AM
  4. TGF_MMF Notion Variable, “Système Variable”.
    By SpringUp in forum File Archive
    Replies: 2
    Last Post: 13th March 2009, 12:43 AM
  5. Going Frame to Frame in Animation Editor
    By JoOCoGames in forum Multimedia Fusion 2 - Technical Support
    Replies: 0
    Last Post: 7th January 2008, 05:05 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
  •