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

#1 2012-02-17 14:24:32

mitchboy
Scratcher
Registered: 2011-11-29
Posts: 59

"Hide" block doesn't work

I've used a simple script like this:

when gf clicked
forever if <([costume# v] of [Sprite1 v])=(4)>
hide
For some reason, the sprite doesn't go away. I have to use the set ghost effect to 100 block instead.


Quote of the week: "I am NOT being DRAMATIC!" ~Looney Tunes
Check out my newest game here!

Offline

 

#2 2012-02-17 14:30:24

ProgramCAT
Scratcher
Registered: 2011-12-13
Posts: 500+

Re: "Hide" block doesn't work

Try NOT using the 'forever if' block.
It can be confusing.


Programming is an art...
Goodbye, Scratch. I am leaving because of the exams coming up at our school, though I'll check the forums once or twice a week.

Offline

 

#3 2012-02-17 14:48:52

mitchboy
Scratcher
Registered: 2011-11-29
Posts: 59

Re: "Hide" block doesn't work

ProgramCAT wrote:

Try NOT using the 'forever if' block.
It can be confusing.

I also tried using an if else block inside a forever block and it didn't work. I also tried your script you gave me for the Pac-man dots and it didn't work.


Quote of the week: "I am NOT being DRAMATIC!" ~Looney Tunes
Check out my newest game here!

Offline

 

#4 2012-02-17 15:04:16

ProgramCAT
Scratcher
Registered: 2011-12-13
Posts: 500+

Re: "Hide" block doesn't work

It worked when I tried it...

when gf clicked
forever
if < ([costume # v] of [Sprite 1 v]) = (4)  >
hide
else
show
end
It's been TESTED and it DOES work.

Notice that it looks at the 4th costume of Sprite 1, not the costume labelled '4'.

Last edited by ProgramCAT (2012-02-17 15:35:49)


Programming is an art...
Goodbye, Scratch. I am leaving because of the exams coming up at our school, though I'll check the forums once or twice a week.

Offline

 

#5 2012-02-17 15:25:12

CheeseMunchy
Scratcher
Registered: 2008-10-13
Posts: 1000+

Re: "Hide" block doesn't work

Please acknowledge that the block you're using says "costume #" not "costume", so it might not be "Costume 4" that the block is sensing for because all it's sensing for is the 4th costume in the row of costumes. :>

Last edited by CheeseMunchy (2012-02-17 15:26:00)


6418,

Offline

 

#6 2012-02-17 18:34:17

mitchboy
Scratcher
Registered: 2011-11-29
Posts: 59

Re: "Hide" block doesn't work

ProgramCAT wrote:

It worked when I tried it...

when gf clicked
forever
if < ([costume # v] of [Sprite 1 v]) = (4)  >
hide
else
show
end
It's been TESTED and it DOES work.

Notice that it looks at the 4th costume of Sprite 1, not the costume labelled '4'.

Yes, I'm looking for when Sprite1's costume number is the 4th costume. Can you also test this?:

when gf clicked
forever
if <touching [Sprite1]?>
hide
else
show
wait (1) secs
hide
wait (1) secs
end
Why does it work for you but not me?


Quote of the week: "I am NOT being DRAMATIC!" ~Looney Tunes
Check out my newest game here!

Offline

 

#7 2012-02-17 18:39:31

RedRocker227
Scratcher
Registered: 2011-10-26
Posts: 1000+

Re: "Hide" block doesn't work

Have you edited the source code or any of that stuff? I dunno XD


Why

Offline

 

#8 2012-02-17 18:44:54

mitchboy
Scratcher
Registered: 2011-11-29
Posts: 59

Re: "Hide" block doesn't work

RedRocker227 wrote:

Have you edited the source code or any of that stuff? I dunno XD

Well, something weird happened after I tried to open the source code. The scripts pane turned completely white and you couldn't do anything, so I exited out. I'm not sure if I saved it or not.


Quote of the week: "I am NOT being DRAMATIC!" ~Looney Tunes
Check out my newest game here!

Offline

 

#9 2012-02-17 18:52:12

Greenatic
Scratcher
Registered: 2009-05-03
Posts: 1000+

Re: "Hide" block doesn't work

1.  Have you stamped it?  Use this to see:

clear
2.  If you've done some modding, you should probably re-install Scratch.

Last edited by Greenatic (2012-02-17 18:52:25)

Offline

 

#10 2012-02-18 13:09:28

Mokat
Scratcher
Registered: 2011-12-08
Posts: 1000+

Re: "Hide" block doesn't work

If the "set ghost effect to 100" block works, use it instead. Problem solved.


http://www.eggcave.com/egg/977371.pnghttp://www.eggcave.com/egg/977376.pnghttp://www.eggcave.com/egg/1005291.pnghttp://www.eggcave.com/egg/996745.png

Offline

 

#11 2012-02-19 12:29:13

mitchboy
Scratcher
Registered: 2011-11-29
Posts: 59

Re: "Hide" block doesn't work

Greenatic wrote:

1.  Have you stamped it?  Use this to see:

clear
2.  If you've done some modding, you should probably re-install Scratch.

The sprite moves, so it's not stamping. I don't think I edited anything, I just went to the block library.
@Mokat: I might just do that.


Quote of the week: "I am NOT being DRAMATIC!" ~Looney Tunes
Check out my newest game here!

Offline

 

Board footer