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

#1 2010-10-19 22:34:12

rolfwolf
Scratcher
Registered: 2009-02-19
Posts: 18

Scripting Help

I need help with this agility game I'm making.. http://scratch.mit.edu/projects/rolfwolf/1363880

Please help me! Okay, so.. Here's what I want: You know how the dog follows the handler? Well, I want it so if the dog touches the white on the jump, it goes over the jump (walks over it at around 2 steps), even if the hander goes away from the jump. But, I want it if it touches the black, then it won't go over the jump, and the dog will just stop. Also, it doesn't HAVE to be like this but I would like it if the dog went over the jump at the same angle it was going when it touched the white. Oh, and after the dog jumps over the jump, I want it to come back to the handler and be back to normal (like it is now). I will give you HUGE credit if you help me! I might be able to make the black stuff. (I mean when it touches the black, it stops.) Please help if you can.  smile  It will be GREATLY appreciated. Thanks in advance.  smile

Sorry I'm asking so much... DX

To help:
1st: Download the game
2nd: Make the scripts that fufil my needy needs. XD (Sorry.)
3rd: Share it.
4th: Give me a link!  smile
OR you can just tell me the scripts.


big_smile




Done so far:
The dog stops when it touches the black (Cherrypaw101) [Though I didn't want the whole project to stop, I think I can fix it.]
The dog goes to it's starting point when it touches the black. (benjamin2) [Though I wanted it to just stop for a while and then the dog comes back to the handler, thanks!!]

NOTE: You can still script these things if you think you could make it better. (Ex: Cherrypaw101 made the whole project stop when the dog touches the black, and you think you could make it better. Like only the dog stopping.)


Thanks, guys!  big_smile

Last edited by rolfwolf (2010-10-23 14:40:32)

Offline

 

#2 2010-10-20 00:37:10

Cherrypaw101
Scratcher
Registered: 2010-08-16
Posts: 16

Re: Scripting Help

i did it!


i'm AWESOME  cool  http://scratch.mit.edu/static/icons/buddy/485561_med.png?t=2011-08-17+17%3A05%3A23

Offline

 

#3 2010-10-20 14:37:08

rolfwolf
Scratcher
Registered: 2009-02-19
Posts: 18

Re: Scripting Help

Thanks for making the dog stop when it touches the black, Cherrypaw101! I didn't want the whole project to stop when the dog touches the black, but I'm pretty sure I can fix that!  big_smile ! Thanks so much!

Offline

 

#4 2010-10-20 17:26:55

bruneydog
Scratcher
Registered: 2009-02-04
Posts: 12

Re: Scripting Help

Yeah, it's really hard. 3:

Offline

 

#5 2010-10-20 17:55:19

Tickles
Scratcher
Registered: 2008-11-16
Posts: 49

Re: Scripting Help

To make the dog stop use this

IF[touching color "black"]
forever
move -2 steps     OR if you want the dog to be able to move after it touches black use this:
repeat until [not"touching(black)"]
move -2 steps.


A fun original puzzle game. The only one of its kind on scratch! Click here!

Offline

 

#6 2010-10-20 20:30:48

rolfwolf
Scratcher
Registered: 2009-02-19
Posts: 18

Re: Scripting Help

Thanks, Tickles! I figured that's what I would probably do.  smile

Offline

 

#7 2010-10-22 04:23:56

KatJoy
Scratcher
Registered: 2009-03-16
Posts: 1

Re: Scripting Help

Update on my progress: So far I admit that I have stripped the dog sprite of most the codes that you gave it. They were conflicting with my style of scripting.
I'm putting in some more coding for the dog for basic movement. I've almost tackled the jump and the dog stays close to the owner most of the time with a few glitches.
The dog will continue in the direction that it hit the jump at while the handler can go in a different direction. I've had a few glitches with leaving the jump but I think I know how to solve them.
Sorry if the scratch blocks look weird it's my first time using them in a post.
Common glitches:
1) Dog freezes when it touches the pink after a jump. Solving idea before I forget: [blocks]<when green flag clicked> <forever> <if> << <touching[ jump1  <and> << <color[ brown ]is over[ pink   <or> <( <distance to[  <>> 50 )>  >> >><move( 2 )steps> <else> <move( 1 )steps> [/blocks]

Distance is uncertain and left for fine tuning...
I've haven't tried this script out yet.

*EDIT*
Or I could just remove the conflicting script that is the opposite of what I want...

Last edited by KatJoy (2010-10-22 04:46:00)

Offline

 

#8 2010-10-22 04:32:25

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

Re: Scripting Help

I can't help in full (I can't undrestand what you're saying) , but you know you said you want the dog to stop but not the whole project if it touches the black? Well, do this.

Make a variable called Stopx and Stopy.
Put these two scripts on the dog.

<when green flag clicked>
<set{ Stopx }to( no number actually put in the words no number
<set{ Stopy }to( no number
<wait until><color[ the color of the dog ]is over[ black
<set{ Stopx }to( -the x position of the dog-
<set{ Stopy }to( -the y position of the dog-
<broadcast[ stop dog

<when I receive[ stop dog
<forever>
<go to x sad  <{ stopx }> )y sad  <{ stopy }>

Hope this helps!  smile


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

Offline

 

#9 2010-10-22 17:39:19

rolfwolf
Scratcher
Registered: 2009-02-19
Posts: 18

Re: Scripting Help

KatJoy wrote:

Update on my progress: So far I admit that I have stripped the dog sprite of most the codes that you gave it. They were conflicting with my style of scripting.
I'm putting in some more coding for the dog for basic movement. I've almost tackled the jump and the dog stays close to the owner most of the time with a few glitches.
The dog will continue in the direction that it hit the jump at while the handler can go in a different direction. I've had a few glitches with leaving the jump but I think I know how to solve them.
Sorry if the scratch blocks look weird it's my first time using them in a post.
Common glitches:
1) Dog freezes when it touches the pink after a jump. Solving idea before I forget: [blocks]<when green flag clicked> <forever> <if> << <touching[ jump1  <and> << <color[ brown ]is over[ pink   <or> <( <distance to[  <>> 50 )>  >> >><move( 2 )steps> <else> <move( 1 )steps> [/blocks]

Distance is uncertain and left for fine tuning...
I've haven't tried this script out yet.

*EDIT*
Or I could just remove the conflicting script that is the opposite of what I want...

Thanks KatJoy! You're the best! You're super smart at scripting. XD

Offline

 

#10 2010-10-22 17:40:49

rolfwolf
Scratcher
Registered: 2009-02-19
Posts: 18

Re: Scripting Help

benjamin2 wrote:

I can't help in full (I can't undrestand what you're saying) , but you know you said you want the dog to stop but not the whole project if it touches the black? Well, do this.

Make a variable called Stopx and Stopy.
Put these two scripts on the dog.

<when green flag clicked>
<set{ Stopx }to( no number actually put in the words no number
<set{ Stopy }to( no number
<wait until><color[ the color of the dog ]is over[ black
<set{ Stopx }to( -the x position of the dog-
<set{ Stopy }to( -the y position of the dog-
<broadcast[ stop dog

<when I receive[ stop dog
<forever>
<go to x sad  <{ stopx }> )y sad  <{ stopy }>

Hope this helps!  smile

Thank you!! I'll try it! Sorry you didn't understand, I'm not good at explaining stuff. DX

Offline

 

#11 2010-10-22 18:55:19

coolstuff
Community Moderator
Registered: 2008-03-06
Posts: 1000+

Re: Scripting Help

This looks like it belongs a bit in the "All About Scratch" forum, towards which I will move it  smile

Offline

 

#12 2010-10-23 14:27:36

rolfwolf
Scratcher
Registered: 2009-02-19
Posts: 18

Re: Scripting Help

Okay, thanks.  smile

Offline

 

#13 2010-10-23 14:51:41

rolfwolf
Scratcher
Registered: 2009-02-19
Posts: 18

Re: Scripting Help

Tickles wrote:

To make the dog stop use this

IF[touching color "black"]
forever
move -2 steps     OR if you want the dog to be able to move after it touches black use this:
repeat until [not"touching(black)"]
move -2 steps.

Thanks, Tickles. But unfortanaly, here's MY scripts: The handler moves 2 steps when you press the up arrow. The DOG just forever goes TO the handler. I'm thinking of ways to tweak your scripts to make them work.  smile

(Sorry, I can't spell unfortanaly.. DX )

Offline

 

#14 2010-10-26 20:48:55

rolfwolf
Scratcher
Registered: 2009-02-19
Posts: 18

Re: Scripting Help

Bump.

Offline

 

#15 2010-10-30 22:47:55

rolfwolf
Scratcher
Registered: 2009-02-19
Posts: 18

Re: Scripting Help

Bump? :3?

Offline

 

#16 2010-11-03 14:03:50

rolfwolf
Scratcher
Registered: 2009-02-19
Posts: 18

Re: Scripting Help

Bump. 3:

Offline

 

#17 2010-11-03 17:50:25

rolfwolf
Scratcher
Registered: 2009-02-19
Posts: 18

Re: Scripting Help

Bump.

Offline

 

#18 2010-11-17 21:26:46

rolfwolf
Scratcher
Registered: 2009-02-19
Posts: 18

Re: Scripting Help

Bump.. -.-

Offline

 

#19 2010-11-29 19:59:17

rolfwolf
Scratcher
Registered: 2009-02-19
Posts: 18

Re: Scripting Help

Teh Scratch forum is dead... :c

Offline

 

#20 2010-12-05 11:36:14

rolfwolf
Scratcher
Registered: 2009-02-19
Posts: 18

Re: Scripting Help

This is hopeless...

Offline

 

#21 2010-12-06 19:13:05

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

Re: Scripting Help

I might be able to help if you give me a link to the project. big_smile

Offline

 

#22 2010-12-07 22:57:01

rolfwolf
Scratcher
Registered: 2009-02-19
Posts: 18

Re: Scripting Help

I put it up there already, but here: http://scratch.mit.edu/projects/rolfwolf/1363880

Offline

 

#23 2010-12-17 17:03:14

rolfwolf
Scratcher
Registered: 2009-02-19
Posts: 18

Re: Scripting Help

......................... I need this soon! D:

Offline

 

#24 2010-12-21 13:37:38

rolfwolf
Scratcher
Registered: 2009-02-19
Posts: 18

Re: Scripting Help

Anyone? D: I might be able to do it.... *Sigh*.. Lemme try it again..

Offline

 

#25 2011-01-27 19:12:03

bruneydog
Scratcher
Registered: 2009-02-04
Posts: 12

Re: Scripting Help

Nobody replies. :S

Offline

 

Board footer