User Tag List

Results 1 to 10 of 10

Thread: How do I adress duplicated actives independently?

  1. #1
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export Module
    TheChiller's Avatar
    Join Date
    Jul 2010
    Location
    Germany
    Posts
    95
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How do I adress duplicated actives independently?

    Before wreaking total havoc, I wanted to ask you guys again.

    Imagine a game board full of tiles. Each tile is one of our alphabet's letters, therefore obtains one of its animations randomly.
    As I don't want to clone each tile, I'd rather duplicate them so I could change one's animation value and it gets altered for all of them and I could save many event lines.

    The only thing bothering me now is one problem I have with duplicated actives: I don't know how to adress them independently.
    In a CF2.5 tutorial I once read that each active in a running application owns a special fixed value. I tried this out many times experimenting with something like a memory game (picking up/ turning cards) but failed.
    In this case I have 4 actives duplicated out of one (=5) and set the animation value of the active to random. When I say "New touch on Active -> set counter to anim value (Active)" no matter which of the five ones I click, having various animations (letters A-Z), I get the same animation value from all five.
    Same happens when I try to replace a particular color in the active that has just been clicked. That event line makes all duplicated actives in the running application change that color!
    Even if I say "A new touch on Active has started -> set counter to fixed(Active)" and "pick objects with fixed value = value (counter) -> replace color..." all duplicated Actives get the new color.

    How can this be? How can I adress each one individually?
    Thanks in advance!

  2. #2
    Forum Moderator Fusion 2.5 DeveloperHTML5 Export ModuleiOS Export ModuleSWF Export Module
    DavidN's Avatar
    Join Date
    Jun 2006
    Location
    Boston, MA, USA
    Posts
    4,044
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sometimes, selecting the right instance of an object can be a tricky subject in Fusion, but usually, events select them in a reasonably sensible way - I'm surprised that "New touch on..." doesn't seem to be doing that. Could you try replacing it with a "User clicks left button on..." event with the same object instead to see if that makes a difference? It should count a touch as a click on iOS.

    If it turns out the multi-touch object doesn't select instances as expected, you can work around that - see the Fastloops tutorial under the tutorials section on the main Clickteam page. The action "Spread value" is used to give a unique ID to individual instances, even though this isn't obvious from the name.

  3. #3
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export Module
    TheChiller's Avatar
    Join Date
    Jul 2010
    Location
    Germany
    Posts
    95
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for the quick and comprehensible answer!

    Unfortunately the same misbehavior with adressing all instances is still present when I try the "User clicks" variant.
    I will definitely have a look at the tutorial as this is something I need to resolve in the near future. Thanks so far

  4. #4
    Clicker Fusion 2.5Android Export ModuleSWF Export Module
    Ziplock's Avatar
    Join Date
    Oct 2013
    Posts
    448
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hopefully, someday in 3.0, we'll get a limit of "Use only on this particular instance," but for now, the easiest way to deal with it is a fastloop.

    Always:
    -> Spread Value "ID" in "Object"

    Always:
    -> Start loop "IDLoop" NObjects "Object"


    Then any time you want to do anything with one particular instance:

    If (Condition)
    + Loop Index of "IDLoop" = "ID" of "Object"
    -> (Action)


    Limitations:

    Both always conditions can't be in the same line.
    You can't do anything to alter the animation frames (change color, for example), because that will alter them all.

  5. #5
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export Module
    TheChiller's Avatar
    Join Date
    Jul 2010
    Location
    Germany
    Posts
    95
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Didn't know it was such a big deal in MMF/ CF and it was just my fault

    This sounds more complicated than it actually might be! I tend to recognize what this method is trying to achieve and how but the fact that it can't do the alternation of an active is quite a throwback.
    Can't I use the loop index to transfer it to e.g. a counter? A condition could be checking for a change in the counter's value and then process the alternation of the active.

    The thing I did not yet understand is: What do you mean by ID? Is it the object's fixed value or what?

    Thank you nevertheless!!

  6. #6
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    DaveC's Avatar
    Join Date
    Jun 2007
    Location
    Perth, Australia
    Posts
    2,117
    Mentioned
    13 Post(s)
    Tagged
    0 Thread(s)
    The "ID" in that example is simply an alterable value named "ID" so if you have 5 objects and you spread value "ID", each object will have a unique alterable value (named ID) so you can address them separately.

    You can search the forum for "spread value" there will be plenty of examples.

    This simpler method by Sparkman might help, I've never done it this way though - http://community.clickteam.com/threads/90620-Unique-alterable-value-of-the-same-object-without-spread-value

  7. #7
    Clicker Fusion 2.5Android Export ModuleSWF Export Module
    Ziplock's Avatar
    Join Date
    Oct 2013
    Posts
    448
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ID could be any alterable value of that object. I usually up alterable value A to ID.

    And it's not so complicated once you get used to the idea that you need this for any individuality for duplication of active objects.

    From what I gather (I could be wrong, sorry), you want your five values to be different animations at the start of your frame, and you want your counter to change to whichever you click?


    Try this:

    Always:
    -> Spread Value 0 in Alterable Value A of "Object"

    Start of Frame:
    -> Start Loop "Animation Start" NObjects "Object"

    OnLoop "Animation Start"
    + Alterable Value A of "Object" = LoopIndex of "Animation Start":
    -> Change Animation Sequence of "Object" to Random (26) (Or as many animations as you have)

    User Clicks on "Object":
    -> Set Counter to Current Animation Value of "Object"


    Hope I got that right.

  8. #8
    Clickteam Clickteam
    Fernando's Avatar
    Join Date
    Dec 2006
    Posts
    6,248
    Mentioned
    179 Post(s)
    Tagged
    3 Thread(s)
    MM, did you see this game

    https://play.google.com/store/apps/d...2m.bestsong001

    it is something like this

    letters, this is only one active object created and handle independently
    Regards,


    Fernando Vivolo

    ... new things are coming ...

  9. #9
    Clicker

    Fusion 2.5 Developer
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)
    BtheDestroyer's Avatar
    Join Date
    May 2013
    Posts
    99
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You can always follow the Snail method and create the actives at runtime using fast loops instead of duplicating them, then giving them a value relative to the loop(s) position.

    If you had 2 loops, you could do this:

    Start of frame: Fast Loop "Active Gen X" 10 times.
    On Fast Loop "Active Gen X": Fast Loop "Active Gen Y" 10 times.
    On Fast Loop "Active Gen Y": Create "Active" at 0,0; Set "Active"'s X position to "Active Gen X"'s index*32; Set "Active"'s Y position to "Active Gen Y"'s index*32; Set "Active"'s Alterable Value "ID" to: ("Active Gen X"'s index*10)+("Active Gen Y"'s index)

    1. I know you don't need parentheses but I don't trust fusion's math most of the time...
    2. I'd color code this and make it prettier but I don't have the time.

  10. #10
    Forum Moderator Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleSWF Export ModuleXNA Export Module
    ProdigyX's Avatar
    Join Date
    Jan 2011
    Posts
    1,197
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    The "Replace Color" action is not applied on an instance-by-instance basis but rather on entire objects. So if you replace white with red for one instance of an object, all instances of that object will also have white replaced with red.

    If you want to learn a bit about how to object scope and ensure proper object selection, you can check out the example MFA file under "Downloads" at http://www.xable.us/object-scoping.php

Similar Threads

  1. Trying to get multiple enemies to jump independently.
    By Storsorgen in forum Multimedia Fusion 2 - Technical Support
    Replies: 13
    Last Post: 1st November 2012, 02:57 PM
  2. Making master server, but can't get ip adress?
    By NeoMonkey in forum Lacewing
    Replies: 9
    Last Post: 22nd January 2010, 06:23 PM
  3. Acting Independently
    By Corlen in forum File Archive
    Replies: 6
    Last Post: 1st August 2009, 01:13 AM
  4. Using dotNet to get the MAC adress from a computer
    By Quinto in forum dotNet Scripting
    Replies: 1
    Last Post: 11th April 2008, 11:46 PM
  5. how do you get the local ip adress
    By MechatheSlag in forum Multimedia Fusion 2 - Technical Support
    Replies: 8
    Last Post: 8th December 2007, 02:03 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •