[GLITCH] With Add/Edit/Delete of a global variable

Started by Ryan Timothy B, Tue 31/08/2010 20:47:28

Previous topic - Next topic

Ryan Timothy B

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.

monkey0506

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).

Ryan Timothy B

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.

monkey0506


Pumaman

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.

SMF spam blocked by CleanTalk