This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2011-07-28 20:32:27

reillydow
New Scratcher
Registered: 2011-07-12
Posts: 10

Storing answers to display later as story

Hi!
I'm making a game where the player chooses a character (sprite) from 26 options then writes a story about him/her. The "story" is structured as three questions from the chosen sprite and three answers from the player.
How can I store these answers then display that text at the end of the game?
Thanks in advance!

Offline

 

#2 2011-07-28 20:35:08

jji7skyline
Scratcher
Registered: 2010-03-08
Posts: 1000+

Re: Storing answers to display later as story

You could add the answers to a list... and then make a sprite say the contents of the list.


I don't know why you say goodbye, I say hello!  big_smile

Offline

 

#3 2011-07-28 20:38:29

Harakou
Community Moderator
Registered: 2009-10-11
Posts: 1000+

Re: Storing answers to display later as story

I would suggest storing each answer as an item in a list. That way you can go back later and use each sentence individually, or all as one. If you want to display all the answers at once, you can just use the say( ) block with the list reporter as an argument, and it will put all the items together automatically.

http://i.imgur.com/ZfeEe.gif


http://www.blocks.scratchr.org/API.php?action=random&return=image&link1=http://i.imgur.com/OZn2RD3.png&link2=http://i.imgur.com/duzaGTB.png&link3=http://i.imgur.com/CrDGvvZ.png&link4=http://i.imgur.com/POEpQyZ.png&link5=http://i.imgur.com/ZKJF8ac.png

Offline

 

#4 2011-07-28 21:28:15

reillydow
New Scratcher
Registered: 2011-07-12
Posts: 10

Re: Storing answers to display later as story

Also, how can I get the 'answer' block to show only after the sprite asks the three questions...

Offline

 

#5 2011-07-28 21:38:14

Harakou
Community Moderator
Registered: 2009-10-11
Posts: 1000+

Re: Storing answers to display later as story

reillydow wrote:

Also, how can I get the 'answer' block to show only after the sprite asks the three questions...

Huh? What are you trying to show, the answer prompt box, or something else?


http://www.blocks.scratchr.org/API.php?action=random&return=image&link1=http://i.imgur.com/OZn2RD3.png&link2=http://i.imgur.com/duzaGTB.png&link3=http://i.imgur.com/CrDGvvZ.png&link4=http://i.imgur.com/POEpQyZ.png&link5=http://i.imgur.com/ZKJF8ac.png

Offline

 

#6 2011-07-29 12:36:34

DigiTechs
Scratcher
Registered: 2011-04-30
Posts: 500+

Re: Storing answers to display later as story

No, Harakou, he/she means the VEIWER on the stage. Yeah, Scratch 2.0 needs that block.


I'm back.
Maybe.

Offline

 

#7 2011-07-29 14:53:24

danwoodski
Scratcher
Registered: 2009-12-23
Posts: 100+

Re: Storing answers to display later as story

you could just have it set a variable to the answer, then show and hide that...


http://www.blocks.scratchr.org/API.php?action=random&return=image&link1=http://dl.dropbox.com/u/12506914/Pics/p2e-2.png&link2=http://dl.dropbox.com/u/12506914/Pics/ms.png&link3=http://dl.dropbox.com/u/12506914/Pics/block%20lib.png
Starting to move on to other languages, but I'll still be around from time to time  smile

Offline

 

#8 2011-07-29 16:40:16

pika100chu
Scratcher
Registered: 2009-07-26
Posts: 500+

Re: Storing answers to display later as story

danwoodski wrote:

you could just have it set a variable to the answer, then show and hide that...

Basically this. There is a trickier approach that requires taking part of the background positioning it perfectly on the background, putting the answer viewer on top of it, and telling it to go to front when you click the green flag. Then, when you want to show the viewer, you just tell the sprite to hide. I did something like this once with a slightly transparent sprite and a variable once.

Offline

 

Board footer