User Tag List

Results 1 to 6 of 6

Thread: preloading static data, confused about dynamic array

  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
    Aug 2020
    Location
    Canada
    Posts
    32
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question preloading static data, confused about dynamic array

    Hi everyone

    I was hoping someone could help me understand the dynamic array and maybe correct my understanding of the various other array type objects. I am just deciding which is best to use for given purposes.

    Purpose 1 - I want to have static data loaded at the start of the application to be referenced later:
    - objects (say, enemies, or items), an associated text description, various stat values and maybe some other info, mixed strings and values, to be called up as needed based on name. I was considering MagicDeque for this but I wonder if it gets really big what the speed implications would be.
    - events (like cards), each having a text description, a reference to which image to use on the in game object, and some other data. Also considering magicdeque here, with 1 "array" for each "event" and data for each held in a corresponding element.

    Purpose 2 - savegame purpose

    I will create a frame (not included in the application) just for me to load data into arrays from a CSV or INI, then save the array file to be loaded at runtime (so I can update the arrays myself as I add content, but the actual application will just load the premade array files). So my understanding of each object is as follows:

    The standard array I understand perfectly, xyz is easy to reference BUT it can't load data from common file types, so that's a big limitation as I would prefer to edit data in something like Excel and then import it.

    I'm leaning towards MagicDeque, because it can load from common file types and is easy to conceptualize (array = x, element pos. = y). However, not being able reference by key is a small inconvenience (would have to keep track of which # corresponds to which value. For instance array1 = monster 1 etc.

    Associative array seems good but is limiting in that it is essentially only a 1d array with a string and value for each element. I think it is incredibly useful for other purposes but probably not the ones I listed above.

    Now the one that is bending my mind: the dynamic array.
    + seems to be the most flexible, combining desirable features from all the other array type objects (associative keys, can have multiple dimensions, mixed string/value elements, load from common file types).
    + 3d array is technical easy to visualize however:
    - hurts my brain when I get into the event editor

    I am having trouble grasping the concept of the index position. For instance "insert value at" just wants a single index value. How do I know where (xyz? key?) Or what key? There appears to be some conversions for XYZ however it seems incredibly complicated to even perform a simple operation as "get string at". I feel like I am majorly lacking understanding of how this array (or maybe all arrays!) work here.

    Does anyone have a good example of how to use a dynamic array? Or can provide me a sort "explanation for idiots" . Is it more like a deck of cards, each containing a# of values/strings (one for each dimension?) I can't seem to wrap my mind around how to work with it. The documentation doesn't really help me out and I've read it thoroughly.

    Thanks in advance!

  2. #2
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export Module
    Janette5's Avatar
    Join Date
    Dec 2014
    Location
    Western Cape, SA
    Posts
    1,162
    Mentioned
    199 Post(s)
    Tagged
    0 Thread(s)
    Is there a reason you don't want to use the built in functions?

    In any object, for example an enemy, you can save multiple values and strings with the object. Fusion will automatically save those for you.

    One enemy can have multiple strings and values attached to it that gives it its functionality and description.

    For example, if enemy's alterable value a = 3, then use animation 3 - this will tell you which image to you.

    Anything you type into the enemy's values and strings as a default is automatically saved and there for you during the game. If you change them, then that is easy enough to save in an ini file or array file if necessary.

  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
    Aug 2020
    Location
    Canada
    Posts
    32
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Mostly so I can edit them outside of Clickteam in Excel Essentially creating a couple databases of "stuff in the game" so it is easier for me to add/remove/edit content. Also, the values on my enemy object will be populated from the data in the array. Since I only use 3-4 enemy objects at most at a time, it means I don't have to create a new object for each type of enemy when the "fighting screen" loads up.

    I started using the MagicDeque last night and it seems to be able to do what I want minus the 3rd dimension

    Mostly was looking for a "idiot's guide to the dynamic array"

  4. #4
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export Module
    Janette5's Avatar
    Join Date
    Dec 2014
    Location
    Western Cape, SA
    Posts
    1,162
    Mentioned
    199 Post(s)
    Tagged
    0 Thread(s)
    • Arrays cannot be edited in excel - the problem is that unlike ini files, they cannot be edited at all unless you search the web for software specifically designed to read them and install that.
    • The extension you're using only works in Windows so as long as the game you're writing is only for Windows and no other export module that's okay.
    • MagicDeque does have its own documentation that explains it - when you insert the object the settings screen pops up and there is a button "documentation".


    Basically using Fusion's array it would work like this:

    X field would be your 4 or 5 enemies,
    Y field would be their properties
    Z field would be if you needed to further define their properties

    For example
    Enemy 1, Uniform A, Blue, Green
    X1, Y1, Z1, Z2

    If you didn't need to further define any fields you'd stick with 2 -
    X1 = Enemy
    X1,Y1 = Uniform
    X1,Y2 = Strength
    X1,Y3 = Weapon
    X1,Y4 = Duration
    etc.

    I've not worked with
    MagicDeque because it is Windows only - but as far as I can tell the only advantage it has over Fusion's array is that you can insert fields into the middle of it. If you're pre-planning the game and setting out all the fields ahead of time, I don't see that you'd necessarily need that feature. Using Fusion's array would then be better as you can potentially port your game to other export modules.

  5. #5
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleUniversal Windows Platform Export ModuleSWF Export Module

    Join Date
    Jun 2014
    Posts
    66
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    It is actually possible to edit the content of a standard clickteam array using external software & it's even possible to then load an edited file (with Notepad or Excel or whatever) back into the array, but you will at some point need to convert between formats - and you'll probably have to set up this conversion system yourself.

    I'm pretty sure there's been some examples on clickteam related sites of applications that allow you read/edit arrays, I've downloaded at least 1 of those example MFAs from either here or Daily Click

    If you want to handle the conversion yourself, easiest way to do it is export the array as a .txt file via a Datagrid object, then you can edit it in whatever & then save it as a .txt & convert it back to an array.

    The Datagrid object can load/save in both .asc (ascii format) & .arr (Clickteam Array). It's possible to load/save directly in .txt (there's generic "load & "save" actions in the object where you can set the file extension yourself), but the output raw .txt when i exported it was impossible for me to decipher, so I don't recommend exporting raw .txt .

    What you can do is select the File >> "save .asc file" action, but use a blank/dummy .txt document as the actual filename, & you get a nicely formatted .txt repsentation of the array & from that point it's going to be easy to load the outputted file into another text editor. It's also easier to deal with if you go down the route of wanting to edit the array data from within your application itself.

  6. #6
    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
    Aug 2020
    Location
    Canada
    Posts
    32
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hey sorry for the late reply, thank you for all the helpful comments! Thanks to you guys I figured out a system I can work with

Similar Threads

  1. Shuffle an Array (Dynamic Array)
    By bad_rick in forum Guides, Tutorials, Examples, Widgets
    Replies: 0
    Last Post: 6th November 2017, 02:07 PM
  2. Confused about Binary Data & temporary filenames
    By Chrille in forum Fusion 2.5
    Replies: 14
    Last Post: 9th December 2014, 09:08 PM
  3. 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
  4. New static array module
    By Retriever2 in forum Lua Scripting
    Replies: 5
    Last Post: 6th May 2010, 07:50 AM
  5. 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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •