Is it possible to have your scratch project pull data from an external text file to be used in the game/scripts?
For example:
in a quiz type game, the script pulls a random question from 100 questions in a text file and displays it and possible answers
This way, if you change the text file it changes what questions will be displayed.
Or is this too advanced for scratch?
Offline
Well, what you can do is copy+paste each entry into a new space in a Scratch List, and then have it pick one at random that way.
Offline
Scratcher456 wrote:
Well, what you can do is copy+paste each entry into a new space in a Scratch List, and then have it pick one at random that way.
When you upload, it doesn't retain them. I think.
Offline
WARNING: I've been on scratch for a bit but I have not been on the forums so if I mess something up and look stupid, I'm sorry!
Ok, so, it isn't possible to do exactly what your wanting to do with scratch. It's not possible to do 100 different questions, but it is possible to do about 10 (without spending hours and hours). basically by using the broadcast like this, (I hope I'm doing this right)!
when gf clicked broadcast (pick random (1) to (10))Just have different sprites ready to reaceive numbers 1 through 10 and do different things for each one! 100 questions would take a REALLY long time but it isn't impossible!
Offline
tree-hugger wrote:
WARNING: I've been on scratch for a bit but I have not been on the forums so if I mess something up and look stupid, I'm sorry!
Ok, so, it isn't possible to do exactly what your wanting to do with scratch. It's not possible to do 100 different questions, but it is possible to do about 10 (without spending hours and hours). basically by using the broadcast like this, (I hope I'm doing this right)!when gf clicked broadcast (pick random (1) to (10))Just have different sprites ready to reaceive numbers 1 through 10 and do different things for each one! 100 questions would take a REALLY long time but it isn't impossible!
Actually, it's easy if you use the lists feature.
Offline
jontmy00 wrote:
Scratcher456 wrote:
Well, what you can do is copy+paste each entry into a new space in a Scratch List, and then have it pick one at random that way.
When you upload, it doesn't retain them. I think.
It will retain the lists and their contents, but if you edit the text file it won't change the lists, if that's what you mean. It won't change the lists even when it's on the original machine. A feature like that would be too easy to exploit for bad stuff.
Offline