how much is the flag limit? Because my game seems to be confusing flags with eachother so I assume I have reach some sort of limit
Printable View
how much is the flag limit? Because my game seems to be confusing flags with eachother so I assume I have reach some sort of limit
nevermind I've been told its a total of 32
... thats not a lot but yeah
Yeh I know, lots of people are reaching the limits of flags and values... I just use valueAdd extension
32 but it's basically accessed like moduloQuote:
Originally Posted by MechaBowser
so if you're using flag "36" it'll actually junk up flag 4
There are actually 33 flags! 0-32 will work. :)
Well, flags are stored in a long integer, 4 bytes, 32 bits, so there only are 32 flags possible.
Wow, really? 32 flags? o_O
I really imagined there were unlimited number of flags, being that I could use any number I wanted. Even #'s above 100 worked. X_X
But I never used over 32 flags so I didn't really see a problem. @_@
Hi everyone. It is 0-31 for flag numbers.
Marv
It really should have a notice at the top of the 'enter flag number expression screen' saying '0-31'.
Indeed. The modulo operation makes it even more confusing. Imagine someone uses all flags extensively and doesn't know why his app's randomly turning flag 2 on/off - because he used flag 33...
I agree....
There really should be a way for it to limit flags after 30, or 31, if it really does have a limit. For example, when I go to enter 123 as a flag. It should stop, and say something like 'only numbers 0-30 are valid' or something like that. Like how some of the other modules worked with their limits.
Well I disagree with not allowing larger numbers, but I think a little warning like the one for setting the angle of an object should be in the window title
There was a thread a while ago I think made by Jamie about using an alterable values as a Bitflag. if you search bitflag you should find it.
basically you have a value like this 1100110101 with each number representing ON or OFF then you the mod operators to figure out which one it is.
This way you waste one value but can cram I think up to 16 numbers in one value (maybe 32 numbers??)
I do this too for various values. For example on RPGS I add Level and XP in one value.
XP starts at 100 and your Level starts at 1
value = 101 (100+1)
value = 23534 (23500+34)
Level 34, 23500 xp
to retrieve: fastloop -100 until no longer possible, then retrieve level.
You can do this with all kind of values that do not share the same number region.
Or use one value to store various information:
517894234427
5 | 17894 | 23442 | 7
Level 5, 17894 score, 23442 $, weapon 7 selected
and so on.
woudln't it be easier and faster to just mod 100 it out instead (assuming 'level' tops out at 99)Quote:
Originally Posted by maVado
though i don't think a number that large would work since it'd be converted into an exponent and you'd lose a good chunk of that informationQuote:
Or use one value to store various information:
517894234427
5 | 17894 | 23442 | 7
Level 5, 17894 score, 23442 $, weapon 7 selected
MMF2 uses double precision internally now, getting you about 52 bits of accuracy plus an exponent. This means that numbers up to 4503599627370496 are represented perfectly. Extensions only get 23-bit accuracy 32-bit floats (rest is exponent) or 32-bit integers though.
Hey, sorry to bump this topic, but I got a question about this.
I know the flag limit is about 30 (whether its 31, or 32, or whatever), but does this account for ALL active objects? Or can another active object have its own set of 30 something flags?
For example, there are 2 active objects.
1st Active object has 30 flags available.
2nd Active object has its own 30 flags available.
Is it like that, or does both active objects share the same set of 30 flags?
They're separate, same as Alterable Values.
Hi N64Mario. Also the limit for flags for each active is 32, 0-31.
Marv
Oh okay. That makes sense. Thanks. :)
Although I was thinking what would be a nice feature, is that if you use a number higher than 0-31, for example 32, it should display like this.
Flag 30 is off/on.
Flag 31 is off/on.
Flag 32 (0) is off/on.
Flag 33 (1) is off/on.
etc.
etc.
In the parenthesis you can see which flag goes back to when the number are higher than 31. While at the same time you are using another number of your choosing.
Either that, or use the other idea to help notify us when flag limit is over.
It would be a nice system, to have MMF2 remind the user that they can not overstep flags.
Marv
Just a text saying "(0-31)" in the caption is a reasonable solution. I'd be happy if MMF wasn't dumbed down, in every expression the user has to know to stay within the range and, I can't see why flag expressions should provide unreasonable help. Sure, MMF should be beginner friendly, but it has to be sane too - CT have more important tasks to do than to protect every user about every mistake they can possibly make.Quote:
Originally Posted by N64Mario
I mean, you'll notice something goes wrong anyway when the flags wraps, and if you can't debug on your own to find the cause, that's one area you'll need to practice in either case.
And it's useful to have it wrap, because variables can then define which flag gets turned on/off, no matter what number they are.
I agree with Nifflas, just a small (0-31) in the caption would be enough