User Tag List

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

Thread: Behaviours in created instances

  1. #1
    Clicker Fusion 2.5 (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)

    Join Date
    Feb 2015
    Posts
    48
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Behaviours in created instances

    Hi, I'm experiencing problems with creating multiples of an object i have made with behaviours,
    it has quite a lot of code in it so I have made a simple mfa to try and
    understand what is happening, sometimes it references instances as you would expect, other times it doesn't.

    behaviortest.mfa

    In the example, in the objects behaviour,
    Lines 3,4 & 5 behave as you would expect, referencing the individual instance and acting only on that one.
    If you activate line 6, then things change, it seem to reference only the first instance in the event, but then
    acts on all instances in the action.
    If you deactivate line 6, and activate line 7 instead, which has a condition to reference only
    the instance with ID 1, then nothing happens at all !

    Would be grateful if somebody could explain what is happening, also would like to know if with
    having the ability to have qualifiers in behaviours in 2.5+ would this make a difference, or would the same
    problem occur ?.
    Thanks.

  2. #2
    Clicker Fusion 2.5Fusion 2.5+ DLC

    Join Date
    Jan 2018
    Posts
    268
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    line 1 : if flag "start" one of the "active" is on: activate "move" group
    line 6 : if the condition is true: deactivate "move group" BUT when fusion restart the evenements list , line 1 "move" group is reactivated becaus other "active" flag are on.

  3. #3
    Clicker Fusion 2.5Fusion 2.5+ DLC

    Join Date
    Jan 2018
    Posts
    268
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    trye to explain what you want your program do exactly

  4. #4
    Clicker Fusion 2.5 (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)

    Join Date
    Feb 2015
    Posts
    48
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Line 6 also has the command to set "start" off which stops the group move from opening, which it does.
    the problem is that it only does this when one of the actives meets the condition, but then the action is applied to all the actives.

    With line 6 activated I would expect each active to stop one by one as they reach the right of the screen,
    but what happens is that when the faster two reach the right, they dont stop, and when the last active reaches the right, they all stop.

  5. #5
    Clicker Fusion 2.5Fusion 2.5+ DLC

    Join Date
    Jan 2018
    Posts
    268
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    your program works fine, exactly like it should.
    line 6 you define "start" off when the active posx >580 but others "start" are on then in the ligne 1 , the group "move" is reactuivated becaus the others "start" are on.

    when the green >580, his "start" gone OFF but red and yellow are always ON: the goup "MOVE" is reactuvated with line 1
    when yellow > 580 his start gone OFF but red is always ON : the goup "MOVE" is reactuvated with line 1
    when red >580 his start gone OFF then the 3"START" a OFF and theconfition on the line 1 is false, "MOVE"group will not be reactivated

  6. #6
    Clicker Fusion 2.5Fusion 2.5+ DLC

    Join Date
    Jan 2018
    Posts
    268
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    when you deactivate "move" group in the behaviour, it don't deactivate it just for this active , all "move" groups of every active are deactivated

  7. #7
    Clicker Fusion 2.5 (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)

    Join Date
    Feb 2015
    Posts
    48
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yes fredetmumu, your right, the problem is with the groups,
    actions on groups effects all instances....which is wrong !

    The whole point of behaviours is that they run independently

    This puts serious limitations on the code you can use in a behaviour
    if you want to create the object at runtime.
    I can get around it by creating clones instead, and running a for each loop to
    load individual settings, and they work properly, I don't need too many
    copies, but if i wanted hundreds or thousands it would be impractical.

    I haven't found any other reference to this problem, but a few more recent
    posts stating "with 2.5+ now no down side to behaviours",
    well, this is a big one if it hasn't been changed.

  8. #8
    Clicker Fusion 2.5Fusion 2.5+ DLC

    Join Date
    Jan 2018
    Posts
    268
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    i made this little mfa more simple, i have 2.5+, and the result is the same than yoursforsiggits.mfa

  9. #9
    Clicker Fusion 2.5Fusion 2.5+ DLC

    Join Date
    Jan 2018
    Posts
    268
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    i'm going to ask on a french forum

  10. #10
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleiOS Export Module
    conceptgame's Avatar
    Join Date
    Apr 2011
    Location
    Switzerland
    Posts
    774
    Mentioned
    16 Post(s)
    Tagged
    0 Thread(s)
    Hi,

    Behaviors are not object instance specific code, they are object specific code. At runtime, the same code is copied as many times as you have instances of the same oject in the main event list. Depending of how scoping works for the event you chose in your behavior, you may have different instances react to one of your instance event.
    In other words, if you create an event in a behavior and you have 3 instances, it will copy 3 times the code at the end of the main event list.
    They are some scenarios where it works intuitively like you think it would but in other scenarios not at all.
    I did not find any references in the documentation to confirm this but I am pretty sure there is a post from Yves somewhere in one thread of the forum about this.

Page 1 of 2 1 2 LastLast

Similar Threads

  1. Replies: 3
    Last Post: 18th May 2015, 07:16 PM
  2. Help with behaviours
    By danielfre in forum Multimedia Fusion 2 - Technical Support
    Replies: 6
    Last Post: 5th August 2011, 10:41 PM
  3. multiple behaviours
    By life2searching in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 11th April 2011, 03:30 PM
  4. Questions on behaviours
    By Pixelthief in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 9th February 2010, 12:10 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
  •