Thanks anyway, Darwin. I think I have an idea how to do it, but I've not tried it yet. Basically, I was thinking that any variable that I need will either be -
A) linked to a specific command, e.g. the script's "place hero" command will always use the variables hero_x and hero_y.
or
B) the variable will be set within another script, e.g. a variable that says whether or not the hero has completed a certain task.
In this case, it should be possible to create an array from the variables defined within the scripts and retrieve my data from that. As I said, haven't tried it yet so cross your fingers for me.
It's a long story and there's no punchline...