Welcome to our brand new Clickteam Community Hub! We hope you will enjoy using the new features, which we will be further expanding in the coming months.

A few features including Passport are unavailable initially whilst we monitor stability of the new platform, we hope to bring these online very soon. Small issues will crop up following the import from our old system, including some message formatting, translation accuracy and other things.

Thank you for your patience whilst we've worked on this and we look forward to more exciting community developments soon!

Clickteam.
  • I am working on a small inventory app for my business - I would love to create a "filter" to search for objects within specific parameters.. I've been able to achieve this "filter" ability by grouping certain objects together with qualifiers..
    My problem, is that I need to create more groups than the number of available qualifiers that come with fusion.

    Is there any workaround? Or any way to creat custom groupings without relying on the predefined qualifiers?

    Thanks!

  • I believe casleziro is indicating you could use an alterable variable, title it group, and then assign numerical values for your groups to that alt variable. You could then use a for each loop or fast loop to cycle through and find the particular group number you are looking for.

  • Here as an example that uses a master qualifier for condition filtering, and Alterable Value comparisions for fine grained grouping.

    Where this has limits is you'd start to run into issues with one-to-many qualified groupings. Say one object needed to be in group 20, and 35, and 81. I've seen this sort of thing achieved with bitwise operators but I'm not sure how you'd do that here.

    You could maybe use a numbering->string->string parsing method to use each digit as an exclusive group control but that's a bit goofy huh. How many objects do you need to belong to multiple groups?


    Please login to see this attachment.

  • Alterable values are inappropriate in this situation. Please use alterable strings instead--they'll make your life much easier. Rename Alterable String A on all of your actives with a qualifier (if needed) to Type, and then whenever you create an object with this qualifier, you must define its type. When you want to find this object again, find it through the alterable string Type much the name you want. For Each loops probably aren't even going to be necessary here.

    Good luck!

  • With numbers you can create subsets though if you are careful.
    For instance there are database tables that have the capability of sorting by decimal keys.

    Imagine you have 3 items, A B C
    the ID of A = 0.0
    the ID of B = 0.5
    the ID of C = 1.0

    Now you want to insert D in such a way that D can be included in neighbor based subsets relative to A and B
    the ID of A = 0.0
    the ID of D = 0.25
    the ID of B = 0.5
    the ID of C = 1.0

    You can now select any number of sets based off of value range assessment. ID <=1.0 selects all, ID <>0.25 selects all but D, ID <= 0.25 selects A,D.
    This pattern can also be subdivided practically infinitely. If you plan your sets properly I think this can have some special use.

    BUT, all told, Snail is right. string based is a lot better suited to associative array style name sets. The above really has specific applications that probably aren't relevant, I just like discussing theory.

  • Alterable values are inappropriate in this situation. Please use alterable strings instead--they'll make your life much easier. Rename Alterable String A on all of your actives with a qualifier (if needed) to Type, and then whenever you create an object with this qualifier, you must define its type. When you want to find this object again, find it through the alterable string Type much the name you want. For Each loops probably aren't even going to be necessary here.

    Good luck!

    This is a great idea!

    Current Projects:
    Please login to see this link., Goober's World, NDA Publisher Agreement

  • Do we know if the app is PC only? In that case he could use associative arrays to manage not only qualifiers, but which objects with unique IDs belong to each qualifier. This would allows for as many multi-qualifier relationships as would be needed without any weird work-arounds. That could require fastlooping depending on the operation but it shouldn't be too sluggish.

  • Thank you all for your help!

    Man, even the famous Snail pitched in?!? I've seen all of your videos man - great stuff - thank you so much for taking the time to help out the community like that!

    I haven't had a chance to fire up fusion and play around with this today, so I haven't been able to test out everyones ideas.

    BossRighteous - to answer your question, this is something I actually plan on doing in HTML5, as I would love to add it to my website for customers to be able to search. In terms of your question earlier (how many items would need to belong to multiple groups?) - a lot.
    To give you a rough idea of what I'm trying to do - Imagine a used car dealership with an inventory app - you could filter the inventory results by: the color of the car, the cars manufacturer, 2 door, 4 door, under $5k, under $10k, under $20k, etc..
    As you can see, there would be multiple items that would occupy multiple "groups" - A ford taurus might be categorized in "4 door" "ford" "under $20k" etc.

    I'm trying to create this same basic idea but for a different industry with different products. I don't want to give away too much, as there is nothing like this currently on the market for this particular industry ;)

  • This is actually very true! I agree that isn't always applicable, but my own practice is to use two or three strings: Class (this is the one that I skip sometimes), type, name, and then an alterable value called Object ID, and possibly one more called Unique Object ID. Unique gets incremented every time an object is created (basically an alternate fixed value), and I usually use Object ID for sets of objects.

    I'm glad that my videos have been helpful. :) Regarding your specific situation, you're going to run into some other tricky issues. The first is that Fusion only has 13 alterable strings and 26 alterable values per object. Because of the specificity you need, I recommend switching to an array and using the object IDs to match the rows in the array. That is, at the start of the frame, run a loop that iterates through the array. Every time it runs, create an object based on the data in that row and assign it an Object ID of the current row number (the index of the loop +1). You'll have to manually create a look-up index for the array (a guide that tells you what the Y indexed cells are for) but you shouldn't need to use it after you set up the object creation stuff.

  • ^^^^^^
    This is smart. Arrays could be paired with IDs to great effect.

    ------

    In that case, yes, the alterable value/string methods should work. You just need to make sure all of your objects share the same alterable value ordering and each 'attribute' is defined.

    Make and Model could be Alterable Strings
    Door Count and Price could be Alterable Values, etc

    If these objects were then in the same qualifier group, or just different instances of the same object itself it would work fine. You'd hit problems when the amount of attributes is large, unknown, or inconsistent between objects.

    I would say that MySQL and PHP would really be best for these sorts of relational queries if you eventually want to take it into HTML anyway. If you could figure out the php to run queries you could use the GET object request the data from the server for display in fusion. If the number of attributes are somewhat limited, and the number of objects are limited I suppose Fusion may be okay for the data handling. SQL is just so optimized for this sort of task. This is easy for me to say because I am much better with PHP/MySQL than I am with Fusion, so someone else chime in too.

  • Thanks for the reminder! Give me a minute. This: Please login to see this attachment.

    Some guidelines here you should always follow when you're working with arrays for this type of purpose:

    1. The object data always comes from the array, not from the object
    2. You should always use fast loops instead of for each loops
    3. Each object always needs at least one object ID
    4. You should always use as few alterable strings and values as possible
    5. All temporary data should always be stored in the object's extra variables and not in the array
    6. Building on 5, you should always store as little data as possible in the array
    7. You should always disable Create at Start for all objects
    8. Arrays get large fast; always perform as few dedicated array checks as possible
    9. Building on 7, that means you should always reference the array by an object's variables
    10. Object selection is fast; alway perform general array checks using Obj.var.[x] = Str$(stored in array)
    11. Building on 10, that means you should always avoid fast loops
    12. When destroying an object, always pass a value to it and then clear all relevant cells in the array in the same event as the destroy action

    Edited 6 times, last by Snail (July 2, 2014 at 8:59 AM).

  • (12) might be unclear. Let me elaborate: When you're using arrays like this, your objects are nothing more than pointers to cells in the array. There's no situation whatsoever--ever!--where the objects should know more about the frame state than what the array knows. So, with that in mind, (12) should suddenly become self-explanatory because the object couldn't have destroyed itself without retrieving the data from the array first (if the health in the array is <= 0, then the object knows this and subsequently destroys itself). So the object's variables should always match the variables in the array.

    When you use health, you should be retrieving that value directly from the array whenever you're updating variables. So,

    +Always
    -Set alterable value "Health" of Enemy to StratXY("Array", 1, 1)

    +Alterable value "Health" of Enemy is <= 0
    -Destroy Enemy
    -Clear all related cells in the array

    13. You should always clear the cells whenever you destroy the object since the array object is so old and mostly useless in its current state. Without the ability to sort or delete cells, you have to be extremely careful with how you handle arrays.

    14. Always set values in the array instead of the object; if both must change at the same time, always change the array's values first

    Edited 3 times, last by Snail (July 2, 2014 at 9:02 AM).

  • Many Thanks to you mr. Snail =D
    Awesome solution =D

    Please login to see this link.
    I remember one extension, you can aslo use Value-Add object which
    can also store unlimited number of variables :pacman:

    I am total noob, but want to make awesome games X)

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!