User Tag List

Page 1 of 2 1 2 LastLast
Results 1 to 10 of 13

Thread: Best alternative to 'Active Object' for storing more than 26 'named' values?

  1. #1
    Clicker Multimedia Fusion 2 DeveloperiOS 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)
    King_Cool's Avatar
    Join Date
    Aug 2008
    Posts
    2,335
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Best alternative to 'Active Object' for storing more than 26 'named' values?

    Hi
    Ive run across an old problem.
    1a - I need to load about 50+ values from a File, and store them inside 1 Object in Fusion
    1b - It would be a pluss if this Object could also store a few strings
    2 - I would want this Object to be, if possible, compatible across ALL ( if not most ) runtimes
    3 - I would want to be able to name each data placeholder, like you do with 'Active Objects Alterable Values':

    - If AltVal "House" = 0 -> Action
    - If AltVal "House" = 1 -> Action
    - If AltVal "Village" = 0 -> Action
    - If AltVal "Village" = 1 -> Action
    - If AltVal "City" = 0 -> Action
    - If AltVal "City" = 1 -> Action
    - ...

    ^ This looks alot cleaner, and its much easier for me to scan my code and find Conditions of interest, especially as the example above is hightly simplified in contras to what im working with:

    - If Index0 = 0 -> Action
    - If Index0 = 1 -> Action
    - If Index1 = 0 -> Action
    - If Index1 = 1 -> Action
    - If Index2 = 0 -> Action
    - If Index2 = 1 -> Action
    - ...

    I quickly scanned through the Extencion Manager, but couldnt find anything fitting.

    Anyone know an Extencion/ Object i can use that fills requirements 1 through 3?
    Or is my best option to use multiple ( 2 - 4 ) Active Objects, or settle for the List or Array Object?

  2. #2
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform 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)
    DaveC's Avatar
    Join Date
    Jun 2007
    Location
    Perth, Australia
    Posts
    2,117
    Mentioned
    13 Post(s)
    Tagged
    0 Thread(s)
    you could just use Global Values / Global Strings?

  3. #3
    Clicker Fusion 2.5 DeveloperiOS Export ModuleSWF Export Module
    Ryan's Avatar
    Join Date
    Nov 2008
    Location
    Australia
    Posts
    1,275
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    There is this
    http://community.clickteam.com/threads/69007-Advanced-Global-Values-Object

    But for cross platform compatibility I recommend just using two active objects or global variables as Dave C suggests.

    You could also use the array object and write your own lookup table in a text file to help remember what is what.

    Also Ini / Ini++ object is great for this kind of thing, you can refer to values by their names and load/save them to files easily.

  4. #4
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export Module
    Fusion 2.5 (Steam)
    schrodinger's Avatar
    Join Date
    Nov 2014
    Posts
    3,155
    Mentioned
    27 Post(s)
    Tagged
    1 Thread(s)
    I don't get why you can't use a single active object,
    oh - I get it, because of 3), you want to assign a name to all values.

    You could setup a cross-value list object for matching names with values index,
    and always use this passage each time you need to access a value:

    get value for "town" -->
    AltValN( "active_value_holder", FindStringExact( "list", "town", -1)) = 0/1

    Also, if all your values are just binary data,
    and you need <= 255 of them,
    you could consider using flags in the same way

  5. #5
    Forum Moderator Fusion 2.5 DeveloperHTML5 Export ModuleiOS Export ModuleSWF Export Module
    DavidN's Avatar
    Join Date
    Jun 2006
    Location
    Boston, MA, USA
    Posts
    4,044
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    INI++ or the Named Variable Object (less compatible) would let you store as many variables/strings as you need and organize them in names and groups, and save and load them directly... do the values need to specifically be stored on an active object?

  6. #6
    Clicker Multimedia Fusion 2 DeveloperiOS 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)
    King_Cool's Avatar
    Join Date
    Aug 2008
    Posts
    2,335
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    No, doesnt need to be an Active specifically.
    But doesnt the INI/ INI++ need to summon an external file where the values are actually stored, or can they just be store within the INI itself without invoking any external file?

    Schrodinger, your suggestion sounds interesting but i dont understand the system you are describing right away

  7. #7
    Forum Moderator Fusion 2.5 DeveloperHTML5 Export ModuleiOS Export ModuleSWF Export Module
    DavidN's Avatar
    Join Date
    Jun 2006
    Location
    Boston, MA, USA
    Posts
    4,044
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    INI directly reads and writes to a file - INI++ and Named Variable store their data in memory and can load/save when asked to.

  8. #8
    Clicker Multimedia Fusion 2 DeveloperiOS 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)
    King_Cool's Avatar
    Join Date
    Aug 2008
    Posts
    2,335
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hmmm, both of them only work on Windows runtime and thats a deal breaker

  9. #9
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export Module
    Fusion 2.5 (Steam)
    schrodinger's Avatar
    Join Date
    Nov 2014
    Posts
    3,155
    Mentioned
    27 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by King_Cool View Post
    Schrodinger, your suggestion sounds interesting but i dont understand the system you are describing right away
    If you need to store a "name" for better code reading
    I was suggesting setting up a list object
    (or, if you need additional reading speed, an Array)
    as a "inbetween step" for storing the names for those values.

    Like, in the list object:

    line - text
    0 - House
    1 - Village
    2 - City
    [...]
    50 - Town

    Then, say you need to retrieve "City" value,
    in the expression editor, instead of using Altval "City"
    you would use:
    AltValN( "active_value_holder", FindStringExact( "list", "City", -1))

    This would return
    Alt Val Number ("of your active object", GiveMeTheNumberOfRow("in the list object", relative to string "City", search from the beginning of the list)


    (although reading in your events:
    If AltValN( "active_value_holder", FindStringExact( "list", "City", -1)) = 0/1
    is significantly worse than reading:
    If AltVal "City" = 0/1
    )


    (I can setup a quick example if this new wording is of little help)

    EDIT: oh, and you can also write those values dynamically,
    using the "expression" button when choosing the alt. value to modify,
    and feeding in the same expression as above

  10. #10
    Clicker Fusion 2.5 DeveloperiOS Export ModuleSWF Export Module
    Ryan's Avatar
    Join Date
    Nov 2008
    Location
    Australia
    Posts
    1,275
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    INI works on iPhone/Flash/Android/HTML5

    I think this is basically what you need, it would cut out the middle-man of having to read/write files using other methods

Page 1 of 2 1 2 LastLast

Similar Threads

  1. Alternative to active blood splatter?
    By Albertogc5 in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 16th September 2015, 08:12 PM
  2. cloned active object string storing
    By bubba_damage in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 7th May 2011, 04:03 AM
  3. Using named alterable values globally
    By Digitalic in forum Multimedia Fusion 2 - Technical Support
    Replies: 22
    Last Post: 14th June 2010, 09:01 PM
  4. Named Flags for Active Objects?
    By LazyCoder in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 23rd May 2007, 09:59 PM
  5. Storing Decimal Numbers as Alterable Values
    By Raphael in forum Multimedia Fusion 2 - Technical Support
    Replies: 9
    Last Post: 21st September 2006, 02:17 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
  •