User Tag List

Results 1 to 6 of 6

Thread: Flag limit / flag values looping

  1. #1
    Clicker Fusion 2.5 DeveloperiOS Export Module
    butterfingers's Avatar
    Join Date
    Apr 2012
    Location
    London
    Posts
    135
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)

    Flag limit / flag values looping

    So, just to point out (although I'm sure its been noticed before).

    I always thought you could have an unlimited number of flags (it's totally possible to type the expression "Flag 120 is on")

    But, you are actually limited to 32 flags (numbered from 0-31)

    the weird thing is, you can specify a higher number (like flag 32 for example), but the number loops around.

    So. If you set flag 32 on, it actually sets flag 0 on. flag 33 controls flag 1 and so on.

    Flags are just booleans, so why on earth you're limited to 32 of them is beyond me. Seems un-duly limiting, but there you go. Just thought I'd point it out. Even though you can speficy flag 100, you're actually just activating flag 7.

  2. #2
    Clicker Fusion 2.5
    Del_Duio's Avatar
    Join Date
    Sep 2008
    Location
    Cygnus X-I
    Posts
    985
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    I have noticed this same thing!

    For the text custenes in Hasslevania 2, in order to control when the lines are displayed I use an active object's flags but had a lot of problems where (for longer scenes) the lines would stop displaying anymore. I didn't put a number to it but I would say it was around 30 lines or so.

    At least now I know for sure what the issue was, and that it wasn't just me or my crap computer. Thanks butterfingers!

  3. #3
    Forum Moderator

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export ModuleXNA Export ModuleInstall Creator Pro
    nivram's Avatar
    Join Date
    Jul 2006
    Location
    Bandon, Oregon
    Posts
    6,840
    Mentioned
    12 Post(s)
    Tagged
    0 Thread(s)
    There is a Flags extension that would give you unlimited flags for MMF2.

    Marv
    ​458 TGF to CTF 2.5+ Examples and games
    http://www.castles-of-britain.com/mmf2examples.htm

  4. #4
    Clicker Fusion 2.5Android Export ModuleSWF Export Module
    Ziplock's Avatar
    Join Date
    Oct 2013
    Posts
    448
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I've always felt flags are kind of icky for organization's sake anyway. I always make myself a main "flag" object and give that values ("HeroJumping," "Grav," etc) and I set them to 0 or 1. That way they have names I can keep track of when I get into hundreds of lines of code. And, like you said, no 32 limit.

  5. #5
    Clicker Fusion 2.5 DeveloperiOS Export Module
    butterfingers's Avatar
    Join Date
    Apr 2012
    Location
    London
    Posts
    135
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    @ziplock

    True, but if you're using Flags within say, an enemy active, that has many instances, then you have to have an equal number of additional "flag objects" for each one, which is hugely inefficient. What you're saying totally works, but only if you have a few instances of that object in the scene (like the player for example).

    @Nivram

    As with the above comment, does the flags extention extend the number of flags on a per-active basis, or is it just an object that contains a bunch of flags?

  6. #6
    Clicker Fusion 2.5Android Export ModuleSWF Export Module
    Ziplock's Avatar
    Join Date
    Oct 2013
    Posts
    448
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You're misunderstanding. I don't use flags at all. I put in an active object and use it as my "flag" object and I use it anytime I would use a flag. So the main "flag" object would have a variable like "HeroJumpFlag" and I would set it to 0 or 1. If I have more than 26 "flags" I create a new object and usually use something like "hero" and "villain" objects. You could take this method into perpetuity, but if you have more than 56 "flags" in a scene, there's probably a more efficient way of doing things.

    If you're using multiple instances of an enemy object, you could just have a variable in the enemy itself for "ID" and set it to 0 or 1 instead of using flags.

    It also is very handy when there are multiple states for the object. Like I could set "HeroJumpFlag" to 0 for off, 1 for on, 2 for double jump, 3 for super jump, etc. Real flags would require you to do "If 1 is off... if 1 is on and 2 is off... if 2 is on and 3 is off..."

    I'm trying to get in the habit also of using -1/1 for my values when they're strictly Boolean so I can multiply by -1 to simply toggle them.

    There's no right or wrong way of doing things, but this method has all the benefits of flags and eliminates all of the negatives.

Similar Threads

  1. Toggle Flag this way not possible?
    By Perry in forum Fusion 2.5
    Replies: 7
    Last Post: 11th March 2014, 09:36 AM
  2. [REQ] Set flag by expression
    By Olivier in forum Multimedia Fusion 2 - Technical Support
    Replies: 9
    Last Post: 28th April 2013, 07:48 PM
  3. I need more flag
    By MEHRDAD in forum Multimedia Fusion 2 - Technical Support
    Replies: 24
    Last Post: 23rd January 2012, 06:37 PM
  4. What is flag?
    By Nyc in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 9th June 2011, 02:49 PM
  5. flag values question
    By LazyCoder in forum Multimedia Fusion 2 - Technical Support
    Replies: 11
    Last Post: 6th September 2006, 03:23 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
  •