User Tag List

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

Thread: Is it possible to reduce the Array object size?

  1. #1
    Clicker 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)

    Join Date
    Feb 2007
    Posts
    82
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Is it possible to reduce the Array object size?

    Hey people.

    Okay, using the standard array object is it possible to reduce the array size?

    I can increase the array size by adding one to the dimension etc.

    But once I've added to the array, I can't reduce the size of the array.

    example. I've got a little level editor, say I make a level, increase the board size up to 7by7, do some editing, but then reduce the board down to 5x5 and try to save it.

    Currently, it saves out the 7by7 array as I had increased it to that.

    I've tried clearing the array etc, but that just appears to write 0's into it. I want to physically reduce the array size.

    Anyone know how to do that?


    My current thinking (which may be crazy) is to have 2 arrays. A working array, then when I choose to save, write that array into the saving array. I should be able to specify the X and Y dimensions to write into that array, so any adjustments in the working array won't be carried over to the save array.

    Does that sound like a good approach? or is there a much simpler way to do this? Like, being able to reduce the array size.

  2. #2
    Forum Moderator

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export ModuleXNA Export ModuleInstall Creator Pro
    nivram's Avatar
    Join Date
    Jul 2006
    Location
    Bandon, Oregon
    Posts
    6,773
    Mentioned
    12 Post(s)
    Tagged
    0 Thread(s)

    Re: Is it possible to reduce the Array object size?

    Once you increase the size of the array,that what it is and can not not be reduced. I do not know about using 2 arrays. It may be possible to save the values into the main array, but it would still be saved as a 7X7 array. If you do not need it to be that large, set the dimensions 5X5 in the properties and save it.

    Marv
    ​458 TGF to CTF 2.5+ Examples and games
    http://www.castles-of-britain.com/mmf2examples.htm

  3. #3
    Clicker 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)

    Join Date
    Feb 2007
    Posts
    82
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Is it possible to reduce the Array object size?

    Yeah. I've just implemented a 2nd array setup.

    It does work. sort of.

    I set up fast loops to run through the working array's X,Y and write the value to the X,Y of the saving array.

    I can set the number of loops to be the board X and Y, so I can specify how much I want to copy into the Saving Array. Which expands as is needed.

    So I can then load that array back in and it all works. I can be making a large level, then reduce the board down to a small section and save that out to the saving array and load it up.

    The only problem is, I can only do it once per application run, because the Saving array has now been increased in size. So I'd have to restart the application to be able to do it again. Unless I can destroy and create arrays and be able to apply the actions to the new one.

    Like a man wearing a t-shirt too small for him, the array has been stretched and won't fit the smaller boards now.



    So it looks like that isn't the solution.
    I think a better way would be to save the Array X & Y dimension Values into the array (probably in the first available Z dimension)

    Then I can load the array, check in the Z Dimension for the X & Y board dimensions (which can be smaller than the actual X&Y dimensions) then use those values to set the number of fastloops in creating the board.

    Hrmmm. I think that's the way to go. Such a lot of hastle all because you can't shrink the array.

  4. #4
    No Products Registered

    Join Date
    Mar 2007
    Location
    Sydney, Australia
    Posts
    1,369
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Is it possible to reduce the Array object size?

    You can clear arrays. Clear the saving array first before you pass values into it.
    problem solved.

  5. #5
    Clicker 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)

    Join Date
    Feb 2007
    Posts
    82
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Is it possible to reduce the Array object size?

    I've been doing that.

    So you're saying that if I clear the array, it should shrink back down from (7x7) to it's original size (2x2) and not just reset all the values in the array to 0.?

    That's what I want to happen, but so far, that's not what has been happening.

    I will have to setup a test to see.





    It may be that it was only clearing the array on group activation. And if the groups activated already it doesn't get re-activated.

    I had tried changing this over to if a Variable was set, but it didn't seem to work properly.

    However, I had just recently put in some code to make it disable the group once it was done, meaning that it can be re-activated each time and so should work.

  6. #6
    Forum Moderator

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export ModuleXNA Export ModuleInstall Creator Pro
    nivram's Avatar
    Join Date
    Jul 2006
    Location
    Bandon, Oregon
    Posts
    6,773
    Mentioned
    12 Post(s)
    Tagged
    0 Thread(s)

    Re: Is it possible to reduce the Array object size?

    BREK, even if you clear the array it will still 7X7.

    Marv
    ​458 TGF to CTF 2.5+ Examples and games
    http://www.castles-of-britain.com/mmf2examples.htm

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

    Join Date
    Oct 2006
    Location
    In a Dark room with only a lamp
    Posts
    367
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Is it possible to reduce the Array object size?

    why not use the file object to delete the array before saving it??

  8. #8
    Clicker Fusion 2.5 DeveloperHTML5 Export ModuleSWF Export ModuleInstall Creator Pro
    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
    Jul 2006
    Location
    USA
    Posts
    2,982
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    Re: Is it possible to reduce the Array object size?

    Quote Originally Posted by nivram
    BREK, even if you clear the array it will still 7X7.

    Marv
    Yeah pretty sure it just sets the array to all 0's but doesn't actually do anything with the dimensions of the array.

  9. #9
    Clicker Multimedia Fusion 2 DeveloperSWF Export Module

    Join Date
    Jun 2006
    Posts
    6,773
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Re: Is it possible to reduce the Array object size?

    Use a different Array object!

  10. #10
    No Products Registered

    Join Date
    Oct 2006
    Location
    Sweden
    Posts
    1,141
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Is it possible to reduce the Array object size?

    If the array has been expanded Destroying and Recreating it should reset it's dimensions.

Page 1 of 2 1 2 LastLast

Similar Threads

  1. Unable to reduce my app size
    By mobichan in forum iOS Export Module Version 2.0
    Replies: 6
    Last Post: 17th May 2012, 06:49 AM
  2. Can you change the size of an array during runtime
    By Iwantmyrpg in forum Multimedia Fusion 2 - Technical Support
    Replies: 14
    Last Post: 3rd February 2009, 03:29 AM
  3. Fraction Reduce
    By LB in forum File Archive
    Replies: 0
    Last Post: 10th March 2008, 10:22 PM
  4. Array size?
    By Horn in forum Multimedia Fusion 2 - Technical Support
    Replies: 0
    Last Post: 28th December 2006, 10:03 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
  •