User Tag List

Results 1 to 9 of 9

Thread: how to get a value

  1. #1
    Forum Moderator

    Fusion 2.5 MacFusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export ModuleMac Export ModuleInstall Creator Pro
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)
    Perry's Avatar
    Join Date
    Dec 2013
    Location
    Watertown, WI
    Posts
    4,334
    Mentioned
    49 Post(s)
    Tagged
    0 Thread(s)

    how to get a value

    When I have a counter, that's going to be a random number,
    how can i set it so the value can only be a even number

    it's basically a wheel that spins and is slowing down after some time, but can only stop on even even numbers. (due to the images in the active. The oneven numbers are shifted images)

  2. #2
    Clicker Fusion 2.5 MacFusion 2.5 DeveloperHTML5 Export ModuleiOS Export ModuleInstall Creator Pro
    Fusion 2.5 (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)Universal Windows Platform Export Module (Steam)
    ratty's Avatar
    Join Date
    Apr 2012
    Posts
    1,114
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    how to get a value

    I needed a similar function once and had a separate value set to a random number. If it was odd, add 1. Then set that value to the spinner counter. I can never remember if "=mod 1" is odd or =mod 2".

  3. #3
    Forum Moderator

    Fusion 2.5 MacFusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export ModuleMac Export ModuleInstall Creator Pro
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)
    Perry's Avatar
    Join Date
    Dec 2013
    Location
    Watertown, WI
    Posts
    4,334
    Mentioned
    49 Post(s)
    Tagged
    0 Thread(s)
    Here is an example, of what I am trying to accomplish, so it needs to end on the uneven frames (1,3,5....47)
    Attached files Attached files

  4. #4
    Clicker Fusion 2.5 DeveloperAndroid 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)
    Popcorn's Avatar
    Join Date
    Jun 2006
    Location
    Norway, Bergen
    Posts
    2,344
    Mentioned
    11 Post(s)
    Tagged
    0 Thread(s)
    Even numbers from 0 to 8:
    ( ( RRandom(0, 8 ) ) / 2 ) * 2

    Odd numbers from 1 to 9:
    ( ( ( RRandom(1, 9 ) ) / 2 ) * 2 ) + 1

  5. #5
    Forum Moderator

    Fusion 2.5 MacFusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export ModuleMac Export ModuleInstall Creator Pro
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)
    Perry's Avatar
    Join Date
    Dec 2013
    Location
    Watertown, WI
    Posts
    4,334
    Mentioned
    49 Post(s)
    Tagged
    0 Thread(s)
    Thanks Popcorn, let me see if i can implement that somehow in my code

    problem is that i only know the value (the frame number)at the end when the counter hits 0, if the frame number is even or uneven. and then from that point I need to change the value.
    I won't know that in the beginning

  6. #6
    Forum Moderator

    Fusion 2.5 MacFusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export ModuleMac Export ModuleInstall Creator Pro
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)
    Perry's Avatar
    Join Date
    Dec 2013
    Location
    Watertown, WI
    Posts
    4,334
    Mentioned
    49 Post(s)
    Tagged
    0 Thread(s)
    ok figured it out

    value( "Counter 5" ) mod 2 = 0 // even
    value( "Counter 5" ) mod 2 = 1 // Uneven

  7. #7
    Forum Moderator

    Fusion 2.5 MacFusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export ModuleMac Export ModuleInstall Creator Pro
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)
    Perry's Avatar
    Join Date
    Dec 2013
    Location
    Watertown, WI
    Posts
    4,334
    Mentioned
    49 Post(s)
    Tagged
    0 Thread(s)
    ok, thought i got it to work, but i guess not.

    problem is in the last event, when i use the Mod. I can't seem to get to work after that event hits.
    I must be missing the obvious here.
    Attached files Attached files

  8. #8
    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
    Apr 2007
    Location
    Australia
    Posts
    1,151
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Why not just check if the value( "Counter 5" ) mod 2 "is different to" 0?

  9. #9
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleMac Export Module
    dsilvers's Avatar
    Join Date
    Jun 2008
    Location
    Boston, MA
    Posts
    521
    Mentioned
    9 Post(s)
    Tagged
    0 Thread(s)
    Yeah make sure you set it to be Greater than 0 or you'll run into some problems, especially before the spinner has set a number and is presumably set to 0.

Posting Permissions

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