Deactivating groups for specific instances of actives?

Welcome to our brand new Clickteam Community Hub! We hope you will enjoy using the new features, which we will be further expanding in the coming months.

A few features including Passport are unavailable initially whilst we monitor stability of the new platform, we hope to bring these online very soon. Small issues will crop up following the import from our old system, including some message formatting, translation accuracy and other things.

Thank you for your patience whilst we've worked on this and we look forward to more exciting community developments soon!

Clickteam.
  • 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?

  • (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.)

  • 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

    Join the Click Converse Discord! - Please login to see this link.

  • 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:

    Please login to see this picture.


    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:

    Please login to see this picture.


    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.

    Please login to see this link.
    My Fusion Tools: Please login to see this link. | Please login to see this link. | Please login to see this link.

  • 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 [MENTION]Volnaiskra[/MENTION] , 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.

  • 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.

    looks very neat [MENTION]Volnaiskra[/MENTION] , 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 X) 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: Please login to see this link.

    Please login to see this link.
    My Fusion Tools: Please login to see this link. | Please login to see this link. | Please login to see this link.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!