User Tag List

Results 1 to 10 of 10

Thread: Filter the active with the lowest alterable value. Can it be done?

  1. #1
    Clicker

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export Module
    AlanRuno's Avatar
    Join Date
    May 2013
    Posts
    336
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Filter the active with the lowest alterable value. Can it be done?

    I'm looking to filter an active which have the lowest value on a given alterable value.
    Is there a way to do that?
    I heard there was an extension for it, but it doesn't work now.

    Has anyone done that?

  2. #2
    Clicker Fusion 2.5 DeveloperSWF Export Module
    N64Mario's Avatar
    Join Date
    Nov 2008
    Location
    USA
    Posts
    1,306
    Mentioned
    15 Post(s)
    Tagged
    0 Thread(s)
    all active objects start their alterable values to 0.

    If you add multiple instances of that same object, you could do this in event editor:
    Run This Event Once -> [Active] -> Spread Value 0 in Alterable Value A

    For every object you add in frame editor, that Alterable Value A will be different.

    For the final bit, all you would do in event editor is something like this:
    [Active] Alterable Value A = 0 -> [Do your function here]

  3. #3
    Clicker

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export Module
    AlanRuno's Avatar
    Join Date
    May 2013
    Posts
    336
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    So the function Spread Value 0 will add floating point numbers to alterable value?
    And the Alterable Value A = 0 will select the active with the lower floating point value?
    That's what I understand from what you're saying..

    My actives have an alterable value named ID which can be from 1000 to 2,000,000.
    Sometimes I would have 3 to 4 actives with ID's 4200,4202,4028,4240.. etc.
    I need to select the one with the lowest value, like a queue.

    I could use queue object instead, but it isn't available for Android, so I use objects like a queue.
    But the order can't be set right.

  4. #4
    Clicker Fusion 2.5 DeveloperiOS Export ModuleSWF Export Module
    Sumo's Avatar
    Join Date
    Jul 2008
    Posts
    642
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Filter the active with the lowest alterable value. Can it be done?

    Can I ask why you have ID numbers from 2000 to 2,000,000? That sounds like a ridiculous number and the max number of objects in a frame can only be 20,000. Also if you're building for Android, I doubt you'd hit this max without dealing with slowdown.

    To find the lowest alterable value, you should use ForEach loops. A ForEach loop will go through each object in the loop and will test for each one individually. Therefore during the ForEach loop you should compare the objects current ID to the saved lowest ID you have checked so far. If that objects ID is lower than the saved ID, update your saved ID to the new lowest ID. When the ForEach loop is finished going through all the objects, your final saved ID number will be the lowest. Then you can compare to that number to specifically choose that object.

    -------

    Just to clarify about the spread values, no it does not use floating point values (numbers past decimals). It uses regular whole numbers. Spread values will start at the number you specify. Then for each instance (copy, not clone) of the object, it will add 1 to the spread value and record it in the alterable value. Therefore you can have different ID numbers separating your instances of an object.

    Sent from my iPhone using Tapatalk

  5. #5
    Clicker

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export Module
    AlanRuno's Avatar
    Join Date
    May 2013
    Posts
    336
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Hey Sumo, the IDs are representative only, it doesn't mean I have 2million objects on my game.
    I have max 10 objects that change ID's on the run while they are used.
    But the Id's come from a database.

    What you suggest it's a good Idea, I was hoping to avoid fast loops, but If I can't find any other way to do the same, the Ill do it that way.

  6. #6
    Clicker Fusion 2.5 DeveloperiOS Export ModuleSWF Export Module
    Sumo's Avatar
    Join Date
    Jul 2008
    Posts
    642
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    ForEach loops are super simple and will calculate your lowest ID object instantly. Let me know if you need more help, I can whip up an example when I get home from work.


    Sent from my iPhone using Tapatalk

  7. #7
    Clicker

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export Module
    AlanRuno's Avatar
    Join Date
    May 2013
    Posts
    336
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Thanks, I'll try it, and see if I don't get a slowdown. I'll keep you updated.

  8. #8
    Clicker Fusion 2.5 DeveloperiOS Export ModuleSWF Export Module
    Sumo's Avatar
    Join Date
    Jul 2008
    Posts
    642
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Here's a quick example. If you have 10 objects max, then this shouldn't cause any slowdown at all.
    Attached files Attached files

  9. #9
    Clicker Fusion 2.5 Developer

    Join Date
    Feb 2014
    Posts
    962
    Mentioned
    16 Post(s)
    Tagged
    1 Thread(s)
    thats an awesome example sumo, that method might come in handy for me in the future

  10. #10
    Clicker Fusion 2.5 (Steam)
    GamerH2's Avatar
    Join Date
    Jul 2015
    Location
    Brazil
    Posts
    129
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Why not use the select object?

Similar Threads

  1. Array vs Active's Alterable Vars?
    By mobichan in forum Fusion 2.5
    Replies: 2
    Last Post: 30th September 2016, 07:10 PM
  2. Replies: 4
    Last Post: 13th June 2015, 01:36 PM
  3. [BUG] Active Object Alterable Strings
    By Bipolar_Games in forum Android Export Module Version 2.0
    Replies: 0
    Last Post: 3rd June 2012, 04:36 PM
  4. Graphics Filter, Audio Filter, and Transition SDK
    By kraminator in forum Extension Development
    Replies: 7
    Last Post: 27th March 2011, 08:40 PM
  5. Pick object with lowest alterable value
    By stuckboy in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 29th March 2009, 04:32 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
  •