variable already defined in _AutoGenerated.ash

Started by HandsFree, Wed 23/11/2016 19:50:20

Previous topic - Next topic

HandsFree

A hotspot is apparently already defined in _AutoGenerated.ash.
How can I fix that? What is _AutoGenerated.ash and where can I find/edit it?

thanks

Crimson Wizard

"hotspot" is a global array of hotspots in the room, it is made for accessing hotspots by index. _AutoGenerated.ash is a built-in header created by AGS, you cannot modify it.

HandsFree

So how do I get rid of this error? The game won't save anymore.

Crimson Wizard

Quote from: HandsFree on Wed 23/11/2016 20:26:04
So how do I get rid of this error? The game won't save anymore.
There is probably a variable or object called "hotspot" in your game; you need to rename it to something else, because it conflicts with built-in AGS declaration.

HandsFree

The variable is called hCrashSite and there's only one of it.
I can rename to something else I suppose, but why does the game not accept it?

Crimson Wizard

Quote from: HandsFree on Wed 23/11/2016 21:56:30
The variable is called hCrashSite and there's only one of it.

Wait, what is the actual error message you are getting, and what line in your script does it refer to?

HandsFree

Error (line 410): Variable 'hCrashSite' is already defined.
File: _AutoGenerated.ash.

Slasher

Have you done an editor search for hCrashSite to see if more than one entry?




Crimson Wizard

Oh, first I thought that "hotspot" word is causing this issue.

I made some tests and I found that it is easy to reproduce this bug: all you have to do is to create two objects, hotspots etc and give them the same name. For some reason AGS does not prevent this until you try to save the room or compile the game.

I suggest searching all your room elements to see if you created second hCrashSite somewhere.

HandsFree

Yeah, sorry, there was another one. I was sure there wasn't but it appears I created one ages ago. :confused:

SMF spam blocked by CleanTalk