User Tag List

Page 2 of 2 FirstFirst 1 2
Results 11 to 18 of 18

Thread: Remembering collected items and/or enemies killed

  1. #11
    Clickteam Clickteam

    Join Date
    Jun 2006
    Location
    France
    Posts
    14,022
    Mentioned
    279 Post(s)
    Tagged
    3 Thread(s)
    This applies to all Clickteam objects except sub-application. Probably some non-Clickteam objects support it too, I'll check. So yes for INI.

    You do not need to extract the files if the object supports embedded files.

    1. Usual case (INI, Array, List Box, Active Picture, etc), the object supports loading files directly from the EXE => the file won't be extracted when the object needs it, it will load it directly from the EXE.

    2. More rare case, the object supports embedded files but needs the file to be external => Fusion will extract the file when the object needs it, to a temp folder. This is the case for video objects (Direct Show, Active Direct Show, etc).

    In cases 1 or 2 you don't need to do anything.

    3. The object does not support embedded files => in this case you can extract the file yourself to a temporary file. You can use an action in the Special object to extract the file and retrieve the temp pathname, and an action to delete the file when you don't need it anymore (otherwise it's automatically deleted when the app ends).

  2. #12
    Clicker Fusion 2.5
    Tobias_Edvardsen's Avatar
    Join Date
    Jun 2015
    Location
    Drammen, Norway
    Posts
    33
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Yves View Post
    This applies to all Clickteam objects except sub-application. Probably some non-Clickteam objects support it too, I'll check. So yes for INI.

    You do not need to extract the files if the object supports embedded files.

    1. Usual case (INI, Array, List Box, Active Picture, etc), the object supports loading files directly from the EXE => the file won't be extracted when the object needs it, it will load it directly from the EXE.

    2. More rare case, the object supports embedded files but needs the file to be external => Fusion will extract the file when the object needs it, to a temp folder. This is the case for video objects (Direct Show, Active Direct Show, etc).

    In cases 1 or 2 you don't need to do anything.

    3. The object does not support embedded files => in this case you can extract the file yourself to a temporary file. You can use an action in the Special object to extract the file and retrieve the temp pathname, and an action to delete the file when you don't need it anymore (otherwise it's automatically deleted when the app ends).
    So if I understand you correctly; any user that launches my built application (.exe) won't have an .array file or .ini created and stored on their computer, regardless of what I do? I have an .array file located in my work folder, as well as an .ini file located in /AppData/Roaming/MMFApplications, but are these only created and stored by me running the .mfa for playtesting, or does it apply to the .exe as well? I have an own folder for .exe builds, and it seems the .exe creates an .array file in its directory too, in my case.

    Sorry if I make this confusing, I appreciate your help.

    Best regards,
    Tobias Edvardsen

  3. #13
    Clicker Fusion 2.5
    Tobias_Edvardsen's Avatar
    Join Date
    Jun 2015
    Location
    Drammen, Norway
    Posts
    33
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Also, thank you very much @Doverseer for your examples! They provided me valuable insight!

    Best regards,
    Tobias Edvardsen

  4. #14
    Clickteam Clickteam

    Join Date
    Jun 2006
    Location
    France
    Posts
    14,022
    Mentioned
    279 Post(s)
    Tagged
    3 Thread(s)
    Quote Originally Posted by Tobias_Edvardsen View Post
    So if I understand you correctly; any user that launches my built application (.exe) won't have an .array file or .ini created and stored on their computer, regardless of what I do? I have an .array file located in my work folder, as well as an .ini file located in /AppData/Roaming/MMFApplications, but are these only created and stored by me running the .mfa for playtesting, or does it apply to the .exe as well? I have an own folder for .exe builds, and it seems the .exe creates an .array file in its directory too, in my case.

    Sorry if I make this confusing, I appreciate your help.

    Best regards,
    Tobias Edvardsen
    What I said above is for read-only files, i.e. files that you only read from your application. Those files can be embedded in the EXE via the Binary Data tab.

    If you need to write to the file, then it has to be extracted to the user's machine (or simply created if you don't need to initialize it to default values), your app cannot write in its own EXE.

    For example if your app embeds a default array that you want to extract to the user's appdata folder the first time your app is executed, you have to do something like this:

    - test of the file already exists on the user machine (with a condition of the File object + expression that returns the pathname of the user's appdata/roaming folder)
    - if the file doesn't exist, extract it with the Extract Binary File action, get its temp pathname with the BinFileTempName$ expression, copy it to your app sub-directory in appdata/roaming (with the File object) (and then delete it from the temp folder)
    - make your array object load the file from appdata/roaming/etc.

    For the INI object, in theory it's a bit simpler and you haven't to extract the file manually, it's done automatically the first time you write a value to the INI file.

    Hopefully it's clear enough.

  5. #15
    Clicker Fusion 2.5
    Del_Duio's Avatar
    Join Date
    Sep 2008
    Location
    Cygnus X-I
    Posts
    944
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Doverseer View Post
    I made an example that uses an objects Fixed value with an Array recently. It should work with Enemies as well with a few small changes. Let me know if it helps. Check out the attachment from this post.

    https://community.clickteam.com/threads/107357-Loading-Destroying-an-active-on-frame-restart
    I used an array object as well. Basically you use the fixed value for your collectibles (I used a qualifier here) and when the guy picks one up that spot in an array object is updated to 1 (vs. 0 by default).
    It works BUT I found that sometimes if you put two or more collectibles too close together sometimes it won't register they were both picked up. As long as they're not super super close together you should be OK though.

  6. #16
    Clicker Fusion 2.5
    Del_Duio's Avatar
    Join Date
    Sep 2008
    Location
    Cygnus X-I
    Posts
    944
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Yves View Post
    Yes, just add them to the Binary Data Files tab in the Data Elements editor, they'll be included in the EXE. No need to change anything in the events (= still use Apppath$ + "arrayname" for example), and then you can redistribute your EXE alone without these files.
    Whoah wait a minute! So for example if my game uses a list object which saves / loads to the main folder can I include that file in the data elements and then it won't actually be in that folder? I might be understanding you incorrectly though.

    EDIT:
    The main folder has- The .exe, an ini file for options, and an array and 2 listbox lists for the save game files.

    These can all be embedded in the .exe? There's a part of the game where I use the file object to delete these when the player starts a new game. Would it still work if the above were embedded to the .exe?

    Thank you!

  7. #17
    Clickteam Clickteam

    Join Date
    Jun 2006
    Location
    France
    Posts
    14,022
    Mentioned
    279 Post(s)
    Tagged
    3 Thread(s)
    Quote Originally Posted by Del_Duio View Post
    Whoah wait a minute! So for example if my game uses a list object which saves / loads to the main folder can I include that file in the data elements and then it won't actually be in that folder? I might be understanding you incorrectly though.

    EDIT:
    The main folder has- The .exe, an ini file for options, and an array and 2 listbox lists for the save game files.

    These can all be embedded in the .exe? There's a part of the game where I use the file object to delete these when the player starts a new game. Would it still work if the above were embedded to the .exe?

    Thank you!
    Maybe just check my previous posts above? If those files are read-only, just include them to the Binary Data Files tab, they won't be extracted when the object loads them, they'll be loaded from the EXE. If you need to SAVE data to these files, then of course they'll have to be created and/or extracted to the user's disk.

  8. #18
    Clicker Fusion 2.5
    Del_Duio's Avatar
    Join Date
    Sep 2008
    Location
    Cygnus X-I
    Posts
    944
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Yves View Post
    Maybe just check my previous posts above? If those files are read-only, just include them to the Binary Data Files tab, they won't be extracted when the object loads them, they'll be loaded from the EXE. If you need to SAVE data to these files, then of course they'll have to be created and/or extracted to the user's disk.
    No, they're not read-only unfortunately. Thanks, Yves!

Page 2 of 2 FirstFirst 1 2

Similar Threads

  1. Need Help For My Game- All Enemies killed-next frame
    By LoneWulfGames in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 28th November 2014, 12:06 PM
  2. How to make enemies drop items when shot
    By Bittergamer1886 in forum Multimedia Fusion 2 - Technical Support
    Replies: 6
    Last Post: 2nd May 2012, 05:43 PM
  3. Item/Object 'Collected'
    By N64Mario in forum Multimedia Fusion 2 - Technical Support
    Replies: 14
    Last Post: 18th July 2009, 02:46 PM
  4. A Bug in MMF2 killed my widget
    By dragonguy in forum Multimedia Fusion 2 - Technical Support
    Replies: 9
    Last Post: 28th November 2008, 01:10 PM
  5. RichText control - remembering file name
    By JanH in forum File Archive
    Replies: 0
    Last Post: 4th April 2007, 08:03 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
  •