User Tag List

Results 1 to 8 of 8

Thread: Global Array

  1. #1
    No Products Registered

    Join Date
    Jul 2012
    Posts
    17
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Global Array

    I need to be able to save onto the same global array a position on the X dimension so that I can lock levels on the level select screen until the player has beat the level before it.


  2. #2
    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)
    You can use the Array object and just load the array file, change the value, and save it back. On the first frame it will need to be created for the first time if it doesn't exist.
    Working as fast as I can on Fusion 3

  3. #3
    No Products Registered

    Join Date
    Jul 2012
    Posts
    17
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by LB View Post
    You can use the Array object and just load the array file, change the value, and save it back. On the first frame it will need to be created for the first time if it doesn't exist.
    I don't think you understand what I mean. Basically:


    1. Global array with X dimension being 15 for 15 levels

    2. Writes position on X dimension to show which levels have been beaten

    3. Loads position on level select screen to lock/unlock levels


    I'm encountering a difficulty with #2 as the event editor will not recognize the global array for me on frames other than the one that the array is on. Yes, I have selected global array. I need to know how to change the position of the X dimension from other frames.

  4. #4
    No Products Registered

    Join Date
    Jul 2012
    Posts
    17
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Oh shoot, I'm such a n00b...

    Array FILE, gotcha.

    Except I don't. Could you give me a quick rundown of how to use that?

  5. #5
    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)
    Making the array global only works until the player closes the game. So,to counteract this you need to have the array load/save a file.

    Step 1: Make a global string "Array Filename" that will contain the filename of the array, such as progress.arr (any extension you want). This way you can just change the global value and it will reflect the change everywhere in your code.

    Step 2: Using the File object on the first frame, check to see if the array file exists yet. If it doesn't, use your array object to save a no-levels-unlocked array for starters.

    Step 3: After the above events on the first frame, load the array and see which levels are unlocked and display them.

    Step 4: When they unlock a new level, load the array, mark the new level as unlocked, and then save the array back.

    That should do it!
    Working as fast as I can on Fusion 3

  6. #6
    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 toastersburnthings View Post
    I don't think you understand what I mean. Basically:


    1. Global array with X dimension being 15 for 15 levels

    2. Writes position on X dimension to show which levels have been beaten

    3. Loads position on level select screen to lock/unlock levels


    I'm encountering a difficulty with #2 as the event editor will not recognize the global array for me on frames other than the one that the array is on. Yes, I have selected global array. I need to know how to change the position of the X dimension from other frames.
    LB is spot on. IMHO

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

  7. #7
    No Products Registered

    Join Date
    Jul 2012
    Posts
    17
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks, you guys are real lifesavers! Now if I can only get this done in the next 2 days...

  8. #8
    Clicker Fusion 2.5 DeveloperiOS Export Module
    GameMaker2019's Avatar
    Join Date
    Jul 2012
    Location
    U.S.
    Posts
    87
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I have been trying working with Global values to unlock levels. I have the Global value change after each level so the next one is unlocked. The problem is that if the player clicks to replay the first level, it re-locks the unlocked levels.

    I don't understand how the Global array works that you mentioned above, are there any examples? I have searched everywhere for tutorials from start to finish on this and I can't find anything.

    Thanks

Similar Threads

  1. Global array
    By K1kk0z90 in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 14th July 2011, 03:43 PM
  2. Global Array Test
    By nivram in forum File Archive
    Replies: 1
    Last Post: 6th March 2009, 01:17 AM
  3. Global array and sub app problem
    By Hernan in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 6th August 2007, 12:54 PM
  4. Two Global Array Objects
    By drnebula in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 31st August 2006, 11:48 AM
  5. Global Array
    By Altsaxofon in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 31st July 2006, 01:47 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
  •