It would be good if AGS defined some builtin #defines for some of the hard limits, especially iif someone is making a template and wants it to be future-proof:
e.g.
#define _AGS_MAX_OBJECTS_PER_ROOM 20
OH YES! I second that!
In particular, which limits would you want to have defines for?
Personally, I could use these right now:
- characters
- inventory items
- GUIs
- views
I also think that
- objects per room
- loops per view
- frames in each loop
could come in handy.
I'm a bit concerned by the need for these, I have to say. If you're wanting to iterate through them, GetGameParameter returns the actual number in the game, rather than the max.
Can you provide an example of where knowing the max is useful?
Yes, I know about GetGameParameter.
I think the defines would mostly be used for array declarations, for example, to be able to add stuff to characters/objects/... that, unlike custom properties, can be changed at run-time.
- characters
Useful for declaring the character array I use for my CCS script.
- inventory items
Ok, I see there's MAX_INV already. And there's no GetGameParameter entry for that one.
- GUIs
short WasGUIOn[AGS_MAXGUIS]; // stores old gui status
I have two functions that I use to see which GUIs are currently shown, store if they are on/off, turn all GUIs off, and later be able to turn on only the ones that were turned on before the reason I wanted to turn everything off.
- views
I'm playing around with using additional frame sounds with the CCS system, so I needed this at one point. Can't think of another example offhand.
Ok, I see your point. I've added some constants like these to beta 9.
Hehe, 6 hours from suggestion to implementation...must be a new record. ;)