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

#1 2010-10-27 13:49:28

webgal15
Scratcher
Registered: 2009-06-17
Posts: 1000+

Scripts not working!

I am making a game called Stranded. It has 9 sprites and 68 scripts (with 49 of them only having 2 or 3 blocks in them). All the sprites only have one costume, but the stage has four backgrounds. All the sprites have names (not "Sprite1", "Sprite2", etc.) It has 5 regular variables, and 2 specific to the sprite "Tree". If one of "Hunger", "Thirst", or "Injury" gets to 10, or if "Health" gets to 0, the background is supposed to change to a black screen with "You died o3o" written in white in the font "Helvetica Bold" in the size 24.

See that part I bolded? That's not working. This is the script I used for it:

<when green flag clicked>
<if><( <{ Health }> <=> 0 )>
<switch to costume[ background4 (Except it's switch to BACKGROUND, since it's stage.)
(hide variable Health)
(hide variable Hunger)
(hide variable Injury)
(hide variable Thirst)
<end>
(then repeat for Hunger, Injury, and Thirst (it's all on the same script, just different "if" blocks.) )

Did I do anything wrong? If so, how do I fix it?

(Also, if you don't understand, I'd be happy to edit this post.)


Now only using this account to post in Miscellaneous, but when Miss_Webgal becomes a Scratcher I'm ditching this account.

Offline

 

#2 2010-10-27 15:34:37

12three
Scratcher
Registered: 2008-06-12
Posts: 1000+

Re: Scripts not working!

You could have accidentally said for the tree to show itself forever. When scripts conflict, the first one usually takes presidence.

Offline

 

#3 2010-10-27 15:52:04

webgal15
Scratcher
Registered: 2009-06-17
Posts: 1000+

Re: Scripts not working!

12three wrote:

You could have accidentally said for the tree to show itself forever. When scripts conflict, the first one usually takes presidence.

I tried making all the sprites hide when you die just now, and it still doesn't work.

And the tree is a sprite, I don't see how it would effect the background changing . . .

I'm going to upload the project as it is. I'm bad at wording things, so if it was available to download and look at the sprites it would be easier, I think.

EDIT: Here it is.

Last edited by webgal15 (2010-10-27 16:06:36)


Now only using this account to post in Miscellaneous, but when Miss_Webgal becomes a Scratcher I'm ditching this account.

Offline

 

#4 2010-10-29 08:22:09

webgal15
Scratcher
Registered: 2009-06-17
Posts: 1000+

Re: Scripts not working!

Bump . . .


Now only using this account to post in Miscellaneous, but when Miss_Webgal becomes a Scratcher I'm ditching this account.

Offline

 

#5 2010-10-29 12:08:09

benjamin2
Scratcher
Registered: 2008-10-18
Posts: 1000+

Re: Scripts not working!

You said you did the same for each. Don't the others need to be 10 and not 0?  hmm


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

Offline

 

#6 2010-10-29 17:21:56

webgal15
Scratcher
Registered: 2009-06-17
Posts: 1000+

Re: Scripts not working!

benjamin2 wrote:

You said you did the same for each. Don't the others need to be 10 and not 0?  hmm

By "the same for each", I meant the same blocks, but I DID use 10 for the others.


Now only using this account to post in Miscellaneous, but when Miss_Webgal becomes a Scratcher I'm ditching this account.

Offline

 

#7 2010-10-29 20:07:19

majormax
Scratcher
Registered: 2008-04-06
Posts: 1000+

Re: Scripts not working!

[blocks]<when green flag clicked>
<forever if><( <{ Health }> <=> 0 )>
<switch to costume[ background4 (Except it's switch to BACKGROUND, since it's stage.)
(hide variable Health)
(hide variable Hunger)
(hide variable Injury)
(hide variable Thirst)
<end>[/blocks]
Try that.

Offline

 

#8 2010-10-29 20:46:33

webgal15
Scratcher
Registered: 2009-06-17
Posts: 1000+

Re: Scripts not working!

majormax wrote:

[blocks]<when green flag clicked>
<forever if><( <{ Health }> <=> 0 )>
<switch to costume[ background4 (Except it's switch to BACKGROUND, since it's stage.)
(hide variable Health)
(hide variable Hunger)
(hide variable Injury)
(hide variable Thirst)
<end>[/blocks]
Try that.

Tried, didn't work,


Now only using this account to post in Miscellaneous, but when Miss_Webgal becomes a Scratcher I'm ditching this account.

Offline

 

Board footer