Every object has a unique fixed value. I am curious to how these are assigned?
Cheers!![]()


Every object has a unique fixed value. I am curious to how these are assigned?
Cheers!![]()









Chris. They are numbered by type and then by order created in the frame editor.
Marv
458 TGF to CTF 2.5+ Examples and games
http://www.castles-of-britain.com/mmf2examples.htm





How unique are fixed values? I mean are fixed values unique across the entire application or just that frame? What I mean is, if I have two frames will the fixed values of every object in both frames be completely different or will it start numbering them again in a new frame? I can't seem to find information about fixed values in the help file.

A fixed value is just a hexadecimal string (converted to an integer), composed of three parts:
0x | t | i
"0x" is just those two characters (in computing, 0x always represents a hexadecimal).
"t" is the total number of objects which have already been created in the current frame. It doesn't make any difference if objects have been destroyed, "t" can only increase. Initially, "t" is only a single character in length, but it increases in length if there are more than 15 objects (15 = F = the highest value that can be expressed in hexadecimal with one character).
"i" is related to the total number of objects that are on screen - so if there were no other objects it would be "0000"; if there were 1 it would be "0001"; and so on. However, if an object has been destroyed, MMF2 will go back and reuse its "i" value the next time a new object is created (starting with the lowest unused value). "i" is always 4 characters in length.
For objects created in the frame editor, fixed values are assigned according to object type, starting with background objects, then actives and extensions, and finally windows controls (edit boxes, lists, etc). You can see the exact order by selecting everything and looking at the values that appear in the blue boxes at the top-left corner of each object.
Why Clickteam didn't just use "t" alone as the fixed value, is something of a mystery to me...
See Aphant's article here: http://www.create-games.com/article.asp?id=2139





That's awesome. I had a system where I got the game to remember what objects had been destroyed in an earlier frame by spread value, and stored them in a string with delimiters, so you could return to an earlier frame with the objects destroyed at start, think of a Metroid type game where enemies don't respawn for example. Now though, due to these, I could just use the fixed value instead.
But I'm still none the wiser about frames, the top-left shown value starts from 1 again in each frame, but I've been told that fixed values are unique throughout the entire application, as in if I have three objects in frame 1, and three objects in frame 2, there will be six unique fixed values? Or will it be three repeated twice? To put it simply, do I have to add the frame number into the equation when storing references to objects?
Also I need to know if fixed values change at runtime (OK they're called 'fixed' I know, but that article gave me the impression that they can change), for example, if I create a new object at runtime, do fixed values of previous objects change? If this is the case I can't rely on fixed values to remember, for example, which enemies have been killed.
EDIT: After some experimenting I found that fixed values DO restart in different frames (e.g. if 8 active objects in each frame Active Object 1 in Frame 1 will be 65536, Active Object 1 in Frame 2 will also be 65536), so it's better to identify objects in my string as say Str$(frame)+"."+Str$(fixed value) I think.