Question about #define

Started by fireapache, Sun 31/07/2011 19:56:18

Previous topic - Next topic

fireapache

Hi, Folks, I have got some questions to ask about definitions:

What the #define does?

In the KeyboardMovement.asc (Default Template) I found this: #define DISTANCE 10000

This is the same thing if I called const int or just int?

I've found #ifdef and #endif in another script, then the definition needs to be logical or I can use numerical equations?

Well, I'd like some complete explanation about this, please!  :=

Khris

#1
A quick forum seach for #ifdef yielded this:
http://www.adventuregamestudio.co.uk/yabb/index.php?topic=32840.0

To elaborate, everything between #ifdef X and #endif is ignored and not compiled, if X is undefined.
Everything between #ifndef and #endif is only compiled when X is undefined.
There's also #ifver.

All of those can be used to find out what AGS version is used or whether the game's compiler settings are strict or not (only new-style commands or not) and similar stuff.
They are only needed by module coders who want their module to work with several older version of AGS, too.

You don't really need them to make your own game.

fireapache

Hey, Thanks Khris, good reply!  8)

SMF spam blocked by CleanTalk