Heh I just made this post in response to a similar question on another forum, good timing.
You can store custom values on a unit but only of type real. So for a robust system what you basically need to do is to have an array of unit groups and then use a custom value as an index into that array. Then you also need a set of support functions to find an empty slot in the table for a new unit group as well as perform garbage collection. If you know certain limitations in advance, such as that you'll only ever have x unit groups per player, you can simplify quite a bit.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
What would be the easiest way to find out what unit group a unit is in (if any?) Assume I have 50 or more unit groups
I like the bumplife, I like to bump it, in the bump-co roundddd
Big Bump Theory
Heh I just made this post in response to a similar question on another forum, good timing.
You can store custom values on a unit but only of type real. So for a robust system what you basically need to do is to have an array of unit groups and then use a custom value as an index into that array. Then you also need a set of support functions to find an empty slot in the table for a new unit group as well as perform garbage collection. If you know certain limitations in advance, such as that you'll only ever have x unit groups per player, you can simplify quite a bit.