User Tag List

Results 1 to 7 of 7

Thread: Simple problem: Anim Frame according to Health_

  1. #1
    Clicker Multimedia Fusion 2 DeveloperiOS 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)
    King_Cool's Avatar
    Join Date
    Aug 2008
    Posts
    2,335
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Simple problem: Anim Frame according to Health_

    Hi
    I have this simple problem which i cant seem to figure out an efficient solution for.

    ...
    I have a Character with 11 Animation Frames ( 0 - 10 ).
    Character has Health_ ( 0 - 100 )

    I want my character to change Animation Frame according to his remaining Health_, like this:
    100 = Anim Frame 0
    91- 99 = Anim Frame 1
    81 - 90 = Anim Frame 2
    71 - 80 = Anim Frame 3
    61 - 70 = Anim Frame 4
    51 - 60 = Anim Frame 5
    41 - 50 = Anim Frame 6
    31 - 40 = Anim Frame 7
    21 - 30 = Anim Frame 8
    11 - 20 = Anim Frame 9
    0 - 10 = Anim Frame 10

    Alternatively:
    91- 100 = Anim Frame 1
    81 - 90 = Anim Frame 2
    71 - 80 = Anim Frame 3
    61 - 70 = Anim Frame 4
    51 - 60 = Anim Frame 5
    41 - 50 = Anim Frame 6
    31 - 40 = Anim Frame 7
    21 - 30 = Anim Frame 8
    11 - 20 = Anim Frame 9
    0 - 10 = Anim Frame 10

    ...
    How can i achive this result through an expression?

  2. #2
    Clicker Multimedia Fusion 2 DeveloperiOS Export Module
    Nifflas's Avatar
    Join Date
    Jul 2006
    Posts
    2,613
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Set Animation Frame to Health/10 or for the inverted 10-Health/10

  3. #3
    Clicker Multimedia Fusion 2 DeveloperiOS 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)
    King_Cool's Avatar
    Join Date
    Aug 2008
    Posts
    2,335
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    DESIRED RESULTS
    100 = Anim Frame 0
    91- 99 = Anim Frame 1
    81 - 90 = Anim Frame 2
    71 - 80 = Anim Frame 3
    61 - 70 = Anim Frame 4
    51 - 60 = Anim Frame 5
    41 - 50 = Anim Frame 6
    31 - 40 = Anim Frame 7
    21 - 30 = Anim Frame 8
    11 - 20 = Anim Frame 9
    0 - 10 = Anim Frame 10

    SUGGESTION: 10 - Health / 10
    I have already tried this, but ill show the results anyway.

    10 - 100 / 10 = 10 - 10 = Anim Frame 0 ( Correct )

    10 - 99 / 10 = 10 - 9 = Anim Frame 1 ( Correct )
    10 - 91 / 10 = 10 - 9 = Anim Frame 1 ( Correct )
    10 - 90 / 10 = 10 - 9 = Anim Frame 1 ( This should be 2 )

    10 - 11 / 10 = 10 - 1 = Anim Frame 9 ( Correct )
    10 - 10 / 10 = 10 - 1 = Anim Frame 9 ( This should be 10 )
    10 - 9 / 10 = 10 - 0 = Anim Frame 10 ( Correct )

  4. #4
    Clicker

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleSWF Export Module
    Konidias's Avatar
    Join Date
    Aug 2009
    Posts
    1,546
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    You're just going to have to have two conditions... One to check if it's at 100 and one to check if it's 99 or below... Because the 0-99 follow a pattern while 100 does not.

    Actually nevermind... several ranges don't fit the pattern... You might just have to make conditions for each?

  5. #5
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export ModuleSWF Export Module
    Eliyahu's Avatar
    Join Date
    Oct 2007
    Location
    Seattle, WA
    Posts
    1,523
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    10-(health-1)/10-health/100

  6. #6
    Clicker Multimedia Fusion 2 DeveloperiOS 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)
    King_Cool's Avatar
    Join Date
    Aug 2008
    Posts
    2,335
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Konidias
    Your right about 100 not fitting the pattern, but i can work around this easily enough.

    I managed to figure out the correct expression ( disregarding the Health_100 situation ):
    10 - ( Health_ - 1 ) / 10

    ...
    Strange how hard it was for me to figure this out, maybe it was the Health_100 exception which clouded my logical thinking about the system :P

    Thanks for the help guys!

  7. #7
    Clicker Multimedia Fusion 2 DeveloperiOS 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)
    King_Cool's Avatar
    Join Date
    Aug 2008
    Posts
    2,335
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Eliyahu View Post
    10-(health-1)/10-health/100
    Ah, i see you solved the Health_100 exception as well!
    I totally understand the 'health/100' part, it was so simple all along.
    Cheers

Similar Threads

  1. Can't get player frame 1 to play in anim sequence....
    By WEich1213 in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 26th November 2013, 05:00 PM
  2. Previous anim frame -> crash
    By RayMarble in forum The Games Factory 2 - Technical Support
    Replies: 1
    Last Post: 3rd September 2010, 04:36 PM
  3. Fade in to frame with different anim sequence
    By DEKE15 in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 20th August 2009, 09:10 PM
  4. simple problem
    By looner in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 28th September 2008, 09:40 PM
  5. Simple Help with a tutorial/how to play frame
    By RickyRombo in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 15th August 2008, 02:45 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
  •