User Tag List

Results 1 to 7 of 7

Thread: Permanently destroy non-global objects

  1. #1
    No Products Registered

    Join Date
    Dec 2008
    Posts
    71
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Permanently destroy non-global objects

    Hello all.

    I am moving the player active object between 2 frames but I find that when I destroy objects in Frame 1, move to Frame 2 then back to Frame 1 again, the objects have re-appeared.

    I can sort of see why, since the frame is started "afresh" each time it is visited, but is there a way to permanently destroy active objects in a game so that they only get created when you start a new instance of the game?

    (I tried "global objects" but this doesn't seem to do the job).

  2. #2
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleiOS Export ModuleSWF Export Module
    Skyhunter's Avatar
    Join Date
    Jan 2007
    Location
    Croatia
    Posts
    452
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Permanently destroy non-global objects

    If you are doing multiple frames, you should use some kind of an array to store all the data across frames. Try either array or ini object.

  3. #3
    Clicker Multimedia Fusion 2SWF Export Module

    Join Date
    Sep 2006
    Posts
    1,544
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    Re: Permanently destroy non-global objects

    each time a frame is loaded, information from previous frames in 'forgotten'. You need to code a system to store information across frames. For example, if at the start of your frame you spread a value throughout an alterable value lets call it "Index" for your set of monsters

    Then using an INI object for your game, you instance it for each save game slot, recording into the INI file the "Index" of every monster as you destroy it. For example, your code might read:


    +Collision between Monster and Bullet
    =Destroy Monster
    =Write value 1 to INI file at Group:"LevelName" Index:"Monster"+str$(Index("Monster"))


    then add some code at the start of each level of yours that reads from the ini file and deletes the objects:


    +Start of Frame
    =Spread Value 0 across Index("Monster")
    =Start fast loop "KillStuff" for numObjects("Monster") number of times

    +On fast loop "KillStuff"
    +Index("Monster") = loopIndex("KillStuff")
    +Get Value at INI at Group:"LevelName", Index:"Monster"+str$(LoopIndex("KillStuff")) == 1
    =Destroy Monster

  4. #4
    No Products Registered

    Join Date
    Dec 2008
    Posts
    71
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Permanently destroy non-global objects

    Thanks both, I will try that tomorrow, my brain is fried at the moment and I need sleep!

  5. #5
    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: Permanently destroy non-global objects

    You can also use Global Values. These are unlimited.

    Set to 1 for being destroyed. It will carry over all the frames and even sub-applications.

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

  6. #6
    Clicker Multimedia Fusion 2SWF Export Module

    Join Date
    Sep 2006
    Posts
    1,544
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    Re: Permanently destroy non-global objects

    Gets to be a problem if you have a lot of objects to store though

  7. #7
    No Products Registered

    Join Date
    Dec 2008
    Posts
    71
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Permanently destroy non-global objects

    Yes, there could be 500+ enemies spread over the entire game
    Will look into the other method, thanks for the pointers.

Similar Threads

  1. Swf Crash (destroy objects)
    By StingRay in forum SWF/Flash Export Module Version 2.0
    Replies: 14
    Last Post: 15th March 2013, 09:08 AM
  2. [BUG] Objects outside the frame don't destroy
    By paobrasil in forum iOS Export Module Version 2.0
    Replies: 4
    Last Post: 22nd October 2012, 08:13 PM
  3. created objects create objects and destroy both.
    By wizlore in forum Multimedia Fusion 2 - Technical Support
    Replies: 0
    Last Post: 25th September 2012, 08:37 PM
  4. Permanently Destroy an Active?
    By XStar in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 11th March 2012, 03:54 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
  •