I've been reading through the demo quest documentation (second post here : Demo Quest 3.1 Thread (http://www.adventuregamestudio.co.uk/yabb/index.php?topic=34048.0)) and there is section about Custom Terms. I take a quick glance (really quick) at the Demo Quest source code and search for uses if the custom term (like TOUCHED) and didn't find any.
What would I use those for ? What is the best exemple of use for the custom term.
Thank in advance.
Which section exactly? I couldn't find anything. Do you mean Custom properties? Or actually "Custom Terms"?
It's in the programming convention (6.3), in the global script header example.
Custom Terms:
o Uppercase Notation
o Single words
o No prefix
o Values arbitarily assigned
// Script Header
#define A -01000
#define ALERGIC -01001
#define AUTOMATIC -01002
:
#define B -02000
:
#define Z -26000
// Script Header
#define A -01000
#define ALERGIC -01001
#define APPLE -01002
#define AUTOMATIC -01003
// Any Room Script or Global Script
int foobar = APPLE;
if (foobar==APPLE) {
}
else if (foobar!=APPLE) {
}
I see, that should be constants.
AGS allows you to define your own constants using the #define "keyword".
Before the script is compiled, the name of the constant is replaced with its value.
AGS has pre-defined constants (http://www.adventuregamestudio.co.uk/manual/Constants.htm).
An example use of constants would be parameters of a module that are supposed to be altered by the user.
Thank you for your answer.
I know about the #define keyword, but I tough that the "Custom Term" uses of them was something specific of AGS.
So finally I must understand that it's a convention on using constant for "term"...
The DemoQuest was updated last in March 2008. Everything in there is severely outdated and I wouldn't recommend its usage at all, let alone specific programming conventions.
Plus, those are only relevant if you plan to publish the sources.
I was looking at it that way too, but regardless I found some interesting knowledge.