User Tag List

Results 1 to 8 of 8

Thread: Add values to Array without setting X and Y

  1. #1
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleSWF Export ModuleUnicode Add-on
    Boba Fonts's Avatar
    Join Date
    Jan 2009
    Location
    Northern Italy
    Posts
    228
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Add values to Array without setting X and Y

    I need to add values to an array as long as they show up in the game, but not at specific X,Y, I just need them to be added at the bottom of the "list" (actually I want the array to behave as a multiple global list object). Those values must be stored in one of the four columns - in this little picture I've labeled them with string titles but I don't necessarily need them to be "keys" of the Associative Array, those could be just numeric X 1, 2, 3, 4, so maybe the whole thing can be done with the normal Array Object.
    array.gif
    Basically, every "column" must behave as an independent list. I need to add values to the bottom of a specific X column, whatever the last Y "coordinate" is. If I use the action "Add 1 to Y dimension index" a new line is added to the bottom of the whole array "grid", not only to one column. How can I tell it to "search for the bottom value of a specific X column and then, if exists and is empty, store a value OR first add a new line and then store the value" ?
    thanks

  2. #2
    Clicker Fusion 2.5iOS 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)
    SolarB's Avatar
    Join Date
    Feb 2012
    Location
    Melbourne
    Posts
    904
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    Have you tried the Dynamic Array object? It has an 'append' function.

  3. #3
    Clicker Fusion 2.5 DeveloperiOS Export Module
    ChrisBurrows's Avatar
    Join Date
    May 2011
    Location
    Tasmania, Australia
    Posts
    622
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Using the normal Array Object, you can simply run a loop to find the first empty slot.

    I've made you an example.
    Attached files Attached files

  4. #4
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleXNA Export ModuleUnicode Add-on
    Fanotherpg's Avatar
    Join Date
    Jul 2006
    Location
    High Wycombe, Buckinghamshire, UK
    Posts
    3,663
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You van just use 4 arrays one per column.

  5. #5
    Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleXNA Export ModuleUnicode Add-onInstall Creator Pro

    Join Date
    Jun 2011
    Posts
    628
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    MMF2 array and list objects are good if you want save strings into it but if You want save int, double or float you can't use it becouse You need converted it into string and this is very slow. I will relase List object for numbers this should slove Your and some of my problems.

  6. #6
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleSWF Export ModuleUnicode Add-on
    Boba Fonts's Avatar
    Join Date
    Jan 2009
    Location
    Northern Italy
    Posts
    228
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks to you all and to Chris for the example file. Never tried the Dynamic Array before. I've used -as a temporary solution- 4 different normal arrays, one per column, just as Fanotherpg suggested. If I choose not to change what I've already done, could multiple arrays slow down the game? Now I have a total of 7 arrays for a great number of bonuses, weapons, data, etc.

  7. #7
    Clicker Fusion 2.5 DeveloperiOS Export Module
    ChrisBurrows's Avatar
    Join Date
    May 2011
    Location
    Tasmania, Australia
    Posts
    622
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    I doubt using 7 arrays will have any noticeable effect on the performance of your game. As for re-writing your code to use one single array, it depends on what you are trying to do; learn more efficient programming techniques or simply make the games you want. Both are very acceptable.

  8. #8
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleSWF Export ModuleUnicode Add-on
    Boba Fonts's Avatar
    Join Date
    Jan 2009
    Location
    Northern Italy
    Posts
    228
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Your mfa example is brilliant and I'm learning a couple of tricks right now!

Similar Threads

  1. Setting values in pairs?
    By Yikes in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 1st July 2012, 05:17 PM
  2. [Bug] Properties menu - Setting alterable values
    By MattEsch in forum Multimedia Fusion 2 - Technical Support
    Replies: 0
    Last Post: 1st March 2009, 01:30 AM
  3. setting values of activex controls
    By Chokito in forum Multimedia Fusion 2 - Technical Support
    Replies: 0
    Last Post: 31st August 2008, 12:06 AM
  4. Creating And Setting Values in one Line
    By Brandon in forum Multimedia Fusion 2 - Technical Support
    Replies: 0
    Last Post: 18th March 2008, 12:57 AM
  5. (Dynamic Array) Setting Keys & Bricks & Lighting
    By Doc4 in forum Multimedia Fusion 2 - Technical Support
    Replies: 11
    Last Post: 24th November 2007, 04:12 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
  •