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

#376 2013-01-28 18:35:34

ErnieParke
Scratcher
Registered: 2010-12-03
Posts: 1000+

Re: Scripts Workshop: Give and get help with scripts

Auto007 wrote:

ErnieParke wrote:

Auto007 wrote:

How can i make a Sprite go elliptical orbit ?

Well, there are two ways. Do you want the more complicated (math wise), more easily edited version or the simpler, harder to edit version?

Gosh !! You always confuse me . Here and in idea shop also !
Can't you tell me both methods ?

Well one method is this (from when I helped mithbusteranimator):

Note: Your code is halfway down.

ErnieParke wrote:

4). The last of the four methods is here. Basically it utilizes velocity to create the button's movement. It's also easily let's your buttons move in an ellipse as opposed to the circles of the above scripts, unless you add a few modifications, which you can ask me about. So, what you'll need is a variable called x velocity and y velocity. Then, you'll need to use this:

set [x velocity v] to (5)
set [y velocity v] to (0)
repeat (6)
 change x by (x velocity)
 change y by (y velocity)
 change [x velocity v] by (-1)
 change [y velocity v] by (1)
end

Or, if you want an elipse, you could try something more similar to this:

set [x velocity v] to (5)
set [y velocity v] to (0)
repeat (6)
 change x by (x velocity)
 change y by (y velocity)
 change [x velocity v] by (-1)
 change [y velocity v] by (2)//Key change.
end

Note: Remember, these all aren't going to be exactly 100% of what you wanted, so some tweaking will be needed.


As for the other method, I'll get it to you soon.  wink


http://i46.tinypic.com/35ismmc.png

Offline

 

#377 2013-01-30 21:04:45

ErnieParke
Scratcher
Registered: 2010-12-03
Posts: 1000+

Re: Scripts Workshop: Give and get help with scripts

ErnieParke wrote:

Auto007 wrote:

ErnieParke wrote:


Well, there are two ways. Do you want the more complicated (math wise), more easily edited version or the simpler, harder to edit version?

Gosh !! You always confuse me . Here and in idea shop also !
Can't you tell me both methods ?

Well one method is this (from when I helped mithbusteranimator):

Note: Your code is halfway down.

ErnieParke wrote:

4). The last of the four methods is here. Basically it utilizes velocity to create the button's movement. It's also easily let's your buttons move in an ellipse as opposed to the circles of the above scripts, unless you add a few modifications, which you can ask me about. So, what you'll need is a variable called x velocity and y velocity. Then, you'll need to use this:

set [x velocity v] to (5)
set [y velocity v] to (0)
repeat (6)
 change x by (x velocity)
 change y by (y velocity)
 change [x velocity v] by (-1)
 change [y velocity v] by (1)
end

Or, if you want an elipse, you could try something more similar to this:

set [x velocity v] to (5)
set [y velocity v] to (0)
repeat (6)
 change x by (x velocity)
 change y by (y velocity)
 change [x velocity v] by (-1)
 change [y velocity v] by (2)//Key change.
end

Note: Remember, these all aren't going to be exactly 100% of what you wanted, so some tweaking will be needed.


As for the other method, I'll get it to you soon.  wink

I just realized a really effective, simple, and flexible way for a sprite to go in an elipse. So first, you'll need a variable called "T". Then, use this script:

when gf clicked
set [T v] to (0)
forever
 go to ((([sin v] of (T)) * (1)) + [Offset])//1 is length of ellipse left and right.
 go to ((([cos v] of (T)) * (1)) + [Offset])//1 is length of ellipse up and down.
 change [T v] by (1)//Speed of sprite.

I hope that this helps!


http://i46.tinypic.com/35ismmc.png

Offline

 

#378 2013-02-01 01:14:14

JH1010
Scratcher
Registered: 2012-05-31
Posts: 1000+

Re: Scripts Workshop: Give and get help with scripts

bump

Offline

 

#379 2013-02-02 11:55:29

Pharosz
New Scratcher
Registered: 2013-02-02
Posts: 6

Re: Scripts Workshop: Give and get help with scripts

HI!
I have a problem with jumping. I copied the script from wiki "Physically accurate jumping".
It is jumping only once and when touching the color I added it stops and cant jump any more. Can you help what is the problem?

Thanks!

Offline

 

#380 2013-02-02 13:38:36

ErnieParke
Scratcher
Registered: 2010-12-03
Posts: 1000+

Re: Scripts Workshop: Give and get help with scripts

Pharosz wrote:

HI!
I have a problem with jumping. I copied the script from wiki "Physically accurate jumping".
It is jumping only once and when touching the color I added it stops and cant jump any more. Can you help what is the problem?

Thanks!

Well, I think something might have gone wrong when you were copying the script, seeing as it shouldn't be doing this in normal situations. So could you show your script?


http://i46.tinypic.com/35ismmc.png

Offline

 

#381 2013-02-02 13:47:22

Pharosz
New Scratcher
Registered: 2013-02-02
Posts: 6

Re: Scripts Workshop: Give and get help with scripts

I dont understand how to put here the script..I just started this.
Its exectly like in the wiki page...

Offline

 

#382 2013-02-02 14:09:31

Pharosz
New Scratcher
Registered: 2013-02-02
Posts: 6

Re: Scripts Workshop: Give and get help with scripts

ErnieParke wrote:

Pharosz wrote:

HI!
I have a problem with jumping. I copied the script from wiki "Physically accurate jumping".
It is jumping only once and when touching the color I added it stops and cant jump any more. Can you help what is the problem?

Thanks!

Well, I think something might have gone wrong when you were copying the script, seeing as it shouldn't be doing this in normal situations. So could you show your script?

Can I send a printscreen tou you by mail?

Offline

 

#383 2013-02-02 19:08:54

Blazingwave
Scratcher
Registered: 2012-10-27
Posts: 500+

Re: Scripts Workshop: Give and get help with scripts

Pharosz wrote:

HI!
I have a problem with jumping. I copied the script from wiki "Physically accurate jumping".
It is jumping only once and when touching the color I added it stops and cant jump any more. Can you help what is the problem?

Thanks!

Maybe it was an old article from the wiki and doesn't work anymore?
Screenshots are encouraged!
Upload your screenshot to tinypic and post the link here.

Last edited by Blazingwave (2013-02-02 19:10:30)


http://i42.tinypic.com/t8nrlh.gif  http://blocks.scratchr.org/API.php?user=Blazingwave&action=onlineStatus&online=http://i49.tinypic.com/25flloj.gif=http://i45.tinypic.com/o8i97l.gif
http://i41.tinypic.com/s1lyyo.jpg

Offline

 

#384 2013-02-03 04:23:46

Pharosz
New Scratcher
Registered: 2013-02-02
Posts: 6

Re: Scripts Workshop: Give and get help with scripts

Blazingwave wrote:

Pharosz wrote:

HI!
I have a problem with jumping. I copied the script from wiki "Physically accurate jumping".
It is jumping only once and when touching the color I added it stops and cant jump any more. Can you help what is the problem?

Thanks!

Maybe it was an old article from the wiki and doesn't work anymore?
Screenshots are encouraged!
Upload your screenshot to tinypic and post the link here.

The link: http://i48.tinypic.com/2uszn81.jpg

The character is jumping only once when its not in the gray line, after its stops in the gray line, it cant jump any more...  sad

Offline

 

#385 2013-02-03 08:12:25

GlennWright
Scratcher
Registered: 2012-08-15
Posts: 100+

Re: Scripts Workshop: Give and get help with scripts

Auto007 wrote:

GlennWright wrote:

Maybe use cloud variables and date blocks in the upcoming Scratch 2.0? I've tested the features- they are a lot easier and more convenient for this script.

Thanks i was hoping for this.
Well, In 2.0 is there any command like -

repeat until [I recieve "bradcast"]
end

[or]

if [I recieve "bradcast"]
end

Sorry about the late reply, but heres what Lightnin had to say to me about broadcasting.
Thanks, Glen!  This has been a popular suggestion for a while now. The issue with repeat until “Broadcast” is that a broadcast is an instantaneous thing - and you can have more than one.  It's not something whose state changes after it happens - like a variable.

We could make a repeat until broadcast check to see if the broadcast has happened since the last start of the repeat loop, but it kind of muddies the concept. So for now, the best way to tackle this is to have the broadcast set a variable, and have the repeat while loop check it before repeating.


Hello everyone!
http://img5.imageshack.us/img5/465/dot.png

Offline

 

#386 2013-02-03 19:48:15

ErnieParke
Scratcher
Registered: 2010-12-03
Posts: 1000+

Re: Scripts Workshop: Give and get help with scripts

Pharosz wrote:

Blazingwave wrote:

Pharosz wrote:

HI!
I have a problem with jumping. I copied the script from wiki "Physically accurate jumping".
It is jumping only once and when touching the color I added it stops and cant jump any more. Can you help what is the problem?

Thanks!

Maybe it was an old article from the wiki and doesn't work anymore?
Screenshots are encouraged!
Upload your screenshot to tinypic and post the link here.

The link: http://i48.tinypic.com/2uszn81.jpg

The character is jumping only once when its not in the gray line, after its stops in the gray line, it cant jump any more...  sad

Well you could've used the forum's built-in scratchblocks creator, which I explain how to use here in this guide.

Anyway, I'll look at your code when I can; I have to go right now.


http://i46.tinypic.com/35ismmc.png

Offline

 

#387 2013-02-03 19:55:12

ErnieParke
Scratcher
Registered: 2010-12-03
Posts: 1000+

Re: Scripts Workshop: Give and get help with scripts

ErnieParke wrote:

Pharosz wrote:

Blazingwave wrote:

Maybe it was an old article from the wiki and doesn't work anymore?
Screenshots are encouraged!
Upload your screenshot to tinypic and post the link here.

The link: http://i48.tinypic.com/2uszn81.jpg

The character is jumping only once when its not in the gray line, after its stops in the gray line, it cant jump any more...  sad

Well you could've used the forum's built-in scratchblocks creator, which I explain how to use here in this guide.

Anyway, I'll look at your code when I can; I have to go right now.

Actually, I've just realized that I do have a bit of time. So, in your script that looks like this:

when gf clicked
forever
 if <(key [up arrow v] pressed?) and <(Y Speed) = (0)>>
  set [Y Speed v] to (9)
  repeat until (touching color [#909090]?)
   change [Y Speed v] by (-0.5)
  end
  set [Y Speed v] to (0)
 end

Could you change to this and tell me if your character says "Hello" on jumps past the first one?

when gf clicked
forever
 if <(key [up arrow v] pressed?) and <(Y Speed) = (0)>>
  set [Y Speed v] to (9)
  say [Hello] for (1) secs
  repeat until (touching color [#909090]?)
   change [Y Speed v] by (-0.5)
  end
  set [Y Speed v] to (0)
 end

If you're wondering, this is just a test to see if what I suspect is true.


http://i46.tinypic.com/35ismmc.png

Offline

 

#388 2013-02-04 14:45:28

Pharosz
New Scratcher
Registered: 2013-02-02
Posts: 6

Re: Scripts Workshop: Give and get help with scripts

ErnieParke wrote:

ErnieParke wrote:

Pharosz wrote:


The link: http://i48.tinypic.com/2uszn81.jpg

The character is jumping only once when its not in the gray line, after its stops in the gray line, it cant jump any more...  sad

Well you could've used the forum's built-in scratchblocks creator, which I explain how to use here in this guide.

Anyway, I'll look at your code when I can; I have to go right now.

Actually, I've just realized that I do have a bit of time. So, in your script that looks like this:

when gf clicked
forever
 if <(key [up arrow v] pressed?) and <(Y Speed) = (0)>>
  set [Y Speed v] to (9)
  repeat until (touching color [#909090]?)
   change [Y Speed v] by (-0.5)
  end
  set [Y Speed v] to (0)
 end

Could you change to this and tell me if your character says "Hello" on jumps past the first one?

when gf clicked
forever
 if <(key [up arrow v] pressed?) and <(Y Speed) = (0)>>
  set [Y Speed v] to (9)
  say [Hello] for (1) secs
  repeat until (touching color [#909090]?)
   change [Y Speed v] by (-0.5)
  end
  set [Y Speed v] to (0)
 end

If you're wondering, this is just a test to see if what I suspect is true.

Now it can jump as many times as I want, only problem it is jumping too big, to the top of the screen  smile  Whats that?

Offline

 

#389 2013-02-04 15:01:44

shadowmouse
New Scratcher
Registered: 2013-02-03
Posts: 100+

Re: Scripts Workshop: Give and get help with scripts

Is there any way to overlay sprites? What I mean is, if you're making an angry birds like game and you make your level with one colour as a bottom surface another as a left surface e.t.c. and then use if touching colour to make your sprite bounce off the sides, can you then put another sprite (what the level should actually look like) on top and still keep the if touching colour?

Offline

 

#390 2013-02-04 15:45:34

ErnieParke
Scratcher
Registered: 2010-12-03
Posts: 1000+

Re: Scripts Workshop: Give and get help with scripts

Pharosz wrote:

ErnieParke wrote:

ErnieParke wrote:


Well you could've used the forum's built-in scratchblocks creator, which I explain how to use here in this guide.

Anyway, I'll look at your code when I can; I have to go right now.

Actually, I've just realized that I do have a bit of time. So, in your script that looks like this:

when gf clicked
forever
 if <(key [up arrow v] pressed?) and <(Y Speed) = (0)>>
  set [Y Speed v] to (9)
  repeat until (touching color [#909090]?)
   change [Y Speed v] by (-0.5)
  end
  set [Y Speed v] to (0)
 end

Could you change to this and tell me if your character says "Hello" on jumps past the first one?

when gf clicked
forever
 if <(key [up arrow v] pressed?) and <(Y Speed) = (0)>>
  set [Y Speed v] to (9)
  say [Hello] for (1) secs
  repeat until (touching color [#909090]?)
   change [Y Speed v] by (-0.5)
  end
  set [Y Speed v] to (0)
 end

If you're wondering, this is just a test to see if what I suspect is true.

Now it can jump as many times as I want, only problem it is jumping too big, to the top of the screen  smile  Whats that?

Well I think that's being caused by setting your y value to to large of a number. 4~7 would probably be better in our case. Also, I think that replacing the [say [Hello] for (1) secs] with [wait (0) secs] would work, if you want to change that.


http://i46.tinypic.com/35ismmc.png

Offline

 

#391 2013-02-04 16:18:24

Pharosz
New Scratcher
Registered: 2013-02-02
Posts: 6

Re: Scripts Workshop: Give and get help with scripts

ErnieParke wrote:

Pharosz wrote:

ErnieParke wrote:


Actually, I've just realized that I do have a bit of time. So, in your script that looks like this:

when gf clicked
forever
 if <(key [up arrow v] pressed?) and <(Y Speed) = (0)>>
  set [Y Speed v] to (9)
  repeat until (touching color [#909090]?)
   change [Y Speed v] by (-0.5)
  end
  set [Y Speed v] to (0)
 end

Could you change to this and tell me if your character says "Hello" on jumps past the first one?

when gf clicked
forever
 if <(key [up arrow v] pressed?) and <(Y Speed) = (0)>>
  set [Y Speed v] to (9)
  say [Hello] for (1) secs
  repeat until (touching color [#909090]?)
   change [Y Speed v] by (-0.5)
  end
  set [Y Speed v] to (0)
 end

If you're wondering, this is just a test to see if what I suspect is true.

Now it can jump as many times as I want, only problem it is jumping too big, to the top of the screen  smile  Whats that?

Well I think that's being caused by setting your y value to to large of a number. 4~7 would probably be better in our case. Also, I think that replacing the [say [Hello] for (1) secs] with [wait (0) secs] would work, if you want to change that.

Great now it works fine!
So it was a bug in scratch?

Thank you very much  smile

Offline

 

#392 2013-02-04 20:01:52

ErnieParke
Scratcher
Registered: 2010-12-03
Posts: 1000+

Re: Scripts Workshop: Give and get help with scripts

Pharosz wrote:

ErnieParke wrote:

Pharosz wrote:


Now it can jump as many times as I want, only problem it is jumping too big, to the top of the screen  smile  Whats that?

Well I think that's being caused by setting your y value to to large of a number. 4~7 would probably be better in our case. Also, I think that replacing the [say [Hello] for (1) secs] with [wait (0) secs] would work, if you want to change that.

Great now it works fine!
So it was a bug in scratch?

Thank you very much  smile

No; actually it was more of a problem with how your script was built. So, when you jump your second time, you set (Y Velocity) to 9, Scratch sees that you're touching grey, so it doesn't run the loop, and it sets (Y Velocity) back to 0. Then, it runs the scripts that moves your character and moves it 0 pixels up/down because (Y Velocity) is 0! So, with the addition of the wait block, Scratch will actually move your character each jump before it starts the repeat loop, clearing things up.

Anyway, your welcome!


http://i46.tinypic.com/35ismmc.png

Offline

 

#393 2013-02-05 11:18:26

JH1010
Scratcher
Registered: 2012-05-31
Posts: 1000+

Re: Scripts Workshop: Give and get help with scripts

shadowmouse wrote:

Is there any way to overlay sprites? What I mean is, if you're making an angry birds like game and you make your level with one colour as a bottom surface another as a left surface e.t.c. and then use if touching colour to make your sprite bounce off the sides, can you then put another sprite (what the level should actually look like) on top and still keep the if touching colour?

I don't think that is possible.

Offline

 

#394 2013-02-05 11:43:27

shadowmouse
New Scratcher
Registered: 2013-02-03
Posts: 100+

Re: Scripts Workshop: Give and get help with scripts

Is there any way that I could make the same sort of effect?
As in, the level that is done purely functionally with a better looking version on top?

Offline

 

#395 2013-02-05 23:26:54

despadron
New Scratcher
Registered: 2013-02-02
Posts: 3

Re: Scripts Workshop: Give and get help with scripts

I am having login issues, so I can't save.  Here is my dilemma; I get to the part that says login to save.  I have changed my password, updated my email and every time I try to login, it says invalid username and password.  But, when I am working on my script it says welcome despadron.  I am totally confused.

Offline

 

#396 2013-02-06 04:28:25

Blazingwave
Scratcher
Registered: 2012-10-27
Posts: 500+

Re: Scripts Workshop: Give and get help with scripts

despadron wrote:

I am having login issues, so I can't save.  Here is my dilemma; I get to the part that says login to save.  I have changed my password, updated my email and every time I try to login, it says invalid username and password.  But, when I am working on my script it says welcome despadron.  I am totally confused.

Great question! But you will get a lot more help if you ask on the bugs and glitches section of the forums  wink  Admins answer questions there such as these sort of issues!


http://i42.tinypic.com/t8nrlh.gif  http://blocks.scratchr.org/API.php?user=Blazingwave&amp;action=onlineStatus&amp;online=http://i49.tinypic.com/25flloj.gif=http://i45.tinypic.com/o8i97l.gif
http://i41.tinypic.com/s1lyyo.jpg

Offline

 

#397 2013-02-06 17:44:13

funnymee323
Scratcher
Registered: 2012-12-16
Posts: 100+

Re: Scripts Workshop: Give and get help with scripts

I would like to join, i'm not that good, but i can definetly answer some questions. But if i join, will my questions still be answered? Because i'm currently working on a complicated game and i may need some help....

Offline

 

#398 2013-02-06 18:17:55

ErnieParke
Scratcher
Registered: 2010-12-03
Posts: 1000+

Re: Scripts Workshop: Give and get help with scripts

funnymee323 wrote:

I would like to join, i'm not that good, but i can definetly answer some questions. But if i join, will my questions still be answered? Because i'm currently working on a complicated game and i may need some help....

Well, you don't need to be a member to ask questions; why you can ask them at any moment and have your questions answered with a nice reply! Also, you don't need to be good to join, you just need to ask to join. So you're in.  smile


http://i46.tinypic.com/35ismmc.png

Offline

 

#399 2013-02-06 18:20:34

ErnieParke
Scratcher
Registered: 2010-12-03
Posts: 1000+

Re: Scripts Workshop: Give and get help with scripts

shadowmouse wrote:

Is there any way that I could make the same sort of effect?
As in, the level that is done purely functionally with a better looking version on top?

Well, yes, and it might be the way that you mentioned earlier because I've been the editor for a game that's similar to this and that also uses some similar concepts, though I haven't gone too in depth, so I'm not exactly sure about how the game does this, so it might not work for you. It'll go look a bit deeper soon, and tell you what I see.  wink


http://i46.tinypic.com/35ismmc.png

Offline

 

#400 2013-02-08 10:40:47

Ideas
Scratcher
Registered: 2012-10-07
Posts: 100+

Re: Scripts Workshop: Give and get help with scripts

Bump


http://img685.imageshack.us/img685/2010/screenshot20121110at132.pngI think that you must CLICK above

Offline

 

Board footer