User Tag List

Results 1 to 6 of 6

Thread: Possible to scope objects while testing modulo?

  1. #1
    Clicker Fusion 2.5 MacFusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleiOS Export ModuleInstall Creator Pro
    Fusion 2.5 (Steam)
    elvisish's Avatar
    Join Date
    Oct 2014
    Posts
    699
    Mentioned
    15 Post(s)
    Tagged
    0 Thread(s)

    Possible to scope objects while testing modulo?

    I often use mod to test against counters to perform certain things at intervals, but it has to be done through "compare two general values", but is it possible to test mod on individual objects alterable values so each object can be scoped? I don't think it's possible in any way at present, so might it be considered as a feature request for some way of being able to do this?

  2. #2
    Clicker Fusion 2.5 Mac
    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)

    Join Date
    Jan 2015
    Location
    Australia
    Posts
    188
    Mentioned
    11 Post(s)
    Tagged
    0 Thread(s)
    Might not be the most ideal way to do it, but you could have an "Always" event that calculates the modulus and puts it in that object's alterable values.

    i.e. instead of using "IF (A + B) mod n == C" as a compare statement, you can do "IF object's alterable value == C" instead, which will scope the object correctly. I do this sometimes if I want to check an test against object's scale when there's multiple instances of it

  3. #3
    Clicker 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)
    Volnaiskra's Avatar
    Join Date
    Jan 2014
    Location
    www.sprykegame.com
    Posts
    2,297
    Mentioned
    94 Post(s)
    Tagged
    0 Thread(s)
    Not sure if this helps, but while "compare two general values" doesn't scope anything for subsequent conditions/actions, it does inherit scoping from preceding conditions. What this means is that you can combine it with a forEach loop to isolate a particular instance based on its modulo:


  4. #4
    Clicker Fusion 2.5Fusion 2.5+ DLC
    casleziro's Avatar
    Join Date
    Mar 2013
    Location
    United States
    Posts
    646
    Mentioned
    11 Post(s)
    Tagged
    0 Thread(s)
    Why not always set an alterable value of an object to (Value + 1) mod interval? Then below the event that increments the value check if value = 0 to tell it has reached the interval.

    example added.
    Attached files Attached files

  5. #5
    Clicker Fusion 2.5 MacFusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleiOS Export ModuleInstall Creator Pro
    Fusion 2.5 (Steam)
    elvisish's Avatar
    Join Date
    Oct 2014
    Posts
    699
    Mentioned
    15 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by marbenx View Post
    Might not be the most ideal way to do it, but you could have an "Always" event that calculates the modulus and puts it in that object's alterable values.

    i.e. instead of using "IF (A + B) mod n == C" as a compare statement, you can do "IF object's alterable value == C" instead, which will scope the object correctly. I do this sometimes if I want to check an test against object's scale when there's multiple instances of it
    Which part would go in "Always"? If I'm trying to scope a specific object (say an overlapping object or one within a certain distance of another) would this be a loop for each object and put it in every objects alt value?

    Quote Originally Posted by Volnaiskra View Post
    Not sure if this helps, but while "compare two general values" doesn't scope anything for subsequent conditions/actions, it does inherit scoping from preceding conditions. What this means is that you can combine it with a forEach loop to isolate a particular instance based on its modulo:

    That's really helpful to know, I'm not sure what kind of performance loss it would have looping through each, but it's interesting that scope can be found using "compare two", so if I had an Always adding +1 "clock" value on each of the object, and I wanted the object within a certain distance of the player to do something if it's "clock" was "mod 60 = 0" or something, I could just loop through all objects and test like that?

    Quote Originally Posted by casleziro View Post
    Why not always set an alterable value of an object to (Value + 1) mod interval? Then below the event that increments the value check if value = 0 to tell it has reached the interval.

    example added.
    I hadn't actually thought of separating the mod value and the check for 0 on two separate events, that's a good idea!

  6. #6
    Clicker Fusion 2.5 Mac
    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)

    Join Date
    Jan 2015
    Location
    Australia
    Posts
    188
    Mentioned
    11 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by elvisish View Post
    Which part would go in "Always"? If I'm trying to scope a specific object (say an overlapping object or one within a certain distance of another) would this be a loop for each object and put it in every objects alt value?
    Like this:


    "Always" can be replaced with whatever other condition you wanted, like the overlap or distance check you mentioned above, and line 3 will only scope objects where Value A mod 3==0

Similar Threads

  1. Flash: Angles and Modulo
    By King_Cool in forum SWF/Flash Export Module Version 2.0
    Replies: 2
    Last Post: 22nd June 2012, 07:26 AM
  2. Testing Position of Objects Using X and Y
    By Ryan9171 in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 26th March 2012, 07:18 PM
  3. modulo
    By Pixelthief in forum Multimedia Fusion 2 - Technical Support
    Replies: 6
    Last Post: 27th October 2010, 12:56 PM
  4. Testing all objects in same direction?
    By pirodaggar in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 18th April 2008, 07:36 PM
  5. Bug: Calul modulo
    By Sphax in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 17th November 2006, 10:20 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
  •