SUGGESTION: builtin defines

Started by SSH, Mon 03/01/2005 09:02:32

Previous topic - Next topic

SSH

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
12

strazer


Pumaman

In particular, which limits would you want to have defines for?

strazer

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.

Pumaman

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?

strazer

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

Code: ags

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.

Pumaman

Ok, I see your point. I've added some constants like these to beta 9.

strazer

Hehe, 6 hours from suggestion to implementation...must be a new record. ;)

SMF spam blocked by CleanTalk