Why doesn't MMF have arrays?

Welcome to our brand new Clickteam Community Hub! We hope you will enjoy using the new features, which we will be further expanding in the coming months.

A few features including Passport are unavailable initially whilst we monitor stability of the new platform, we hope to bring these online very soon. Small issues will crop up following the import from our old system, including some message formatting, translation accuracy and other things.

Thank you for your patience whilst we've worked on this and we look forward to more exciting community developments soon!

Clickteam.
  • 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.

    Please login to see this link.

    My examples:
    Please login to see this link.
    Please login to see this link.
    Please login to see this link.

  • 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.

    Please login to see this link. - Metroidvania RPG (Win/OSX/linux & PS4/Vita/Wii U)

  • 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)]"

    Please login to see this link.

    My examples:
    Please login to see this link.
    Please login to see this link.
    Please login to see this link.

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

    Please login to see this link.

    My examples:
    Please login to see this link.
    Please login to see this link.
    Please login to see this link.

  • 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..

    <span style="font-style: italic">&quot;I'm not saying you don't know what you are talking about, but I don't know what you're talking about.&quot;</span>

  • 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

    previously know as bigredron

  • 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

  • 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. :)

    Please login to see this link.

    My examples:
    Please login to see this link.
    Please login to see this link.
    Please login to see this link.

  • Quote from Konidias

    is there any tutorials or instructions on how to do that?

    yes. Should be included with the extension.

    <span style="font-style: italic">&quot;I'm not saying you don't know what you are talking about, but I don't know what you're talking about.&quot;</span>

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!