User Tag List

Results 1 to 8 of 8

Thread: Array and dimensions.

  1. #1
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export ModuleSWF Export ModuleXNA Export Module

    Join Date
    Mar 2010
    Location
    Lier, Norway
    Posts
    276
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Array and dimensions.

    Hi,

    I have a game with 200 levels and I want to store 3 different values for each level.
    I am totally new to this, so can anyone help me out with what to put in the array settings?

    Any help is highly appreciated =)

  2. #2
    Forum Moderator

    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,773
    Mentioned
    12 Post(s)
    Tagged
    0 Thread(s)
    Use the array object. In the properties set for 3 dimensional. This will give you x,y,z in the array.

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

  3. #3
    Clickteam Clickteam
    LB's Avatar
    Join Date
    Jun 2007
    Location
    Richardson, Texas, North America
    Posts
    8,937
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    Marv, why three dimensional? He only needs three values for each of 200 levels, aka 200 x 3, isn't that only two dimensional?
    Working as fast as I can on Fusion 3

  4. #4
    Clicker Fusion 2.5 Developer

    Join Date
    Jul 2008
    Location
    UK
    Posts
    1,393
    Mentioned
    16 Post(s)
    Tagged
    0 Thread(s)
    If you have 200 levels with 3 values for each, you need a 2-dimensional array - so you'd use the expressions read to / write from XY, and you'd set the X, Y and Z dimensions to 200, 3 and 1 respectively.
    Having said that, arrays are automatically resized as needed, so I normally just set all three dimensions to 1.
    If you're only storing values, you should set the array type to "number array".
    The "Base 1 Index" option just sets whether the dimensions start at 1 or 0 - it doesn't make much difference, but I usually set it to 0, just because fastloop loop indexes start from 0.

    eg. ValueAtXY( "Array", >Level_Number<, >Value_Number<)

  5. #5
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export ModuleSWF Export ModuleXNA Export Module

    Join Date
    Mar 2010
    Location
    Lier, Norway
    Posts
    276
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    So,

    X dimension: 200
    Y dimension: 3
    Z dimension: 1
    Numeric array
    Base 1 index

    Is this right?

  6. #6
    Clickteam Clickteam
    LB's Avatar
    Join Date
    Jun 2007
    Location
    Richardson, Texas, North America
    Posts
    8,937
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    Yes. The Base 1 index option is up to you, however - whichever way makes it easier for you to understand. In this case I think starting it at one makes more sense due to levels not normally starting at level 0 in level-based games.
    Working as fast as I can on Fusion 3

  7. #7
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export ModuleSWF Export ModuleXNA Export Module

    Join Date
    Mar 2010
    Location
    Lier, Norway
    Posts
    276
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Thanks a lot! This works great =)

  8. #8
    Forum Moderator

    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,773
    Mentioned
    12 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by LB View Post
    Marv, why three dimensional? He only needs three values for each of 200 levels, aka 200 x 3, isn't that only two dimensional?
    You're right LB.

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

Similar Threads

  1. How fast is Array object in massive dimensions? (thousands x thousands)
    By Tsun in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 21st November 2011, 12:16 PM
  2. Dimensions in binary array
    By keokeo in forum Multimedia Fusion 2 - Technical Support
    Replies: 10
    Last Post: 4th May 2011, 11:59 PM
  3. Backdrop dimensions?
    By Bornemix in forum Extension Developers Lobby
    Replies: 2
    Last Post: 7th December 2009, 08:16 AM
  4. object dimensions
    By westray in forum Multimedia Fusion 2 - Technical Support
    Replies: 7
    Last Post: 6th April 2007, 06:18 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
  •