User Tag List

Results 1 to 6 of 6

Thread: Array Object Help

  1. #1
    No Products Registered

    Join Date
    Oct 2009
    Posts
    480
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Array Object Help

    Hi,

    Recently I've been working on a project that requires an array. I've been having trouble reading and writing data to and from arrays, and I was wondering where I could find some examples on how to use the Array object. I know this is a really simple question, and I appreciate the help.

    -Thanks, Variant

  2. #2
    Clicker

    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,720
    Mentioned
    8 Post(s)
    Tagged
    0 Thread(s)

    Re: Array Object Help

    Hi. On my website I have an open source "World Editor" that writes and reads from an Array. Maybe this will give you some idea how this is done.

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

  3. #3
    No Products Registered

    Join Date
    Oct 2009
    Posts
    480
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Array Object Help

    Sorry, but I don't have the String Parser or Associative Array extensions. I'm looking for an example of just the Array object. And I still only have the demo version so I don't have any bonus packs yet.

    -Variant

  4. #4
    Clicker

    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,720
    Mentioned
    8 Post(s)
    Tagged
    0 Thread(s)

    Re: Array Object Help

    Ok, I understand.

    This is based on a level editor:

    You are wanting to make a level editor using an array.

    Solution:
    Place the Array Object in your frame. In the Event Editor, select "Write Value to X". In the Expression Editor, write in the value your are going to save (health, level and etc). Press "OK". The array will ask for the X index.

    Arrays are set up like this:
    X:[0] [1] [2] [3] (index 0, index 1, index 2, index 3 and so on. Each index can store 1 value in it. So you could store the level in index 1, some else in 2 and so on.

    When you want to save your game:

    (Your event that triggers the save)
    Array: Write Global Value A to (0)
    Write Global Value B to (1)
    Save Array to apppath$+"mygame.sav (or where ever you want to save it)

    When you want to load your game:

    (Your event that triggers the load)
    Array: Load Array from apppath$+"mygame.save (or where ever you saved it)
    Global Values: Set Global Value A to ValueAtX("array",0)
    Set Global Value B to ValueAtX("array",1)

    Since you can have unlimited Global Values (see Global Values) you can do this with trees, rocks and so forth. Use active objects and once they are loaded use:

    Paste object into background
    Destroy

    This would insure that your tree would stay in place if you have, for an example, a scrolling game.

    Hope this helps.

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

  5. #5
    No Products Registered

    Join Date
    Oct 2009
    Posts
    480
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Array Object Help

    Oh, thanks yet again nirvam, I figured it out.

    -Variant

  6. #6
    Clicker

    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,720
    Mentioned
    8 Post(s)
    Tagged
    0 Thread(s)

    Re: Array Object Help

    Thanks. Glad you got it sorted.

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

Similar Threads

  1. [BUG] Array object can't load if the INI object exists in any frame before it
    By happygreenfrog in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 15th August 2013, 06:17 AM
  2. Listview and Array-Object...
    By Jahkri in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 6th August 2011, 05:26 PM
  3. Array Object
    By olltwit in forum SWF/Flash Export Module Version 2.0
    Replies: 7
    Last Post: 28th February 2011, 07:09 PM
  4. Array object...
    By Almightyzentaco in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 12th March 2009, 03:37 PM
  5. Map Array Object
    By DistantJ in forum Extension Development
    Replies: 7
    Last Post: 23rd January 2008, 03:23 AM

Posting Permissions

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