User Tag List

Results 1 to 6 of 6

Thread: Affecting only a single object instance

  1. #1
    No Products Registered

    Join Date
    Jan 2010
    Location
    UK
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Affecting only a single object instance

    Apologies if this is posted in the wrong forum.

    I'm having trouble understanding something with the Events editor in MMF2. My game is similar in some ways to 'tower defense' style games. I have NPCs that are created off-screen and follow a Path movement to the other side. When they leave the other side of the screen they are destroyed and I add 1 to the player's score (the goal is to get them across safely).

    The problem is that all instances of this object are destroyed. I only want the one that makes it to the end of the path to be destroyed.

    I'm having difficulty understanding how MMF2 operates, as I assumed only the instance that triggers the event is considered in the output. In another example I have a crosshair system for shooting zombies, and only the one that is beneath the crosshair is destroyed, even if there are dozens more present on-screen. What's the difference?

  2. #2
    Clicker Multimedia Fusion 2

    Join Date
    Jun 2007
    Location
    Suffolk, UK
    Posts
    435
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Affecting only a single object instance

    Tell us what conditions and actions you used in the events and we'll try and see what is wrong. Alternatively, create a post in the File Archive which will allow you to post your file so we can download it and check the events ourselves. File archive is limited to 1meg I think but MFA Repository (see link in right menu) will allow a 10meg upload.

  3. #3
    No Products Registered

    Join Date
    Jan 2010
    Location
    UK
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Affecting only a single object instance

    This is the event that's causing me problems. The red ball represents the object that is being destroyed (placeholder image for a human).



    This is the event that is working fine. The green ball represents a zombie (again, placeholder image).



    I noticed the condition for the first one is in red text but from what I've read that only shows how the condition is checked.

  4. #4
    Clicker Multimedia Fusion 2

    Join Date
    Jun 2007
    Location
    Suffolk, UK
    Posts
    435
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Affecting only a single object instance [bug?]

    I'm wondering if maybe it's a bug. I've just tried and get the exact same result. I, same as you, would have expected the Immediate Condition to select the object that caused it but they all remain selected, so all get destroyed. Don't use the path movement much myself, maybe another user could clarify if that's the way it's supposed to work for paths.

    As a workaround for now, I'd recommend adding a check on the x position of your red ball so the condition ends up:

    Red ball has reached the end of its path
    + X position of Red Ball > Frame Width
    = Red Ball: Destroy

  5. #5
    No Products Registered

    Join Date
    Jan 2010
    Location
    UK
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Affecting only a single object instance [bug?]

    That does the job, but as you say, it's not ideal. Still, thanks very much for the help!

  6. #6
    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: Affecting only a single object instance

    I think it is the overlapping condition that makes this code only affect one instance in this case. It is forcing MMF to select the correct object. That is why the second set of conditions is working. The first condition is telling MMF to destroy anything that is a human when that condition (reached the end of its path) is true. This is because it isn't forcing MMF to select a specific copy of the instance. You might need to run a fastloop to make MMF select the appropriate one. You could try something like:

    (Active)has reached the end of its path
    -Spread Value 0 in Alt Var A(Active)

    (Active)has reached the end of its path
    -Start Loop "CheckHuman"

    On Loop "CheckHuman"
    +Alt Var A(Active) = LoopIndex("CheckHuman")
    +(Active)has reached the end of its path
    -Destroy
    -Add 1 to Lives

    I haven't tested it, but this gives you an idea of how you could approach it.

    Mobichan


    EDIT: Oops, I forgot that the path movement uses an immediate condition. Like TreeHugger said, it should work in that case.

Similar Threads

  1. How to delete single instance of an object
    By liquiddil in forum Multimedia Fusion 2 - Technical Support
    Replies: 6
    Last Post: 26th October 2013, 02:04 AM
  2. Creating a Single Instance of an object in a fastloop
    By Corlen in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 10th April 2013, 02:54 AM
  3. Objects affecting other variations of the same object?
    By Ibis in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 14th June 2012, 01:05 PM
  4. Clickteam Movement Controller only single instance?
    By ASD in forum Multimedia Fusion 2 - Technical Support
    Replies: 10
    Last Post: 18th November 2011, 01:00 PM
  5. Limit MMF2 to a single instance...
    By Simon in forum Multimedia Fusion 2 - Technical Support
    Replies: 11
    Last Post: 11th August 2006, 02:48 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
  •