User Tag List

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

Thread: 2.5+ Parent & Child events: When to use it?

  1. #1
    Clicker Fusion 2.5 MacFusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    Fuuriokun's Avatar
    Join Date
    May 2010
    Location
    Brazil
    Posts
    228
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    Question 2.5+ Parent & Child events: When to use it?

    Hi, a friend of mine is confused about when and why he should use Parent & Child events (over activacting groups, os simply adding many conditions to a normal event)
    I really couldn't give him a good example easy to undestand of where this would be good or even needed...
    I know I'm gonna use it but I really can't explain where and why, is just something that I feel like using or not...

    Can anyone help with why and how would you use these new features?

    Thanks a lot!

  2. #2
    Clicker Fusion 2.5 MacFusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export ModuleInstall Creator Pro
    Christian_Wheel's Avatar
    Join Date
    Mar 2010
    Location
    Los Angeles
    Posts
    340
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Parent/Child events help a lot in terms of code readability, and also slightly speed up your project because you don't have to test for the same condition every line.

    Consider:
    Code:
    IF X = True THEN
    	IF Y = True THEN DOSOMETHING1
    	IF Z = True THEN DOSOMETHING2
    	IF I = True THEN DOSOMETHING3
    END IF
    vs

    Code:
    IF X = TRUE AND Y = TRUE THEN DOSOMETHING1
    IF X = TRUE AND Z = TRUE THEN DOSOMETHING2
    IF X = TRUE AND I = TRUE THEN DOSOMETHING3
    Both examples have the same effect, but in the second example, X is evaluated 3 times versus once in the first example, which leads to slower execution. BUT activating groups is a totally legitimate alternative.

  3. #3
    Clicker Install Creator Pro
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    defisym's Avatar
    Join Date
    Jun 2017
    Location
    Asia
    Posts
    49
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    I think child event is something like syntactic sugar (e.g. *(a+i) and a[i] ), you don't need to worry about where to use it, cause you can use it everywhere.
    Besides, if you have already got used to the tradition mode, just keep it, it's OK.

  4. #4
    Clicker Fusion 2.5 Mac
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)

    Join Date
    Jan 2015
    Location
    Australia
    Posts
    129
    Mentioned
    5 Post(s)
    Tagged
    0 Thread(s)
    Child events are there to cut down on the amount of repetitive lines of code in your events. Here's an example:

    Rather than having "on loop "moveBullet"" across every single line under those events, you can just have the condition in once, so your events are more compact and a little easier to read.


    That example had just one condition though being the 'parent' event - here's one where the difference is a bit more dramatic. This what it looks like if you have multiple common conditions in an event line



    Basically it lets you work faster and makes your events more legible

  5. #5
    Clicker Multimedia Fusion 2
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)iOS Export Module (Steam)
    Aloan's Avatar
    Join Date
    Dec 2008
    Location
    Massachusetts, USA
    Posts
    360
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    So then the only BIG difference between Parent/child/nested and Groups/sub-groups/nested are that one can be deactivated and the other not... (hope I am right - I also was very confused at first)

  6. #6
    Clicker Fusion 2.5Android Export Module

    Join Date
    Jan 2007
    Posts
    254
    Mentioned
    5 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by Christian_Wheel View Post
    Parent/Child events help a lot in terms of code readability, and also slightly speed up your project because you don't have to test for the same condition every line.

    Consider:
    Code:
    IF X = True THEN
    	IF Y = True THEN DOSOMETHING1
    	IF Z = True THEN DOSOMETHING2
    	IF I = True THEN DOSOMETHING3
    END IF
    vs

    Code:
    IF X = TRUE AND Y = TRUE THEN DOSOMETHING1
    IF X = TRUE AND Z = TRUE THEN DOSOMETHING2
    IF X = TRUE AND I = TRUE THEN DOSOMETHING3
    Both examples have the same effect, but in the second example, X is evaluated 3 times versus once in the first example, which leads to slower execution. BUT activating groups is a totally legitimate alternative.
    Activating/deactivating groups introduces a 1 frame delay. Tremendous problem for anything even remotely complex.

  7. #7
    Clickteam Clickteam

    Join Date
    Jun 2006
    Location
    France
    Posts
    12,686
    Mentioned
    46 Post(s)
    Tagged
    2 Thread(s)
    Quote Originally Posted by GamesterX23 View Post
    Activating/deactivating groups introduces a 1 frame delay. Tremendous problem for anything even remotely complex.
    Err... if the action that activate or deactivate the group is before this group, then afaik it's taken into account in the same frame, there is no delay.

  8. #8
    Clicker Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    Volnaiskra's Avatar
    Join Date
    Jan 2014
    Location
    www.sprykegame.com
    Posts
    1,953
    Mentioned
    51 Post(s)
    Tagged
    0 Thread(s)
    I've never noticed any delay, but I figured I'd do a quick check to make 100% sure. As you can see, it works as Yves says:


  9. #9
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCiOS Export ModuleInstall Creator Pro
    Julian82's Avatar
    Join Date
    May 2012
    Location
    outbuddies.com
    Posts
    867
    Mentioned
    43 Post(s)
    Tagged
    0 Thread(s)
    I also cannot confirm any delay with group activation. I think deactivation in the middle of a set of grouped events even closes the group immediately, allowing to skip the remaining part of events. I’ll still prefer the group method over Sub-events for larger chunks of code, but Sub-events are for sure very handy too still wished they were color-coded tho.

  10. #10
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCiOS Export ModuleInstall Creator Pro
    Julian82's Avatar
    Join Date
    May 2012
    Location
    outbuddies.com
    Posts
    867
    Mentioned
    43 Post(s)
    Tagged
    0 Thread(s)
    Just to make sure we’re discussing the same thing. Of course, as Yves said, activating a group does respect the event order. So you cannot activate a group in line 10 with an event in line 20 and make Fusion “jump back” to that group within the same frame loop. For this, you’ll always need to set up a fast loop, which IMO also has little performance impact compared to group or SUB-event method.

Page 1 of 2 1 2 LastLast

Similar Threads

  1. Replies: 2
    Last Post: 25th January 2017, 02:03 AM
  2. Parent Child Help please
    By Nicholas Martin in forum Fusion 2.5
    Replies: 11
    Last Post: 15th October 2016, 11:13 PM
  3. Parent-Child?
    By xhunterko in forum File Archive
    Replies: 2
    Last Post: 6th December 2009, 08:18 PM
  4. 2-parent, 1-child creation
    By Ultimo240 in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 25th November 2009, 10:26 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
  •