User Tag List

Results 1 to 8 of 8

Thread: Collectible items to appear once?

  1. #1
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCSWF Export Module
    N64Mario's Avatar
    Join Date
    Nov 2008
    Location
    USA
    Posts
    1,308
    Mentioned
    15 Post(s)
    Tagged
    0 Thread(s)

    Collectible items to appear once?

    Say you have a collectible item (active object) on the map editor. It is a 1-up.
    You make a condition player collides with item. The item on the map gets destroyed and it adds 1 to the # of lives.

    How can I keep this 1-up item from re-appearing on the map every time the stage restarts? I just want it to appear on the map once. Just want it to spawn there only once when you start the stage, but not restart at it.
    I tried setting the 1-up as a global object, but I don't think that works. any other way around this?

  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)

    Re: Collectible items to appear once?

    I believe that setting it as a global object would be a way to do it, but you would need to set it up to, say, change one of its alterable values before it was destroyed, and then check for this value when the frame is restarted to destroy it if it's already been collected.

    An alternative is to store the state of that item having been collected in a global value, or one of the save methods such as INI+ or any of the Array objects - search the forums or look at the Tutorials link on the right for more on these.

  3. #3
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCSWF Export Module
    N64Mario's Avatar
    Join Date
    Nov 2008
    Location
    USA
    Posts
    1,308
    Mentioned
    15 Post(s)
    Tagged
    0 Thread(s)

    Re: Collectible items to appear once?

    Sorry to bring this topic back up, but I'm having trouble with this regarding the same issue.

    Say for example, there are 2 1-ups on the screen. One on the left side, one on the right side of the screen.

    The player picks up the 1up one on the right, but leaves the one 1up on the left. When I go to restart the frame (either when the player dies, or a temporary debug restart), both 1ups either BOTH get destroyed, OR none of them get destroyed at all. I set the 1up alterable value A to 1 on player collision. Then 1up alt. value A > 0 = destroy 1up. But that one collected keeps appearing. I even tried setting the collectible 1up item as a global object, but I don't think that helped.

    When I set global value X to 1 when the 1-up on the right is collected, then restart the frame, they BOTH get destroyed. So maybe there is an error with my code, I'm not sure.

    Maybe I should try to make a collectible item invisible spawner instead? I don't know, what do you think?

  4. #4
    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)

    Re: Collectible items to appear once?

    You need to save the value(s) to an array or INI. Once you restart the application, the values are reset.

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

  5. #5
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCSWF Export Module
    N64Mario's Avatar
    Join Date
    Nov 2008
    Location
    USA
    Posts
    1,308
    Mentioned
    15 Post(s)
    Tagged
    0 Thread(s)

    Re: Collectible items to appear once?

    But why would I need an INI just for this? Aren't INI scripts meant for saving/loading game positions and saved states? I would think there would be a simpler method of making certain items appear once before collected without the need of INI scripts.

  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)

    Re: Collectible items to appear once?

    You really don't have to use INI. Any storage object will work. Once you stop your application, values reset. The INI and other storage object are also used to save values also.

    Did I read your post correctly? You are re-starting your game each time? Re-starting the frame itself, no storage method will work. You need to run Application, not frame.

    If you have the Associative Array Extension, I have an example of this on my website.

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

  7. #7
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCSWF Export Module
    N64Mario's Avatar
    Join Date
    Nov 2008
    Location
    USA
    Posts
    1,308
    Mentioned
    15 Post(s)
    Tagged
    0 Thread(s)

    Re: Collectible items to appear once?

    Yes, I am running the frame only, and restarting the same frame.

    Should I try to run the whole application first, THEN restarting the frame to see if it works?

  8. #8
    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)

    Re: Collectible items to appear once?

    The values will reset. If you are using a data storage system, you have to "run application". Values need to be stored, so they keep their proper settings once you end your application. Save them prior to ending the application. Load them after you start your application.

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

Similar Threads

  1. Add items every so often
    By AnonymouseK in forum Multimedia Fusion 2 - Technical Support
    Replies: 6
    Last Post: 25th August 2013, 06:38 PM
  2. Items
    By Rabagast in forum Multimedia Fusion 2 - Technical Support
    Replies: 9
    Last Post: 25th July 2008, 06:26 PM
  3. Retrieving Items in Ini++
    By Jaffob in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 23rd June 2008, 10:08 PM
  4. Items on Arkenoid
    By wizkidweb in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 8th January 2008, 02:37 AM
  5. Saving Items
    By Jdsfrog in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 16th April 2007, 10:50 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
  •