User Tag List

Results 1 to 4 of 4

Thread: Adding Half a Counter's Value to Another Counter

  1. #1
    No Products Registered

    Join Date
    Jun 2008
    Posts
    46
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Adding Half a Counter's Value to Another Counter

    Hi there. Quick question here guys. How do I add only half of Counter A's value to Counter B?

  2. #2
    Clicker Fusion 2.5 MacFusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleXNA Export ModuleUnicode Add-on
    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)Firefly 3D Module (Steam)
    Phi's Avatar
    Join Date
    Jan 2010
    Location
    England
    Posts
    1,964
    Mentioned
    25 Post(s)
    Tagged
    0 Thread(s)

    Re: Adding Half a Counter's Value to Another Counter

    Counter B: add to counter: value( "Counter A" )/2

  3. #3
    No Products Registered

    Join Date
    Jun 2008
    Posts
    46
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Adding Half a Counter's Value to Another Counter

    Thank you. That was such a stupid question. I was setting counters in in a certain way and was trying to do the same when it came time to add half a value. Boy do I feel sheepish.

  4. #4
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export Module
    Ryan's Avatar
    Join Date
    Nov 2008
    Location
    Australia
    Posts
    1,279
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Adding Half a Counter's Value to Another Counter

    Also, MMF doesn't use floating decimal numbers unless you specify. This may or may not matter depending on your game.

    Counter B: add to counter: value( "Counter A" )/2

    What if counter A is 1? then Counter A/2 = 0

    Why? Because half of 1 is 0.5, but that's a decimal number, so MMF rounds it down to 0.

    To fix this use:
    Counter B: add to counter: value( "Counter A" )/2.0

    the .0 on the end specifies that you want to allow floating decimal numbers.

    With this method if counter A = 1:
    Counter A/2 = 0.5

Similar Threads

  1. [Possible Bug] Counter with 0 as value
    By ProdigyX in forum Android Export Module Version 2.0
    Replies: 2
    Last Post: 1st November 2012, 06:46 PM
  2. Counter Help
    By spiderjjr45 in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 18th August 2008, 02:52 AM
  3. Adding to counter with 2 negated events?
    By Dynamite in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 26th January 2008, 10:40 AM
  4. Bug : Counter bar
    By Sphax in forum Multimedia Fusion 2 - Technical Support
    Replies: 0
    Last Post: 14th December 2006, 09:35 PM
  5. Adding to a counter
    By Herriot2 in forum The Games Factory 2 - Technical Support
    Replies: 3
    Last Post: 6th September 2006, 04:33 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
  •