User Tag List

Page 1 of 3 1 2 3 LastLast
Results 1 to 10 of 29

Thread: Resizable array?

  1. #1
    Clicker Multimedia Fusion 2Install Creator Pro
    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
    Jan 2010
    Posts
    86
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Resizable array?

    I was wondering what's the easiest way to do an array that can be resized at runtime *and* saved to a file?
    Or would I be better off using the binary object and multiplying to get the position I need? (It would be 3 dimensions, with the first and second dimensions being of variable size while the third is of a fixed size)

  2. #2
    No Products Registered

    Join Date
    Jun 2006
    Posts
    625
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Resizable array?

    mmf's built-in array can be resized at runtime, is up to 3 dimensions and has save/load too.

    to resize it, just use an out of bound index, it will be extended. To reduce it I think you'll have to recreate it...

  3. #3
    Clicker Multimedia Fusion 2Install Creator Pro
    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
    Jan 2010
    Posts
    86
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Resizable array?

    Yeah, that's the thing... files have the potential to get huge QUICKLY, so they need to be shrinkable...
    I didn't know it could auto-resize though, so I could probably if worst comes to the worst find a way to work with that (maybe copy into a second one that won't expand beyond the needed size, then save from that one?)

  4. #4
    Clickteam Clickteam
    LB's Avatar
    Join Date
    Jun 2007
    Location
    Richardson, Texas, North America
    Posts
    8,937
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)

    Re: Resizable array?

    Quote Originally Posted by Namida
    maybe copy into a second one that won't expand beyond the needed size, then save from that one?
    Yeah that's what you're suppost to do. Just make sure you only copy non-zero values or the array size will stay the same.
    Working as fast as I can on Fusion 3

  5. #5
    Clicker Multimedia Fusion 2Install Creator Pro
    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
    Jan 2010
    Posts
    86
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Resizable array?

    Thanks. =)
    Although, I could easily find the size that's meant to be copied from other sources, so I'd just have to only read up to that point.

  6. #6
    Clickteam Clickteam
    LB's Avatar
    Join Date
    Jun 2007
    Location
    Richardson, Texas, North America
    Posts
    8,937
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)

    Re: Resizable array?

    Yeah but an undefined value takes less file space and memeory than a value defined as 0.
    Working as fast as I can on Fusion 3

  7. #7
    Clicker Multimedia Fusion 2Install Creator Pro
    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
    Jan 2010
    Posts
    86
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Resizable array?

    No, what I meant is... set the initial size of the new array to 1,1,4 (since the 3rd dimension will always have a size of 4), then, say, if it's meant to be up to 30 by 30 but at one point it was 40 by 40, it'll only copy the values up to 30 by 30. This 30 by 30 size can be found from other sources, of course.

  8. #8
    Clicker Multimedia Fusion 2Install Creator Pro
    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
    Jan 2010
    Posts
    86
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Resizable array?

    I've decided to avoid all this trouble by using the Binary object. I've come up with algorithms for resizing and finding the right point to move to, and it has the added advantages of being able to store other data before and/or after the main level data (what the array would've stored), as well as using bytes rather than longs which reduces output filesize.

  9. #9
    Clickteam Clickteam
    LB's Avatar
    Join Date
    Jun 2007
    Location
    Richardson, Texas, North America
    Posts
    8,937
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)

    Re: Resizable array?

    Keep in mind, the range of a byte is only 0 to 255. (Or -128 to +127)
    Working as fast as I can on Fusion 3

  10. #10
    Clicker Multimedia Fusion 2Install Creator Pro
    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
    Jan 2010
    Posts
    86
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Resizable array?

    Well aware of that, but thanks anyway. =) Considering my limited graphics ability, I don't think I'll need more than 255 tiles per layer, especially since it has 5 layers. While layer 3 is technical data (and thus won't be displayed at all during play, only in the editor) and layer 4 is active objects, the other 3 layers are for regular tiles, and having a different tileset on each one is fully supported - allowing for a potential 510 different tiles that will always appear behind objects, and 765 altogether.

Page 1 of 3 1 2 3 LastLast

Similar Threads

  1. Dynamic Array - Sort 2 dimension array by Column 1
    By Ryan in forum Multimedia Fusion 2 - Technical Support
    Replies: 0
    Last Post: 16th December 2012, 04:54 AM
  2. Array... help!
    By Aasland in forum iOS Export Module Version 2.0
    Replies: 10
    Last Post: 12th April 2012, 01:14 AM
  3. resizable swf
    By Pompos in forum Multimedia Fusion 2 - Technical Support
    Replies: 7
    Last Post: 17th October 2011, 11:12 AM
  4. Dynamic Array to Binary Array problems
    By BREK in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 22nd March 2010, 10:48 PM
  5. [Request] Array of array - possible for $$$
    By Blizna in forum Extension Development
    Replies: 9
    Last Post: 29th December 2007, 11:13 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
  •