Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: SSH on Mon 03/01/2005 09:02:32

Title: SUGGESTION: builtin defines
Post by: SSH on Mon 03/01/2005 09:02:32
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
Title: Re: SUGGESTION: builtin defines
Post by: strazer on Mon 03/01/2005 09:09:18
OH YES! I second that!
Title: Re: SUGGESTION: builtin defines
Post by: Pumaman on Mon 03/01/2005 13:15:46
In particular, which limits would you want to have defines for?
Title: Re: SUGGESTION: builtin defines
Post by: strazer on Mon 03/01/2005 13:30:45
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.
Title: Re: SUGGESTION: builtin defines
Post by: Pumaman on Mon 03/01/2005 13:43:07
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?
Title: Re: SUGGESTION: builtin defines
Post by: strazer on Mon 03/01/2005 14:16:52
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.
Title: Re: SUGGESTION: builtin defines
Post by: Pumaman on Mon 03/01/2005 15:15:24
Ok, I see your point. I've added some constants like these to beta 9.
Title: Re: SUGGESTION: builtin defines
Post by: strazer on Mon 03/01/2005 16:56:21
Hehe, 6 hours from suggestion to implementation...must be a new record. ;)