I've made an improvement to NewRisingSun's GAL decompiler to allow sysdefs like:
%var menaceIsHere 103 ALL
%var witchGrabbed 103 21
This means that menaceIsHere is generally the name of variable 103, except in room 21, where it is called witchGrabbed. This is useful because of the crowded variable space in both GAL and AGI. Something to consider?
(I don't think menaceIsHere is a good general name anymore, btw - its uses are far too varied)
Interesting idea - I've been thinking about ways to improve how defines are handled but haven't decided for sure what improvements to make.
When decompiling, WinAGI doesn't attempt to name variables and flags unless they are one of the reserved items. Are you saying that when decompiling, you want to assign defines that the decompiler should use for non-reserved variables? That seems like it would rarely be useful- how often would you really know what the purpose of variables are unless you already have source code, or unless you've previously decompiled and then figured out what they do?
As for creating new source code, WinAGI will already handle the situation you describe - use
#define menaceIsHere v103 in globals.txt and then use
#define witchGrabbed v103 in logic 21 source code. The local define will override the global define. (The hierarchy that WinAGI uses when duplicate define names are encountered is local > global > resourceIDs > reserved).
The
%var keyword is currently not recognized in AGI Fan Syntax (AGI-FS) - it's only used is Sierra Syntax (AGI-SS). Adding additional functionality to it in AGI-SS isn't something I want to do- WinAGI currently supports AGI-SS to allow for compilation of Sierra source code. I want it to remain 100% compatible. But I suppose I could add
%var as an additional keyword for AGI-FS in addition to
#define. I'll give it some thought, but probably won't do anything with it right now- my focus is on finishing up all other editors and release an updated version that can do what the VB version does.