User Tag List

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

Thread: Detecting multiple destroyed duplicated objects?

  1. #11
    Clicker

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleSWF Export Module
    Konidias's Avatar
    Join Date
    Aug 2009
    Posts
    1,546
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)

    Re: Detecting multiple destroyed duplicated objects?

    Thanks for all the responses guys.

    I've been doing good keeping my game export friendly and I'm really trying to avoid using extensions that won't work in Flash/Java/etc. The type of condition event I'm using to destroy the objects isn't very friendly with keeping track of how many objects are destroyed during a loop, so it looks like I'll go with the fastloop suggestion.

    I just kind of wanted to avoid using more fastloops because there's a lot of these same objects on the screen and that means every time one gets destroyed I have to loop through all of them to see if any others got destroyed during that loop also. Which just means it's going to be rather slow... But I guess I don't really have much choice otherwise.

    I'll try to play around with some of the collision event options and see if that might work out.

  2. #12
    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,310
    Mentioned
    28 Post(s)
    Tagged
    0 Thread(s)

    Re: Detecting multiple destroyed duplicated objects?

    Unless you have 50+ enemies, I don't think you will need to worry about slowdown. Besides, the fastloop for this should only run when an enemy dies. So the only time you "might" see slowdown is on the frame of the enemy's death.

  3. #13
    Clicker

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleSWF Export Module
    Konidias's Avatar
    Join Date
    Aug 2009
    Posts
    1,546
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)

    Re: Detecting multiple destroyed duplicated objects?

    There can be over 300+ of these objects at once... So yeah, that's why it's a pain to do a fastloop through them. (not to mention, I'm already running a fastloop through them to check for movement, so it's basically having to look through 600+ objects per loop. Not the most speed efficient situation)

    I've implemented the fastloop method and I'm not noticing any real slowdown for now. I think the only good thing about this situation is that this event only happens every so often when the player destroys the object. For the most part, the objects just stay on screen. Not to mention they get destroyed during the loop, so it helps to take a bit of pressure off the process.

    But I still wish there was a less loop intense way of doing this without using unfriendly extensions.

  4. #14
    Clicker Multimedia Fusion 2 DeveloperiOS Export ModuleSWF Export ModuleUnicode Add-on

    Join Date
    Jun 2006
    Location
    Australia
    Posts
    988
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Detecting multiple destroyed duplicated objects?

    What is the exact condition you are using to check if objects should be destroyed? Can you post a simplified example?

    I know of a lot of work arounds and I'm pretty sure I could come up with something that doesn't need fastloops if I had an example.

  5. #15
    Clicker

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleSWF Export Module
    Konidias's Avatar
    Join Date
    Aug 2009
    Posts
    1,546
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)

    Re: Detecting multiple destroyed duplicated objects?

    The condition is basically just checking to see if the object's "damage" alterable value is at a certain number and then destroying the object.

  6. #16
    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,310
    Mentioned
    28 Post(s)
    Tagged
    0 Thread(s)

    Re: Detecting multiple destroyed duplicated objects?

    I would say that if you aren't seeing slowddown, then don't worry too much about it until you do.

  7. #17
    Clicker Multimedia Fusion 2

    Join Date
    Sep 2006
    Location
    Britain, South Coast
    Posts
    1,030
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Detecting multiple destroyed duplicated objects?

    Does String Parser 2 object reliably work with Flash and Java runtimes? If so, you can avoid fastloops using a rather hacky workaround. It works because expressions (such as 'set alterable value to...') loop for each copy of the object selected, and SP2 has the ability to set a new value for the string parser from within an expression.

    Does that make sense?

    Code:
    // Counting bad guys
    Bullet overlaps bad guy
    --- String Parser: Set string to "0"
    --- bad guy: Set alterable string A to:
           set string of string parser to itself as a number + 1 (see explanation below)
    --- bad guy: Destroy
    --- Counter: Add value of String Parser's string to counter.
    The funny formula (put this way because I don't have access to MMF right now) retrieves the string from string parser ("0") turns it into a number (0) and adds 1 to it (1). It then turns it back into a string ("1") and sets the string to that value, so string now == "1".

    Object Expressions repeat for each object being processed, so this process will add '1' for each bad guy you're destroying.

    You then simply add the numeric value of the string in String Parser into the counter.

    I know you don't want to use extensions if possible, but there's a chance this one will be okay, because I believe it's become an old staple of MMF's and will likely continue to be updated (I think) for future versions and exporters.

Page 2 of 2 FirstFirst 1 2

Similar Threads

  1. Trouble with events with duplicated objects
    By renan63 in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 5th June 2013, 03:27 PM
  2. Destroyed objects won't paste or fade
    By Grim_Jester in forum Multimedia Fusion 2 - Technical Support
    Replies: 23
    Last Post: 4th April 2012, 06:17 PM
  3. Bug - Semitrans. Objects get destroyed altogether
    By ClarkJK in forum File Archive
    Replies: 2
    Last Post: 22nd November 2010, 09:03 AM
  4. Objects destroyed next frame Problem
    By HyperspazzMan in forum Multimedia Fusion 2 - Technical Support
    Replies: 8
    Last Post: 3rd July 2010, 04:19 AM
  5. Detecting when an object is 'destroyed' problem...
    By rhodestown in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 20th December 2008, 09:53 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
  •