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've never used flags. Probably because I watched one of Snail's videos a few years ago where he drummed it into me not to. My understanding is that it's not worth using flags since they can't do anything that Alterable Values can't already do, but come with several disadvantages (mainly the inability to name them, which makes for messy code that is easy to get lost in down the track).

    But are there some legitimately good uses for them? How/when do you guys use them?

    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.

  • I'm using flags in my current fan game i am helping a friend make. True you can't name them, but it gives a more variation, and more conditions to work with. I think I've gotten some use out of them, along with alterable values. So I say it's worth to keep the flags in the code.

    The only thing I can see it being messy is that you will eventually forget what the flag does over 5 years. So always make comments inside your script for any major flags you use.

  • I mainly use it for things that need to be toggled on or off, or things that require only to be true or false.

    I've attached an example of what I mean in the form of a value toggle between 0 and 1.

    Yes, the hassle of not being able to name them is annoying, but I usually just have a comment where I jot down what each flag is for.

  • I abuse flags if i have to be honest... The naming thing i can agree about, i usually have a comment that Clearifies but it can be an issue. But in some regards they works so well since you can toggle them and sometimes it's nice to simply have an on and off.

    Please login to see this link.
    Please login to see this link.|Please login to see this link.|Please login to see this link.

  • Well, i used flags or alt value. With flag, you must coment very well your code. In my code, flag is use for a type of reaction and alt value ou counter is use to make a certain action.

    [SIGPIC][/SIGPIC]Please login to see this link.

  • I use them a lot,
    and generally keep both a txt file and a comment on top of event list,
    writing down what each object flag does

    I've tested in the past and they are imperceptibly faster than alt values, by a really negligible amount XD,
    so I use them not for this reason,
    but whenever I don't want "waste" a value for a strictly binary (yes/no) operation
    (I often end up using all "nameable" object values)

    Also use them a lot for making "ELSE"
    even just one of them in a dedicated "engine" object to make all elses inside loops

    imo lacking features that would make them much more friendly and comfortable would be:

    - being nameable
    - being pre-settable
    - dynamically setting/retrieving them by index

    >> Fusion3, hopefully

    a selection of my Fusion examples can be found Please login to see this link.

  • I'm a Flag guy too.. I usually use the flags only for the object that needs it too, otherwise you'll get lost. and make sure you name them properly.
    And Like Schrodinger said, a comment at the top of my source with all the flags. so I know after a year what it was used for.

  • schrodinger, would you mind elaborating on this?

    Quote

    Also use them a lot for making "ELSE"
    even just one of them in a dedicated "engine" object to make all elses inside loops

    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.

  • Just to give another example of what i used flags for.
    Flag # off would be normal gravity setting.
    Flag # on would be reverse gravity, where standing on a ceiling is a thing.

    So pretty much what has already been said here. I don't want to waste an alterable value just for a binary true/false check. I use flags for that kind of condition.

  • @ Volnaiskra:
    I often use flags for "elses" in the sort of pseudo-functions you can do with fastloops
    (but also in the normal code flow)
    i.e.

    start loop "do something"

    on loop "do something"
    >>> set flag 0 of "engine" OFF

    on loop "do something"
    + is this like that?
    >>> set flag 0 of "engine" ON
    >>> do something

    on loop "do something"
    + flag 0 of "engine" OFF (== ELSE)
    >>> do something else

    makes sense when your condition is one you can't quickly and simply (and more efficiently) negate to obtain the other case

    Since I generally have one "engine" object (used to store the most general but specific-frame-related values)
    in each frame, I tend to use a specific flag of that object for as many of these "ELSE" tests I might need to do


    Btw, another thing I use flags for is "marking" subsets of objects,
    say I have the "enemies" object (i.e. an active containing a set of animations for different enemies)
    and I want a group of them doing something particular,
    I can set a flag (say, flag 10 = "are attacking!") on
    and then quickly iterate all of them with a foreach

    flag 10 on
    >>> loop on each one of >>> do stuff

    this can be made also with values and strings of course,
    and perhaps more cleanly if it's a state which can likely have more than just two ways
    (attacking / fleeing / loitering...)
    so perhaps it's not a very good example XD ...
    ...but consider this for "binary" states, and it's quite clean and efficient to use

    another example on something I'm working on right now: I have "inventory" items and "game" items,
    (same object to use same graphics and update it quickly and without hassle on need)
    but inventory items have flag 0 ON, so that makes for all necessary filtering

    a selection of my Fusion examples can be found Please login to see this link.

  • I'm an avid flag user (where necessary). I prefer flags for toggling, like Rhys. I don't overuse them as you can't name them. I typically limit the use of flags to maybe 2-3 per project.

    Game Launcher Creator V3 - Please login to see this link.
    Bespoke Software Development - Please login to see this link.
    Learn Clickteam Fusion 2.5 - Please login to see this link.

    Danny // Clickteam

  • I love flags as well for the toggling, I try to keep them in the same group if I can with comments, and try to keep it under 5. Otherwise, I'll use alterable values for the naming so it doesn't get too messy!

    Please login to see this link.

  • Like SnailOn said: never use flags (c)
    You can't really know what specific flags do if you overload by them your code.

    That's why you put comments in your project, so you know what they do :)

    If you use a lot of light switches or something like that, then Toggle Flag is easier than making several events to get the same results

  • I use them for toggling in Behaviors since there's only going to be a few lines of code in there.

    In any other instance I'll use Alt Values/Strings or Global Values/Strings.

    Professional Game Developer

  • It would be useful if Clickteam could add the ability for users to define values (much like #define in C/C++) which would enable you to specify a descriptive string instead of a value. This would be useful not only for flags. For example add "Global Defines" which would open a text box and users could specify:

    PLAYER_GRAVITY 0
    PLAYER_INVINCIBILITY 1
    WORLD_FREEZE 0
    WORLD_SLOW 1

    Then just:
    Internal flag PLAYER_GRAVITY is on

    Which would be processed as:
    Internal flag 0 is on

    You could create a active and use its alterable values to store defines but you're limited to 26 per active but that would work like:
    Internal flag PLAYER_INVINCIBILITY( "globalDefines" ) is on

    This would at least help you keep track of which flag does what without looking back through your documentation/code.

Participate now!

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