User Tag List

Results 1 to 7 of 7

Thread: Deactivating groups for specific instances of actives?

  1. #1
    Clicker Fusion 2.5 Developer

    Join Date
    Jan 2013
    Posts
    40
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Deactivating groups for specific instances of actives?

    I am making a game that is using behaviors for the sake of easier transitions between frames with object integration.

    I have 10 actives of the same type on screen all using a behavior. Within that behavior is an event that calls to deactivate a event-group when the active is clicked on.

    Ideally what would happen is that ONLY the active I click on has its group deactivate, but instead it applies to every instance of the active in frame.

    Is there a way to deactivate a group of events only on one specific instance of an active? If not, is there a work around to this?

  2. #2
    Clicker Fusion 2.5 Developer

    Join Date
    Jan 2013
    Posts
    40
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    (Note - only an example being given here with the object clicking. The importance here is that there were a lot of groups I was activating and deactivating that I'd like to maintain for organized functionality.)

  3. #3
    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)
    You can't activate/deactivate groups for certain instances, it's either for everyone or for none.
    You will have to change the group activation/deactivation for something else, like For Each Loops, or just simple flag checks.
    - BartekB, a.k.a Uppernate
    Join the Click Converse Discord! - https://discord.gg/R3WuvF3mHr

  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)
    I had this problem recently, see post https://community.clickteam.com/threads/108425-Behaviours-in-created-instances.

    If you can use clones instead of duplicates , they will work the way you want.

  5. #5
    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
    2,548
    Mentioned
    133 Post(s)
    Tagged
    0 Thread(s)
    Though when you start cloning lots of objects, you lose much of the benefit of using behaviours. You now have isolated bits of code in 10 different spots. Every time you need to fix a bug or add a feature, you need to do it x10 times. Which would be bad enough in any case, but is made even worse by how fiddly Fusion makes it to just access the behaviours.

    BartekB's advice is the sensible way to go IMO. Also, try and keep most of your code in a single frame or in global events. That way you get a similar benefit to what behaviours give you anway (ie. a single block of code that you won't need to copy and paste every time you put a particular object into a new frame)

    You can still use group activation/deactivation to help organise your code, and to stop unecessary events running for enemies who don't need them. But the actual work of sorting and separating your enemies will be done by forEach loops and flag/altVal checks. Here's an example from my MFA, where I have a bunch of different code that enemies use to navigate the environment. It's all kept in separate groups:




    But only relevant groups will be made available to each enemy on a case-by-case basis, as I open/close those groups as needed while I run a forEach loop. If I have 20 enemies, it will run the forEach loop 20 times, and each time it will open/close whichever groups that particularly enemy needs. Here's one of the sections, which deals with finding a hole in the ground in front of an enemy:




    If the detectors in event #4047 find a hole, then they activate another group (⛯ ground nav - HOLE ) that will perform more detailed checks about that hole (is it small enough to jump over, is there something dangerous on the other side of it? etc.)

    But if this particular enemy can't jump over holes, then it doesn't actually need any further checks - it just needs to turn around and walk the other way, and that's that. So for enemies like this (and only for enemies like this), event #4049 will close various groups before the forEach gets to them.



    So, using this method, you sort of can have groups open/close for specific instances. But you need the forEach loop to be able to orchestrate the opening and closing of them, since the forEach loop repeatedly runs through the code one-by-one (once for each enemy), whereas normal code (including Behaviour events) just runs once per game loop.

  6. #6
    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, I agree cloning isnt ideal, its just a work around to the problem,
    not too bad to change things, just update one, delete the others, the clone again, if you have a foreach loop for setting ids etc.

    looks very neat @Volnaiskra; , have you created a custom font to get those images in group names ?,
    had just been thinking it would be nice if they could be coloured like comments.

  7. #7
    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
    2,548
    Mentioned
    133 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by stiggits View Post
    yes, I agree cloning isnt ideal, its just a work around to the problem,
    not too bad to change things, just update one, delete the others, the clone again, if you have a foreach loop for setting ids etc.
    That's a good point. Deleting and re-cloning would be pretty straightforward. Still, I don't like how you'd end up with objects that look identical but are actually different objects. When you come back in 6 months to reference that object in your regular Frame Events, you basically must still remember about the identical clones, or else that's a bug waiting to happen.

    Quote Originally Posted by stiggits View Post
    looks very neat @Volnaiskra; , have you created a custom font to get those images in group names ?,
    had just been thinking it would be nice if they could be coloured like comments.
    There are a surprising number of extended characters that work really well in Fusion (not just group names, but altVal names and comments also). Once I discovered this, keeping my code labelled has become something of an obsession But it's definitely made a very positive difference to how quickly and easily I can navigate my 10,000+ events!

    To see what characters there are that you can use, get the Character Map UWP from the Windows Store (much better than the inbuilt character map utility) and use it to browse characters from:
    Segoe UI
    Segoe Emoji
    Segoe UI Symbol
    Segoe MDl2 Assets


    Here's an (otherwise empty) MFA with some good ones in it: https://community.clickteam.com/threads/105887-Is-it-ok-to-use-non-standard-characters-in-AltVal-names?p=753599&viewfull=1#post753599

Similar Threads

  1. Replies: 3
    Last Post: 15th January 2016, 08:24 PM
  2. Does deactivating 'Groups Of Events' give a speed advantage for Flash Applications?
    By King_Cool in forum SWF/Flash Export Module Version 2.0
    Replies: 1
    Last Post: 20th May 2012, 11:27 PM
  3. Technical Question about deactivating Groups..
    By Locaz00 in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 1st November 2008, 06:22 PM
  4. Deactivating Groups + Spread Value
    By artician in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 6th June 2008, 12:25 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
  •