Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: Proskrito on Tue 29/06/2004 11:17:38

Title: #define inside another #define
Post by: Proskrito on Tue 29/06/2004 11:17:38
Sorry if its a silly question, or if its technically imposible, or whatever, but i dont know anything about scripting languages, nor how defines work:

Would it be possible to use a define inside another? like:
#define NUMBER 5

and later:
#define OTHER_NUMBER NUMBER

so OTHER_NUMBER would take the value of NUMBER
or even
#define OTHER_NUMBER NUMBER+3

so it would be like 5+3
I know its not possible now, but could it be in the future?
Title: Re: #define inside another #define
Post by: Gilbert on Tue 29/06/2004 11:23:17
I remember CJ explained about this issue in some other thread, but I'm just too lazy to dig that out.

I think the script compiler is not recursive, so don't do that.

And I don't think that's really such important, considering the effort on implementing it and it's not a complete programming package, #define was just there to give you some small convenience.
Title: Re: #define inside another #define
Post by: Proskrito on Tue 29/06/2004 11:30:21
QuoteI remember CJ explained about this issue in some other thread, but I'm just too lazy to dig that out.
do you mean this one? : http://www.adventuregamestudio.co.uk/yabb/index.php?topic=12394.0
QuoteAnd I don't think that's really such important, considering the effort on implementing it and it's not a complete programming package, #define was just there to give you some small convenience.
Ah ok, i just wanted to know if i should forget about it forever : )
Title: Re: #define inside another #define
Post by: Pumaman on Thu 01/07/2004 21:12:47
yeah, this is a known issue, but as Gilbert says it's not intended to be a full scale programming language, and there are plenty of other more important things to be done.
Title: Re: #define inside another #define
Post by: on Thu 01/07/2004 22:04:03
While we' re on the topic of preprocessor stuff, any chance for #include or additional modules to be implemented? The other day I coded a bunch of stuff on top of the script editor and it's looking to be pretty messy... I'm afraid that I won't be able to read it later on because there is a lot of stuff going on.

I guess I could just rely on using the menu on the main ags editor to access the function scripts, but I do have a lot of user-defined functions, and I said those are the ones I'm concerned about. Maybe the script editor could have a combo list of funcitons and whatnot (like visual studio does, you know?) that makes it easier to jump from function to function.

Then again... I COULD use my own text editor or even find a way to train visual studio to understand AGS code. Forget what I said. :P
Title: Re: #define inside another #define
Post by: Mr Jake on Fri 02/07/2004 08:57:07
thats what comments are for :D
Title: Re: #define inside another #define
Post by: Alynn on Fri 02/07/2004 18:05:10
Actually I had a thought like this... an external file that you can build your own function library... something that all games you make can use. It could save time coping and pasting from previous games into your global script...

Just a thought mind you... but it could be very useful
Title: Re: #define inside another #define
Post by: Pumaman on Fri 02/07/2004 18:54:15
#include is not planned; however, some sort of Add-In Manager, similar to the Plugin MAnager but for normal scripts, has been on my to-do list for a while.
Title: Re: #define inside another #define
Post by: Ishmael on Fri 02/07/2004 19:36:16
I believe I was the first to ages ago suggest #include to be added, and it got turned down; afterwards it has come up a few times. Excuse me, but do people ever search? As I found the thead with the search function very easily...