User Tag List

Page 1 of 2 1 2 LastLast
Results 1 to 10 of 13

Thread: How to load data into an Array

  1. #1
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export Module
    rubes's Avatar
    Join Date
    May 2011
    Posts
    364
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How to load data into an Array

    I am currently trying to make a Random Name Generator. I am using two single dimensional arrays. Array 1 is the first name, and array2 is the last name. I would like to click a button and then choose a random entry from array 1 and array 2. This is similar to the beginning of the game worms where one can randomly generate names for the worms.

    I have this fully functioning, however, in order to populate the data in the arrays, I needed to use the tutorial in the Power Users Guide to Windows Dev, to create and save each new record. THen i copy/renamed the array and moved it to the work directory i am working in. There must be an easier way.

    Does anyone have some pointers into how to load a comma delimited file into an array string?

    thanks in advance,
    rubes

  2. #2
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export Module
    rubes's Avatar
    Join Date
    May 2011
    Posts
    364
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How to load data into an Array

    By mentioning i am using the array object probably indicates that I am using MMF 2 Developer, but if not, that is the software I am using

  3. #3
    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,729
    Mentioned
    9 Post(s)
    Tagged
    0 Thread(s)

    Re: How to load data into an Array

    There is a Random Name Generator Extension you can use.

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

  4. #4
    Clicker Multimedia Fusion 2 DeveloperSWF Export Module
    RickyRombo's Avatar
    Join Date
    Mar 2008
    Location
    Somewhere between here and there
    Posts
    3,167
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How to load data into an Array

    http://www.clickteam.com/epicenter/ubbthreads.php?ubb=showflat&Number=231250#Post2312 50

    Hooray for self advertising!

    This is precisely why I made the PresetArray object.

  5. #5
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export Module
    rubes's Avatar
    Join Date
    May 2011
    Posts
    364
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How to load data into an Array

    I am not familiar with that extension, but this is some basic funtionality that I would like to master without that extension (if it is possible). I'm looking thru the tutorials from your link Marv, quite an impressive number.

  6. #6
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export Module
    rubes's Avatar
    Join Date
    May 2011
    Posts
    364
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How to load data into an Array

    OK, this seems to be what I am looking for. It took a little bit of set up tweeking, and let me ask you if these settings seems correct:

    Width:10
    Height: 1
    Array: Jonny,Jane,Robert,Lisa,Ken,Jordan,Melissa,Chris, Debbie,Rick,Extra
    Delimiter: ,

    I have a button w/a click event that sets a Static Text box text with this formula:
    ValueAt$( "Preset Array", Random(10), 0)

    I am currently just looking for a single dim array, however, in the future i would like to do first & last names at random, and was going to do 2 separate single dim arrays. Would you suggest that or a 2 dimensional array? If 2, could you help w/how the logic works?

    You guys are so fast and helpful, it is really helping me get up to speed.

  7. #7
    Clicker Fusion 2.5 Developer

    Join Date
    Jul 2008
    Posts
    1,305
    Mentioned
    14 Post(s)
    Tagged
    0 Thread(s)

    Re: How to load data into an Array

    I made this:
    http://www.create-games.com/download.asp?id=8360

    It can load XML spreadsheet files generated in Excel / OpenOffice / etc, and convert them to MMF2's own array format (and vice versa).

    This has the big advantage that you can use 3-dimensional arrays, whereas .csv arrays are limited to 2-dimensions, which is seldom, if ever enough.

    Also, MMF2 arrays are smaller and can't be edited with a simple text editor (making it a little harder for players to cheat).

  8. #8
    Clicker Multimedia Fusion 2 DeveloperSWF Export Module

    Join Date
    Jun 2006
    Posts
    6,773
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Re: How to load data into an Array

    I must be missing something. What's the difference between Preset Array and String Tokenizer?

  9. #9
    Clicker Fusion 2.5 Developer
    ChrisStreet's Avatar
    Join Date
    Jul 2006
    Location
    United Kingdom
    Posts
    568
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How to load data into an Array

    Can't you use the List object, hidden? Create a text file with lots of names, load it in the list object, assign each line a number and use a random number generator to pull out the assigned name?

  10. #10
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export Module
    rubes's Avatar
    Join Date
    May 2011
    Posts
    364
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How to load data into an Array

    MuddyMole, that looks awesome. I've downloaded it and will be using that in the future.

    Jamie, I'm not familiar w/the String Tokenizer, but will read up on it.

    ChrisStreet, I found a tutorial on Marv's site that does just this thing, but haven't had a chance to play with it.

    I know I'll be using arrays a lot in the future (at i believe I will), so I'm practicing some concepts right now. Being so new, I'm not familiar with all of the techniques nor extensions available (or where to find them).

    I want to thank everyone who has been commenting. You are a warm bunch, with lots to share. I cannot believe the quickness of the responses on this forum.

    I'm sure I'll have more questions as I poke around and study everything

Page 1 of 2 1 2 LastLast

Similar Threads

  1. Save/Load external Array
    By Fanotherpg in forum SWF/Flash Export Module Version 2.0
    Replies: 7
    Last Post: 6th May 2012, 11:31 AM
  2. Array with data shifting?
    By BloxMaster in forum Multimedia Fusion 2 - Technical Support
    Replies: 0
    Last Post: 13th October 2011, 04:18 PM
  3. array as binary data
    By SoftWarewolf in forum iOS Export Module Version 2.0
    Replies: 10
    Last Post: 22nd August 2011, 07:14 PM
  4. array doesn't load certain objects
    By Oreo in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 21st December 2008, 02:01 AM
  5. Array Save/ Load problems
    By RageO in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 23rd May 2007, 05:32 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
  •