User Tag List

Results 1 to 7 of 7

Thread: Ini file non-existent: prevent "Continue Game"

  1. #1
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)
    Wodjanoi's Avatar
    Join Date
    Jun 2015
    Location
    Germany
    Posts
    650
    Mentioned
    5 Post(s)
    Tagged
    0 Thread(s)

    Ini file non-existent: prevent "Continue Game"

    How can I prevent "Continue Game"(jump to the main game frame) when the ini file is non-existent?

  2. #2
    Forum Moderator Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleSWF Export ModuleXNA Export Module
    ProdigyX's Avatar
    Join Date
    Jan 2011
    Posts
    1,194
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    The logic you are going after should be something akin to this:

    1. I need to be able to detect if my ini file exists.
    - if it does exist, then there's probably save game data which means the player can continue. (allow Continue Game)
    - if it does not exist, then there's not save game data which means the player must start new (prevent Continue Game)

    So as you can see all you would need to do is find some object which can detect if a certain file exists. The File Object is one of a few objects which can do just this. The File Object has a condition which tests to see if a given file exists.

    So what you would do in MMFusion is this

    Code:
    + My file EXISTS
    - Let player start new game
    - Let player continue from existing game
    Code:
    + My file DOES NOT EXISTS
    - Let player start new game

  3. #3
    Clicker Fusion 2.5 DeveloperiOS Export Module
    butterfingers's Avatar
    Join Date
    Apr 2012
    Location
    London
    Posts
    135
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    You can do this without an additional object.

    The first time you save data, write a value to the ini like
    exist=1

    In your main menu,
    compare2.jpg

    If it returns 1, then the file exists.
    If the file doesn't exist, it'll return a 0, because there's no value to read from.

  4. #4
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)
    Wodjanoi's Avatar
    Join Date
    Jun 2015
    Location
    Germany
    Posts
    650
    Mentioned
    5 Post(s)
    Tagged
    0 Thread(s)
    Thanks butterfingers.
    I'll use your method.

  5. #5
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleXNA Export ModuleUnicode Add-on
    mobichan's Avatar
    Join Date
    Oct 2007
    Location
    Buffalo, NY
    Posts
    3,265
    Mentioned
    25 Post(s)
    Tagged
    0 Thread(s)
    I tend to use Butterfingers approach as well. But you have to remember to create the ini file (either automatically save it on the first frame with set values or bundle a premade ini in BinaryData).

  6. #6
    Clicker Fusion 2.5 DeveloperiOS Export Module
    butterfingers's Avatar
    Join Date
    Apr 2012
    Location
    London
    Posts
    135
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    I'm interested as to why you need to create it in advance. I only use the Win runtime, so apps might be different.

    If the behaviour you want is this:
    ini exists because there's save data - show continue button
    ini doesn't exist becuase there's no save data - hide continue button.
    you can just do:
    if getinivalue=1 then show Continue button
    if getinivalue=0 then hide Continue button

    There's no need to create the ini in advance. Just create it the first time you save data. Up until that point getinivalue will return 0 so the button will be hidden

  7. #7
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleXNA Export ModuleUnicode Add-on
    mobichan's Avatar
    Join Date
    Oct 2007
    Location
    Buffalo, NY
    Posts
    3,265
    Mentioned
    25 Post(s)
    Tagged
    0 Thread(s)
    I guess you are right. I have just gotten into the habit of creating my ini at runtime in a "Setup" frame before the app proper is loaded. This is mainly a practice I have adopted for iOS development, since I had issues with external files long ago. The exporter probably doesn't cause the issues anymore.

    But if you plan to use the ini to store global values, you most likely won't have a scenario where it returns 0. And this could be an issue if the player data is just part of the data in the ini. Although in that scenario, you could create a single ini expressly used for this check alone. You can ignore me now... ^_^'

Similar Threads

  1. Replies: 6
    Last Post: 18th August 2015, 02:23 AM
  2. "Load text file" from "The Edit Object" BUG?
    By MOBii in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 19th December 2013, 05:43 AM
  3. Pressing the "F2" key and Choosing "New" From the File Menu Aren't the Same (bug)
    By redpandagames in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 10th October 2012, 06:42 AM
  4. Little "Shift" and "Ctrl" signs popping up in-game
    By Jocastus in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 18th January 2009, 10:08 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
  •