User Tag List

Results 1 to 6 of 6

Thread: get every second number from range

  1. #1
    Clicker 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)
    anatol's Avatar
    Join Date
    Jun 2016
    Posts
    140
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)

    Unhappy get every second number from range

    A have this "code"
    ---------------
    * Always
    + some_value of OBJECT = 0
    + id of OBJECT >=1
    + id of OBJECT <=100

    DO = set another_value of OBJECT = 2

    -----------------

    I want to receive from this range some kind of this = " 1. 3. 5. 7" and so on... So every second OBJECT in range from 1 to 100 receive 2 in "another_value"
    is this possible ?

  2. #2
    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)
    Add another condition:

    + (id of OBJECT) mod 2 = 0

    This will check if the id is a multiple of 2. Unfortunately you need to use the Compare 2 General Values expression to do the comparison so you will probably have to do this comparison inside a loop to guarantee object scoping is correct.

    I would also try to not use the Always expression. Just apply the value once and then toggle a flag on or something to "mark" that object as having been processed.

  3. #3
    Clicker Fusion 2.5 DeveloperHTML5 Export ModuleiOS Export ModuleUnicode Add-onInstall Creator Pro
    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
    Jul 2006
    Posts
    574
    Mentioned
    9 Post(s)
    Tagged
    0 Thread(s)
    The always condition in that event is also pretty redundant. Removing it functions the same, as you're testing for a value. While that is true it acts like always.

  4. #4

  5. #5
    Clicker 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)
    anatol's Avatar
    Join Date
    Jun 2016
    Posts
    140
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by mobichan View Post
    Add another condition:

    + (id of OBJECT) mod 2 = 0

    This will check if the id is a multiple of 2. Unfortunately you need to use the Compare 2 General Values expression to do the comparison so you will probably have to do this comparison inside a loop to guarantee object scoping is correct.

    I would also try to not use the Always expression. Just apply the value once and then toggle a flag on or something to "mark" that object as having been processed.
    Compare 2 General Values - bad idea. Because i work with duplicates

  6. #6
    Clicker 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)
    anatol's Avatar
    Join Date
    Jun 2016
    Posts
    140
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    Solved with help of the mighty LOOPs

Similar Threads

  1. Replies: 0
    Last Post: 15th March 2014, 06:36 AM
  2. Multiply a number in a range
    By PunchyBog in forum Fusion 2.5
    Replies: 6
    Last Post: 8th March 2014, 11:46 AM
  3. Multiply a number in a range
    By PunchyBog in forum Android Export Module 2.5
    Replies: 0
    Last Post: 9th February 2014, 06:32 PM
  4. Getting a random number between a negative and positive number
    By D_Light in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 9th January 2013, 10:51 PM
  5. Random Number Range + Not allowed to repeat
    By Renatos in forum Multimedia Fusion 2 - Technical Support
    Replies: 7
    Last Post: 4th August 2012, 06:39 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
  •