User Tag List

Page 2 of 2 FirstFirst 1 2
Results 11 to 19 of 19

Thread: Behaviours in created instances

  1. #11
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleiOS Export Module
    conceptgame's Avatar
    Join Date
    Apr 2011
    Location
    Switzerland
    Posts
    776
    Mentioned
    16 Post(s)
    Tagged
    0 Thread(s)
    I find this from Yves and translated it in english:
    Les "comportements" sont simplement ajoutés à la liste des événements normaux, tout comme les événements globaux, dans l'ordre suivant :

    - Evenements de la scène
    - Evenements globaux
    - Comportements

    Donc ils sont exécutés comme s'ils étaient dans les événements de la scène, pour toutes les instances des objets.
    Original thread here: https://community.clickteam.com/threads/75729-Question-sur-les-comportements-d-un-objet?highlight=ordre+comportement

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

    Join Date
    Feb 2015
    Posts
    50
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    OK, thanks for your answers,
    but, these groups inside behaviours have been giving me a real headache !.

    Trying to work around the problem I have now found more peculiarities,

    Even if you only have one object with a behaviour and you destroy it,
    if you create a new object, it is created with with the groups in the same
    state as the first objects when it was destroyed,
    also the new object will ignore limit events already met by the first object.

    I think I have a solution if anyone needs it,
    I gave the object a "reset" flag, which i set on in the create event,
    then the first line in the behaviour "if reset on" - then an action to close all the groups - reset off,
    seems to do the trick so far.
    behavingbadly.mfa

  3. #13
    Clicker Fusion 2.5Fusion 2.5+ DLC

    Join Date
    Jan 2018
    Posts
    290
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    i think in your mind you still believe than there is one code by object. in fact the code is transferred in the evenement list at the start of the mfa, then when you deactivate or activate the "run" group , it affect all the objetc and if you create a new objet, it doesn't impact on the state of the group.

  4. #14
    Clicker Fusion 2.5 Developer

    Join Date
    Jul 2008
    Location
    UK
    Posts
    1,393
    Mentioned
    16 Post(s)
    Tagged
    0 Thread(s)
    Honestly, you're better off just never using behaviours. Ever.
    When they were introduced, it was for one purpose only - which is actually explained in the help file as follows:

    "The great advantages of the behaviors is that the events are integrated in the object's properties : it means that if you copy the object, the behaviors will be copied at the same time.
    Example : you create a button that makes a click. Create a behavior that plays the sound "click" when you press the button. Then if you copy this object to another frame, it will click automatically when pressed.
    "

    That's it. That's all they're for.
    You can achieve the same thing using global events, or by simply putting those events in a group within the main event list, and then copy/pasting that group from one frame to another (which takes all of about 3 extra clicks of the mouse).

  5. #15
    Clicker Fusion 2.5Fusion 2.5+ DLC

    Join Date
    Jan 2018
    Posts
    290
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    yes, i never use behavior because i find it is a problem source for me, it doesn't help me then i never use it

  6. #16
    Clicker Fusion 2.5 Developer

    Join Date
    Jul 2008
    Location
    UK
    Posts
    1,393
    Mentioned
    16 Post(s)
    Tagged
    0 Thread(s)
    Indeed. They really don't do anything special. All that happens is that at runtime, Fusion finds all the events stored in behaviours, and just moves them to the bottom of the main event list.
    The cons are that you lose control over the order in which events are handled (they're always handled last), you're forced to edit them using the rubbish "event editor" instead of the much better "event list editor", and it can be harder to trace the source of bugs when your events are scattered about the place.
    So yeah, never use behaviours or the event editor (only the event list editor)

  7. #17
    Clicker Fusion 2.5Fusion 2.5+ DLC

    Join Date
    Jan 2018
    Posts
    290
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    agree 100 percent

  8. #18
    Clickteam Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleInstall Creator Pro
    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)
    BartekB's Avatar
    Join Date
    Aug 2013
    Posts
    667
    Mentioned
    14 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by MuddyMole View Post
    Indeed. They really don't do anything special. All that happens is that at runtime, Fusion finds all the events stored in behaviours, and just moves them to the bottom of the main event list.
    The cons are that you lose control over the order in which events are handled (they're always handled last), you're forced to edit them using the rubbish "event editor" instead of the much better "event list editor", and it can be harder to trace the source of bugs when your events are scattered about the place.
    So yeah, never use behaviours or the event editor (only the event list editor)
    CF2.5+ lets you change the order of execution:


    Also, the event list editor becomes a toggle, so it's usable within Behaviours and Global events. Though, the "event editor" is my preferred way to display my code, only when order of my actions matter is when I switch to the event list editor (or enter for a specific action by double clicking on an action box), so it's just preference really .

    But yes, Behaviours are basically additional "event editors" you can use that will get their events copy and pasted along with the object. They do not run events per object instance as if they were wrapped in a for each loop.
    - BartekB, a.k.a Uppernate
    Join the Click Converse Discord! - https://discord.gg/R3WuvF3mHr

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

    Join Date
    Feb 2015
    Posts
    50
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I do believe that behaviours can be very powerful, creating custom objects, which
    can easily be transferred from one project to another.

    From the doc, "Behaviors: Behaviors are a list of events, specific to the object."

    For the most part they work well, when cloned they work independently, so, I would guess
    a block of of code is created for each object and run one after the other, and internally
    it must scope the group names, as it does with values and flags.

    The problem only seems to be when they are instanced, everything else is still executed
    on an individual objects code, reading and changing values, flags etc. on every instance
    independently, its only when there is an action on a group that it suddenly decides to
    apply this to all the instances.
    Logically, you could argue that this shouldn't happen, and they should act as they do when cloned,
    or, you could argue that there should be one code for all instances, changing values, flags etc. for all
    But not half and half, it serves no use.

Page 2 of 2 FirstFirst 1 2

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
  •