Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: fernewelten on Fri 11/05/2018 19:31:52

Title: [Solved] (Autogenerated) "Macro 'DEBUG' is already defined"
Post by: fernewelten on Fri 11/05/2018 19:31:52
Hello,

when editing a game and choosing "Build/Rebuild all files", I get the message:
Code (ags) Select
Failed to save room room1.crm; details below
_AutoGenerated.ash(67): Macro 'DEBUG' is already defined


The online help says that the most likely cause is two things with the same name. In that case, I'm at a loss what those names might be.

I can't read _Autogenerated.ash, so I can only guess at what the code tries to autogenerate.

So how do I hunt down the misalignment?

AGS version 3.4.1
Windows 10
Title: Re: (Autogenerated) Macro 'DEBUG' is already defined
Post by: Crimson Wizard on Fri 11/05/2018 19:39:21
Quote from: fernewelten on Fri 11/05/2018 19:31:52
The online help says that the most likely cause is two things with the same name. In that case, I'm at a loss what those names might be.

It's "DEBUG" name, as the error reports.

Make sure that you do not have any GUIs, characters, views, variables, etc called "DEBUG".

Also, AGS silently creates a number of numeric constants for characters, views, gui and something else, by taking out first letter in their name, for example if you have character cDebug, it will create DEBUG constant, that could also cause this error.
Title: Re: (Autogenerated) Macro 'DEBUG' is already defined
Post by: ManicMatt on Fri 11/05/2018 19:48:49
Also did you know you can highlight a word in a script and right click an option to find all uses of that word in all scripts? Useful tool, although if it is the name of a view etc, that's not going to find it that way. Just incase you weren't aware, that's all.
Title: Re: (Autogenerated) Macro 'DEBUG' is already defined
Post by: fernewelten on Fri 11/05/2018 22:24:39
Quote from: Crimson Wizard on Fri 11/05/2018 19:39:21
Also, AGS silently creates a number of numeric constants for characters, views, gui and something else, by taking out first letter in their name, for example if you have character cDebug, it will create DEBUG constant, that could also cause this error.

Thanks a lot: That pinpointed the problem. :-D Although I didn't have DEBUG for anything, I did have a GUI named gDebug (for showing debugging variables on-screen). Renaming that GUI to gDebugx made the error go away.

Also, special thanks to you and to ManicMatt for the ultra fast response time! 8-)