User Tag List

Results 1 to 5 of 5

Thread: Save the current value of counter even if application closes

  1. #1
    No Products Registered

    Join Date
    Jul 2015
    Posts
    110
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Save the current value of counter even if application closes

    What i'm trying to do is, there's a counter that slowy adds to itself, it goes from 1 to 2, to 3, to 4, 5 and 6. but if the player closes the game, and return, the counter will start from the last value it got.


    let's say i'm playing the game. the counter got to 3. i close the game, return later, now it starts from 3 instead of 1.

  2. #2
    Forum Moderator Fusion 2.5 DeveloperHTML5 Export ModuleiOS Export ModuleSWF Export Module
    DavidN's Avatar
    Join Date
    Jun 2006
    Location
    Boston, MA, USA
    Posts
    4,044
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You'll want to use one of the objects that can save data - such as the INI object - to save the value of the counter. Take a look at some of the examples included with MMF to learn how it works.

    I think there's an "End of application" condition that you could use to trigger the save, but if you really want to avoid people tampering with the counter by quitting the game by ending the process or something, you'll want to save the current value fairly regularly (but not in an "Always" event! Writing to disk is one of the most time-consuming operations you can do in a game.)

  3. #3
    No Products Registered

    Join Date
    Jul 2015
    Posts
    110
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'll check the examples out. i know how to use the INI and FILE object, but i don't see anything to save global values.

    yes, i forgot to mention the counter i'm talking about is a global value.

  4. #4
    Forum Moderator Fusion 2.5 DeveloperHTML5 Export ModuleiOS Export ModuleSWF Export Module
    DavidN's Avatar
    Join Date
    Jun 2006
    Location
    Boston, MA, USA
    Posts
    4,044
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You can put the two concepts together Write the global value to the INI by using the action "Set value (group, item)" on the INI object. Then enter the group and item name to save under, and when prompted for the value to save, enter Global Value A - or whatever the name of your global value is.

  5. #5
    Clicker Fusion 2.5Android Export Module
    hamdi369's Avatar
    Join Date
    Feb 2015
    Location
    Strasbourg France
    Posts
    123
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If it's for a Windows application, you can too use the registery and store your data in registery

Similar Threads

  1. Application force closes after alarm.
    By animdude in forum Android Export Module Version 2.0
    Replies: 6
    Last Post: 22nd October 2013, 01:51 PM
  2. Sub-application closes on frame change... why?
    By TheHellRazer in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 4th July 2013, 02:33 AM
  3. Sub-application closes on frame change... why?
    By TheHellRazer in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 2nd July 2013, 03:46 PM
  4. MMF2 Build 254 closes when opening an application.
    By MikeB in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 30th March 2012, 10:58 PM
  5. [BUG] Layer object: action closes application
    By Ls2 in forum Android Export Module Version 2.0
    Replies: 0
    Last Post: 6th November 2011, 03:19 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
  •