User Tag List

Results 1 to 8 of 8

Thread: How to stop Destroy from destroying all copies of the same object at once?

  1. #1
    Clicker Multimedia Fusion 2

    Join Date
    Feb 2009
    Posts
    19
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How to stop Destroy from destroying all copies of the same object at once?

    Hello Click community,

    Been a very long time since I've been here

    Anyway, I am back kliking and I've run into a problem with a game I'm working on. The premise of the game is as such:

    There are (so far) three lanes that are vertical. In each lane, there are 4 different ingredients being shot down. The idea is that the ingredients pile up and you have to click on them in order to make a cake. Whoever makes the most cakes win, and of course there is possibilities for other game modes.

    My issue right now is that when the different ingredients pile up, I have it coded right now that it destroys the object that is there (which is put there with a Create event). The problem is when multiples of the same ingredient are there, it destroys all objects of that one! I only want the one to be destroyed.

    I'm sure there is a way around this but I'm stumped. I'm hoping someone can help me out.

    Thanks!

    Edit:

    I forgot to mention. This is a little embarrassing but I am using old school MMF 1.0. It's all I have, because I cannot afford to get MMF2 yet

  2. #2
    Clickteam Clickteam
    LB's Avatar
    Join Date
    Jun 2007
    Location
    Richardson, Texas, North America
    Posts
    8,937
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    What conditions do you have for that event? If you don't have any conditions from the object being destroyed, the selection is not filtered and so all remain selected for the destroy event. If you want to do one at a time, you can use the 'Pick object at random' condition from the object it is you are destroying.
    Working as fast as I can on Fusion 3

  3. #3
    Clicker Multimedia Fusion 2

    Join Date
    Feb 2009
    Posts
    19
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I guess I should have mentioned the condition!

    It's upon a user clicking within a specified zone. Picking it at random would look strange unfortunately!

    I have found a workaround, albeit a bit inefficient (or maybe it's the only way?) was to have multiple clones of the same object and just specify each event specifically to each cloned object. Tedious but it'll do the job. I'll have to see how well the application runs with so many event lines.

    If you know of a more efficient way I'm all ears!

  4. #4
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleSWF Export Module

    Join Date
    Jul 2006
    Posts
    59
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I think this might work: Set it up so that each duplicate you create has a different value for one of its alterable values. (first duplicate, alt A=1, second duplicate alt A=2, and so on). Then you can use the alterable value in the conditions to discriminate between your duplicates.

  5. #5
    Clickteam Clickteam
    LB's Avatar
    Join Date
    Jun 2007
    Location
    Richardson, Texas, North America
    Posts
    8,937
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by knpdude View Post
    It's upon a user clicking within a specified zone.
    Don't do that, use "User click on object". If you want it to be more responsive, use "Repeat while mouse key is pressed" + "Repeat while mouse is over object" + "Only one action on event loop"
    Working as fast as I can on Fusion 3

  6. #6
    Clicker Multimedia Fusion 2

    Join Date
    Feb 2009
    Posts
    19
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Allow me to explain the premise of the game and what I have done so far to accomplish it.

    All right so basically the game is going to consist of a bunch of mini-games, and the first one I am working on is a mini game for food sorting. You race against the clock to put together 4 ingredients together in order to make as many of the food item as you possibly can. The way it works is on screen right now there are three vertical lanes 64 pixels wide, and there are 4 different food item objects being shot (by being picked at random) down each lane. Then there is a 9x9 grid of active objects to hold the food items being shot. The programming is like this:

    Shooter object 1 is picked at random and launches one of four food objects (for this example it's a plate, cake bottom, cake middle and cake top).

    When one of these four objects (so four collision events) collides with one of the placeholder active objects (which are hidden), destroy that object and then create a cloned version of it, but the cloned object for that specific placeholder (so I've had to make multiple copies of the same object about 10 times, and then not to mention the extra coding). So it would go something like:

    Plate top (launched object) collides with Bottom Placeholder 1 (this is the bottom left placeholder on the 9x9 grid), destroy Plate top and create Plate top 2 directly on top of the location of Bottom Placeholder 1. Also set Alterable Value A of Bottom Placeholder 1 to 1 (to tell the game there is now something on that placeholder) and also set Alterable Value B to 1 so we know that it's a Plate Top on that placeholder. Set internal flag of the placeholder right above this one to 1, so that the game knows this placeholder is now filled and that we can set a condition to allow something to be placed in the placeholder spot above this one.

    Then I have corresponding events for when the user clicks within a zone. I had to use zone because the object that the user clicks on changes all the time. If I could keep it to the same one I would save a lot of lines of event, and I'm sure would make the game run more efficiently. It's my first serious game so I'm sure I will learn a lot from it but this is one thing I hope to improve.

    Thanks for any help.

  7. #7
    Clickteam Clickteam
    LB's Avatar
    Join Date
    Jun 2007
    Location
    Richardson, Texas, North America
    Posts
    8,937
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    You can put all the objects into a qualifier and use 'User clicks on Group.Whatever"
    Working as fast as I can on Fusion 3

  8. #8
    Clicker Multimedia Fusion 2

    Join Date
    Feb 2009
    Posts
    19
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That's a great idea! I am going to do that right now.

    Thanks!

Similar Threads

  1. Destroying Just one of a Duplicate Object
    By TheMooCows237 in forum Multimedia Fusion 2 - Technical Support
    Replies: 6
    Last Post: 9th June 2013, 09:03 AM
  2. Multiple Copies of One Object
    By Wolfking_Warrior in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 22nd January 2013, 05:50 AM
  3. Multiple copies of an object with certain events
    By fawfulfan in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 14th February 2011, 04:32 PM
  4. How to create independent copies of the object?
    By Angelion in forum Multimedia Fusion 2 - Technical Support
    Replies: 11
    Last Post: 23rd December 2008, 08:03 AM
  5. Destroying an Active Object...
    By DanielRehn in forum Extension Developers Lobby
    Replies: 6
    Last Post: 19th September 2007, 01:33 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
  •