User Tag List

Page 1 of 2 1 2 LastLast
Results 1 to 10 of 18

Thread: Remembering collected items and/or enemies killed

  1. #1
    Clicker Fusion 2.5
    Tobias_Edvardsen's Avatar
    Join Date
    Jun 2015
    Location
    Drammen, Norway
    Posts
    28
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Remembering collected items and/or enemies killed

    I am developing a metroidvania-styled game, and looking for an efficient way to track collected items, and enemies killed.

    One time collectibles are easy to handle since you only collect them once, thereby you can have a flag determining whether it has been collected or not. However, remembering a repeating collectible that occurs in large quantities across the game is another matter. If a level/area is containing 256 coins, and you collect 86 of them, then leave the frame; when you return to this frame, how do you account for the correct 86 coins collected, and prevent them from reappearing at their respective positions? The same dilemma also applies to previously killed enemies.

    I am assuming an array is the answer here, but I have been unable to make it work properly.

    If anyone has an effective solution to this, I would be very thankful for sharing it.

    Best regards,
    Tobias Edvardsen

  2. #2
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleiOS Export Module
    Doverseer's Avatar
    Join Date
    Dec 2006
    Location
    USA
    Posts
    46
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    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

  3. #3
    Clicker Fusion 2.5
    Tobias_Edvardsen's Avatar
    Join Date
    Jun 2015
    Location
    Drammen, Norway
    Posts
    28
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This looks very viable! Thank you very much!

    I should be able to store frame value in an Y dimension instead of saving an .array file for each frame, right? Also, is there a way to delete the .array file without the File object? The file object is incompatible with iOS and other platforms.

    Best regards,
    Tobias Edvardsen

  4. #4
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleiOS Export Module
    Doverseer's Avatar
    Join Date
    Dec 2006
    Location
    USA
    Posts
    46
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    You could store other information in the Y dimension, but I think Fixed Values are only unique to each frame. You could clear the array and then save it again as a workaround until you find a way to delete the file on iOS.

  5. #5
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleiOS Export Module
    Doverseer's Avatar
    Join Date
    Dec 2006
    Location
    USA
    Posts
    46
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    FixedValue Array 2nd Example

    Since Fixed Values are only unique to each frame. Adding the frame to the Y dimension when an object is collected/destroyed would work if you want to only use one array. I made an updated example that includes 3 frames to demonstrate.
    Attached files Attached files

  6. #6
    Clicker Fusion 2.5
    Tobias_Edvardsen's Avatar
    Join Date
    Jun 2015
    Location
    Drammen, Norway
    Posts
    28
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Fantastic! This is a great solution!

    I have only one concern; as the X dimension is extended by one for each object collected, won't this bloat the array file? If the game has a total of 4000+ coins throughout, on top of 100 frames, for example.

    Best regards,
    Tobias Edvardsen

  7. #7
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleiOS Export Module
    Doverseer's Avatar
    Join Date
    Dec 2006
    Location
    USA
    Posts
    46
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    I made a test were I added 1200 to the x dimension. The array file was only 10 KB. I did not experience any slow down but it depends on your hardware. You could make multiple arrays and fastloops per object, for example coins.array, enemies.array, etc. instead of one big array or split them up by frame#.

  8. #8
    Clicker Fusion 2.5
    Tobias_Edvardsen's Avatar
    Join Date
    Jun 2015
    Location
    Drammen, Norway
    Posts
    28
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Doverseer View Post
    You could make multiple arrays and fastloops per object, for example coins.array, enemies.array, etc. instead of one big array or split them up by frame#.
    In the case of using a range of multiple arrays; is there a way to embed the .array files into the application? I find having multiple array files as well as ini's to be chaotic for the user, and susceptible to being tampered with.

    Best regards,
    Tobias Edvardsen

  9. #9
    Clickteam Clickteam

    Join Date
    Jun 2006
    Location
    France
    Posts
    13,696
    Mentioned
    235 Post(s)
    Tagged
    3 Thread(s)
    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.

  10. #10
    Clicker Fusion 2.5
    Tobias_Edvardsen's Avatar
    Join Date
    Jun 2015
    Location
    Drammen, Norway
    Posts
    28
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Neat! That's very handy! Does this apply for .ini's as well? Also, when I select the files I want to embed; should I extract them from a specific folder directory?

    Best regards,
    Tobias Edvardsen

Page 1 of 2 1 2 LastLast

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
  •