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

#1 2008-05-21 03:48:12

lestrade3333
Scratcher
Registered: 2008-05-21
Posts: 18

One time message - actions

The problem is thus:

I have a background sprite which, when touch by the player's one, broadcasts a message. when the message is received, a sprite (a dialogue box for storyline) appears. The problem is, there are indefinite times which the player sprite may touch the background sprite, depending on the player's own decision and control. However, I only want the storyline box to appear on the first time the message is received. Is there a way to do this?

If not, the dialogue box appears all over again, which disrupts the storyline and annoys the player.

Thanks very much. I am really stuck at the moment. Any advise is appreciated

Offline

 

#2 2008-05-21 08:17:50

dbal
Scratcher
Registered: 2007-07-19
Posts: 100+

Re: One time message - actions

lestrade3333 wrote:

The problem is thus:

I have a background sprite which, when touch by the player's one, broadcasts a message. when the message is received, a sprite (a dialogue box for storyline) appears. The problem is, there are indefinite times which the player sprite may touch the background sprite, depending on the player's own decision and control. However, I only want the storyline box to appear on the first time the message is received. Is there a way to do this?

If not, the dialogue box appears all over again, which disrupts the storyline and annoys the player.

Thanks very much. I am really stuck at the moment. Any advise is appreciated

Have you tried hiding (purple Looks toolbox) right before it goes away the first time it appears?  This should keep it from being visible later even if it does appear.

Dick Baldwin
Free Alice tutorials:  http://www.dickbaldwin.com/tocalice.htm
Free Scratch tutorials:  http://www.dickbaldwin.com/tocHomeSchool.htm
Free Java/C#, etc. tutorials:  http://www.dickbaldwin.com/toc.htm


Dick Baldwin - Don't get stuck scratching. When you master Scratch, move on up to more serious programming languages. Free online programming tutorials:
Scratch - Alice - Java - C# - C++ - JavaScript - XML - Python - DSP

Offline

 

#3 2008-05-21 09:23:19

JSO
Community Moderator
Registered: 2007-06-23
Posts: 1000+

Re: One time message - actions

You might be able to fix it this way:

Instead of using a broadcast, you could use a varibiable.
Where the broadcast is sent, replace the broadcast block with "set storyline to 1". If you need another storyline-message, place "set storyline to 2"

Now use this script in the dialog box:

Code:

When green flag clicked
set storyline to 0
hide
wait until storyline = 1
show
switch to costume message1
wait until key space pressed
    ==>you can replace this by any "pausing" block:
       wait, wait until
hide
wait until storyline = 2
show
switch to costume message2
wait until key space pressed
    ==> same here, of course
hide

You can implement as much storyline dialog boxes as you want aith this method, just create a costume for each box.

Does this helped?

Joren

Last edited by JSO (2008-05-21 09:24:57)


http://oi48.tinypic.com/2v1q0e9.jpg

Offline

 

#4 2008-06-22 07:56:15

registeel
Scratcher
Registered: 2008-04-27
Posts: 500+

Re: One time message - actions

lestrade3333 wrote:

The problem is thus:

I have a background sprite which, when touch by the player's one, broadcasts a message. when the message is received, a sprite (a dialogue box for storyline) appears. The problem is, there are indefinite times which the player sprite may touch the background sprite, depending on the player's own decision and control. However, I only want the storyline box to appear on the first time the message is received. Is there a way to do this?

If not, the dialogue box appears all over again, which disrupts the storyline and annoys the player.

Thanks very much. I am really stuck at the moment. Any advise is appreciated

Try using "stop script"

Offline

 

Board footer