User Tag List

Page 1 of 2 1 2 LastLast
Results 1 to 10 of 12

Thread: How to create independent copies of the object?

  1. #1
    No Products Registered

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

    How to create independent copies of the object?

    I mean Action "Create new objects" in Event Editor. It creates identical copies of the object (grenade, for example). But i need two different grenades so that 2 players could use it at the same time. At the moment when the first player's grenade explodes so does the second grenade.

    Of course I could just create Grenade №2 in Frame Editor but what if I need 100 different grenades in future)))) ?

  2. #2
    Clickteam Clickteam
    Jeff's Avatar
    Join Date
    Jun 2006
    Location
    Battle Ground Washington
    Posts
    11,824
    Mentioned
    8 Post(s)
    Tagged
    2 Thread(s)

    Re: How to create independent copies of the object?

    We might need to see your eventing to see what your doing.
    As creating copies they are instances when it comes to the events.

    www.clickteam.info/create_object.mfa

    This creates a new object every second and when an instance of the object hits the read square it is destroyed and it only effects that instance.

  3. #3
    No Products Registered

    Join Date
    Jan 2008
    Posts
    146
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How to create independent copies of the object?

    For grenades with a 10 second delay to this:

    every 1 second
    -> add 1 to alterablevalue A of "grenade"

    alterablevalue A of "grenade" >= 10
    -> destroy

  4. #4
    No Products Registered

    Join Date
    Jun 2006
    Location
    Land of raging rockets
    Posts
    1,231
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    MMF selection insight

    In MMF the trick is not in creating an independent object, but in treating objects independently.

    To make that happen, you have to be aware of what selections all the conditions make. E.g. if you have a condition "grenade collides with enemy", MMF will select the particular grenade, and the enemy.
    If you have a condition "animation flying of grenade is playing", all grenades with that animation are selected (and you can narrow it down with further conditions).
    If the condition is not related to the grenade, chances are high that all grenades are selected.

    So if you want the right grenade to explode, make sure only that grenade is selected.

    Now of course for a "normal programmer" this behaviour of MMF is *drumroll* side effect hell - especially as there is no-clue-whatsoever which condition makes what kind of selection, other than some common sense (aka guessing) and experience (trying all conditions and testing what exactly they do). For the experienced MMF programmer this is *drumroll* normal. A scary notion, thinking about it, but you better get used to it

    Now, if I haven't confused/scared you enough, here's another tasty one: actions have side effects too (e.g. "Create object" selects the object created).

    Still with me? Okay, here's the final blow. When I say "selects", what actually happens is that all the non-affected objects are deselected. So you start every event with ALL OBJECTS selected, and every object that doesn't pass the condition becomes deselected. Therefore, in the grenade example, if you say "animation flying of grenade is playing", all grenades with a different animation are deselected - so other objects, e.g. player or enemy, stay in the selection and actions affect them.

    Unless you understand this system, a lot of things happening in MMF will appear arbitrary.

    Enjoy

  5. #5
    No Products Registered

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

    Re: MMF selection insight

    Ok, here is my file: http://depositfiles.com/ru/files/80tkdpoeh.

    As you see I improved a bit Globs game from the Koobare tutorial. Now choose the grenade by right-click for the Player 1, wait till timer ends (don't throw it), and then choose the grenade for Player 2. Now throw it and you'll see that Player's 1 grenade exploded too.

    Random, how can I select right grenade ? Does this mean that I need to create 2 objects in Frame Editor: "Grenade 1" for Player 1 and "Grenade 2" for Player 2 so I could select right grenade?

  6. #6
    Clicker Multimedia Fusion 2 DeveloperiOS Export Module
    Nifflas's Avatar
    Join Date
    Jul 2006
    Posts
    2,613
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: MMF selection insight

    No, the thing he's saying is that your events have to handle the grenades individually, despite that they are different instances of the same object, and to do this, you have to understand how MMF2's object selection/filtering work.

  7. #7
    No Products Registered

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

    Re: MMF selection insight

    Quote Originally Posted by Nifflas
    No, the thing he's saying is that your events have to handle the grenades individually, despite that they are different instances of the same object, and to do this, you have to understand how MMF2's object selection/filtering work.
    If you know some tutorial about object selection/filtering I would be very thankful, mate!

  8. #8
    No Products Registered

    Join Date
    Jun 2006
    Location
    Land of raging rockets
    Posts
    1,231
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: MMF selection insight

    I think this is one of the least covered subjects and most authors here operate only on try&error experience.

  9. #9
    Clicker Fusion 2.5 DeveloperFusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleMac Export ModuleSWF Export Module

    Join Date
    Sep 2006
    Location
    UK
    Posts
    842
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: MMF selection insight

    Isnt this solved by giving the object (and its newly created copies) alterable values and then checking for them in the event?

    Or have i sweeply read this post to fast?

    Gib

  10. #10
    Clicker Multimedia Fusion 2 DeveloperSWF Export Module

    Join Date
    Jun 2006
    Posts
    6,773
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Re: MMF selection insight

    Yes, you're right. There's a "Spread value" action which will assign numbers like (0, 1, 2, 3) to all of the object instances, so that you can easily run a loop through them.

Page 1 of 2 1 2 LastLast

Similar Threads

  1. 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
  2. Object moving independent of scrolling?
    By Outcast in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 19th November 2012, 04:42 PM
  3. How to stop Destroy from destroying all copies of the same object at once?
    By knpdude in forum Multimedia Fusion 2 - Technical Support
    Replies: 7
    Last Post: 10th February 2012, 05:31 PM
  4. 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
  5. Can clickteam run out of MMF 2 copies ?
    By Rushino in forum Multimedia Fusion 2 - Technical Support
    Replies: 15
    Last Post: 30th June 2006, 04:45 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
  •