I had created "print_scientific" as a one-sprite project to be imported into other programs.
Today, my son and I tried importing it into another program that did a computation we wanted, and nothing worked.
We also tried importing his program into "print_scientific". Again, the code looked fine, but variables that were set to 0 were reported as being 1 and other awful stuff. Very hard to debug.
We started over with print_scientific, and re-created his script by retyping and dragging everything (no imports), and everything worked fine.
Both scripts had global variables (no overlap in names), and print_scientific also has local variables.
I suspect a major bug in the "import project" code in v1.2.1
I tried exporting the digit sprite from print_scientific and just importing the sprite rather than the full project, and that failed in a similar way.
Importing is definitely buggy!
Offline
I experienced a similar problem with global variables a while back. I mentioned it to Jens and he said he had seen something similar but was able to get it working by saving and reopening the project; that seemed to sort out the problem with the variables. Something to try anyway. Maybe Jens can comment further on his experiences in this area.
Offline
Well, I haven't really tried importing much into v1.2.1, but before I used to run into problems if an imported sprite accessed a global variable (with or without overlapping names). After importing the sprite seemed not to know the new global variable, but was able to do so again after I saved to project do disk. But this has been a while ago, and I don't have any current observations...
Offline
This is quite the same problem: importing sprites is buggy to. For example - try one of the MIDI sound sprites from scratchresources.tk - the scratch cat will keep viewed until you click the green flag. After that the cat dissapears and the MIDI sprite shows up. (Note: this is opening a sprite, but i guess it is the same as importing it into an empty project.)
Offline
Some time ago we had a similar problem with Scratch 1.4: We tried to develop a program in a team: Each member put together a sprite with all of its scripts, then we tried to "integrate" all of the "units" in one program.
The problem was, that none of the sprites "knew" it's variables after the import, not even global variables were recognized.
Is this a bug or is it a feature? ;-)
Cheers
Hanspeter
Offline