Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: Ryan Timothy B on Tue 31/08/2010 20:47:28

Title: [GLITCH] With Add/Edit/Delete of a global variable
Post by: Ryan Timothy B on Tue 31/08/2010 20:47:28
If you create a global variable in the editor pane then use it in a room script and then compile the game. Once you edit or delete that global variable within the global variable editor the game will crash and dump out this error:

Error: Unable to create local script: Runtime error: unresolved import 'variableName'


The only solution to find out what room has the issue is to rebuild all files each time you correct the issue for that one room. If you have multiple rooms with this global variable that you've deleted or edited, you have to rebuild it after each fix for each room.  In my case, I had to rebuild all files 6 times because I had the old global variable in 6 rooms.

EDIT: Ignore my horrible solution above to find which rooms have the issue, I don't want it to confuse and distract from the actual issue.
Title: Re: [GLITCH] With Edit/Delete of a global variable in Room script
Post by: monkey0506 on Wed 01/09/2010 03:14:52
You should just be able to edit the room scripts to remove any references to the variable and rebuild all files once (I would think). Otherwise what do you mean by "correct the issue for that one room"?

You don't have to rebuild all files to save changes to a room script, and rebuilding all files once should update any built-in room headers.

Whenever a script header file is changed all rooms have to be (and indeed are) rebuilt when the game is compiled. Presumably the same should be done when a global variable is added or removed (although obviously they aren't).
Title: Re: [GLITCH] With Edit/Delete of a global variable in Room script
Post by: Ryan Timothy B on Wed 01/09/2010 06:09:53
What I'm saying is that AGS doesn't recompile the room scripts when you edit or delete a global variable. It crashes the game when you try to play it. That's all.
Ignore my method on how I had to find out which rooms had the scripting issue. Since that's not the issue, just my hack attempt at finding which rooms had the issue. When obviously I should have just temporarily edited a script header like you mentioned.


When you add, edit or delete a global variable, AGS should mark all rooms as 'edited' and force a recompile whenever you try to compile the game.
Title: Re: [GLITCH] With Add/Edit/Delete of a global variable
Post by: monkey0506 on Thu 02/09/2010 03:40:22
Consider it ignored then. :=
Title: Re: [GLITCH] With Add/Edit/Delete of a global variable
Post by: Pumaman on Thu 02/09/2010 21:59:28
Quote from: Ryan Timothy on Wed 01/09/2010 06:09:53
When you add, edit or delete a global variable, AGS should mark all rooms as 'edited' and force a recompile whenever you try to compile the game.

Fair point, it probably should.