User Tag List

Results 1 to 10 of 10

Thread: Why doesn't MMF have arrays?

  1. #1
    Clicker

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleSWF Export Module
    Konidias's Avatar
    Join Date
    Aug 2009
    Posts
    1,546
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)

    Why doesn't MMF have arrays?

    Okay, I might be asking a stupid question here... but why doesn't MMF have it's own built in arrays, that work like most programming languages? It seems like it would be far easier to save chunks of data that way.

    The method I'm referring to is having an numerical array stored like this:

    nameofarray[0,2,5,33,59,10,5]

    Then you can access it by saying nameofarray[2] which would give back the value 5 (as it counts up from 0)

    If you wanted to save data to the array, it would be just as easy. Like nameofarray[2] = 8, would set the 3rd value to 8.

    This seems like a far more simple solution than having to store to x,y 2 dimensional arrays and have to keep track of what each x,y is referring to.

    Strings would work the same way: nameofstringarray["string","another","anotherone"]

    MMF seems to be all about simplicity so I'm just wondering what's up with this.

  2. #2
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCSWF Export Module
    Alonso's Avatar
    Join Date
    Jul 2006
    Posts
    681
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Why doesn't MMF have arrays?

    Well, you can have one, two or three-dimensional arrays. It doesn't seem hard to me to access this information. In my opinion, the simplicity you're referring to is quite similar to the way arrays work currently. The method you suggest does not offer a better solution for keeping track of things--I mean to say, you'd still have to keep a log of each slot to understand what they mean.

  3. #3
    Clicker

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleSWF Export Module
    Konidias's Avatar
    Join Date
    Aug 2009
    Posts
    1,546
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)

    Re: Why doesn't MMF have arrays?

    Yes, but you have to name it by a number. The simplicity comes from being able to do something like itemlist[2]="Sword" instead of write value "Sword" to 1,2 or something.

    I'm just finding it hard to keep tracking items and stats and such using a two dimensional array because I have to keep a separate txt document with all of the names of what each number represents. When it should be simple enough to do it right inside MMF.

    It would also make choosing a random value from an array extremely easy, as you could do something like "itemlist[Random(5)]"

  4. #4
    Forum Moderator Fusion 2.5 DeveloperHTML5 Export Module
    Chaos's Avatar
    Join Date
    Aug 2006
    Location
    Burnsville, MN, USA
    Posts
    806
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Re: Why doesn't MMF have arrays?

    Isn't that what the assArray does? I havent used it at all but I thought that's why it was well liked... ?

  5. #5
    Clicker

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleSWF Export Module
    Konidias's Avatar
    Join Date
    Aug 2009
    Posts
    1,546
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)

    Re: Why doesn't MMF have arrays?

    As far as I can tell you can only set one value to each key that you name. Unless I'm mistaken.

  6. #6
    No Products Registered

    Join Date
    Jun 2006
    Location
    Land of raging rockets
    Posts
    1,231
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Why doesn't MMF have arrays?

    Nothing keeps you from naming multiple keys similarly. Not sure about the assArray, but that's how I'd do it with the Named Variable Object.
    E.g.:

    NVO("Sword") = "Huge sword of bashing"
    NVO("SwordDamage") = 30
    NVO("SwordSpeed") = "very fast"

    Or if you want a list of items:

    NVO("Inventory01") = "Sword"
    NVO("Inventory02") = "Potion of drunkenness"
    NVO("Inventory03") = "Single sock"
    NVO("Inventory04") = "Fancy hat of wizardry"

    Then you can go and retrieve a random item like so:
    GetString("NVO", "Inventory0"+Str$(Random(4)))

    That's of course a bit simplified, but I'm sure you get the idea.


    MMF is not exactly a programming tool. So you can't expect everything built in that you'd find in your average programming solution.
    If you have a motorbike you don't expect three backseats either


    Oh, by the way - have you tried the.. uh.. Array Object yet?
    You can do faaaancy things like:

    > Array: Write String "Sword" to (0)
    > Array: Write String "Axe" to (1)
    > Array: Write String "Banana" to (2)

    mystring = StringAtX( "Array", Random(3))

    Now rename Array to "ItemList" and guess what it resembles..

  7. #7
    No Products Registered

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

    Re: Why doesn't MMF have arrays?

    MMF has heaps of array extensions already... Its easy to save and read data from a certain slot in an array. Plus if you use AssArray or other object you can store by key instead.
    If you want a programming langauge you could look into LUA however data structures in that is still different to what you want anyway

  8. #8
    Clicker Multimedia Fusion 2SWF Export Module

    Join Date
    Sep 2006
    Posts
    1,544
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    Re: Why doesn't MMF have arrays?

    MMF merely has different syntax and implementation, treating arrays as 'objects' within the level editor, rather than as hardcoded imaginary constructs. You can still have full functionality that other programming languages would provide with their arrays, but there might be more overhead

  9. #9
    Clicker

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleSWF Export Module
    Konidias's Avatar
    Join Date
    Aug 2009
    Posts
    1,546
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)

    Re: Why doesn't MMF have arrays?

    These replies are helpful, thanks guys. But Pixelthief is right, there's still going to be more overhead than most programming languages in terms of stuff like this. I guess it's a fair trade off seeing as how MMF is so easy to use for most everything else. I guess it's just wishful thinking.

    I really should look into LUA and implementing that into MMF... is there any tutorials or instructions on how to do that? I'm sure I can figure it out on my own but any help is appreciated. Thanks.

  10. #10
    No Products Registered

    Join Date
    Jun 2006
    Location
    Land of raging rockets
    Posts
    1,231
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Why doesn't MMF have arrays?

    Quote Originally Posted by Konidias
    is there any tutorials or instructions on how to do that?
    yes. Should be included with the extension.

Similar Threads

  1. ini's or arrays
    By Bigfoot in forum iOS Export Module Version 2.0
    Replies: 1
    Last Post: 15th November 2011, 10:24 PM
  2. Arrays?
    By legocacher in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 23rd April 2010, 02:49 PM
  3. Arrays
    By Jafa in forum Multimedia Fusion 2 - Technical Support
    Replies: 11
    Last Post: 22nd August 2009, 11:28 PM
  4. Arrays
    By Nick in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 12th June 2007, 06:53 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
  •