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

#1 2009-12-01 20:40:38

V4LOVER
Scratcher
Registered: 2009-07-25
Posts: 19

Any way to clear the answer block?

I'm trying to make a Pokemon battle using my own sprites.

It first asks the player what attack they want to use.

It stores it in answer (obviously), and it stores "answer" in "attack".

By the time it's the player's turn again (after the computer goes), since answer is the same, regardless of the fact that I set "attack" to "null", it goes on and sets attack to the same thing as you first entered.

Is there any way to clear the "answer" sensing block?


[align=center]olhttp://imgboot.com/images/aragornbird/618.gif
The flattest wall you'll ever see in Pokemon.

Offline

 

#2 2009-12-01 23:07:29

BoltBait
Scratcher
Registered: 2009-03-09
Posts: 1000+

Re: Any way to clear the answer block?

Say nothing will clear the answer block.


Animated sigs must be banned!
http://boltbait.com/j.pnghttp://boltbait.com/s.pnghttp://boltbait.com/d.pnghttp://boltbait.com/a.pnghttp://boltbait.com/p.png

Offline

 

#3 2009-12-02 03:45:12

Chrischb
Scratcher
Registered: 2008-07-24
Posts: 1000+

Re: Any way to clear the answer block?

V4LOVER, this is not a bug with Scratch or the Website. If you want help with programming, try the All about Scratch forum instead.


I fall: It's a tragedy. You fall: It's comedy.
Hmph enjoy your fall - I get a lovely spring... without pans of new leaves.

Offline

 

#4 2009-12-02 06:33:39

V4LOVER
Scratcher
Registered: 2009-07-25
Posts: 19

Re: Any way to clear the answer block?

Thank you both!


[align=center]olhttp://imgboot.com/images/aragornbird/618.gif
The flattest wall you'll ever see in Pokemon.

Offline

 

#5 2010-01-31 11:23:27

Fyxen
Scratcher
Registered: 2009-06-24
Posts: 12

Re: Any way to clear the answer block?

I bet you just need to move where you are using Answer.  Since I can't see your code, I'm not positive, but I expect that you are setting Attack to Answer somewhere close to where you are using Attack (and inside a loop), instead of close to where you are Asking for the Answer.

Generally for this sort of thing, where you probably have multiple questions to Ask, it is best to Ask and then immediately use Answer once to store the answer in another variable, then never use Answer again until you Ask another question.  This is specially true if you have multiple sprites asking questions independently.

regards, Fyxen

Offline

 

#6 2010-01-31 11:46:13

iamrpk
Scratcher
Registered: 2009-04-06
Posts: 1000+

Re: Any way to clear the answer block?

Do this when it asks what attack you want:
[blocks]
<when green flag clicked>
<set{ attack }to( nothing
[/blocks]

Then you can ask the question and do the rest of it.


http://www.punbb-hosting.com/forums/AwesomeBooks911Forum/index.php

Offline

 

Board footer