Discuss Scratch

craftingdickson
Scratcher
84 posts

If x position= and y position= problem

Hi guys,
I made a script:
setspawn oretopickrandom0to1setxtopickrandom-8to8*32setyto32whenIstartasacloneforeverifxposition=xandyposition=ythenswitchcostumetowoodchangeyby32ifxposition=xandyposition=ythenswitchcostumetowood
etc. Then it will generate a tree like this

⬛▀⬛

bold=wood
white=leaves
However, it generated tons of crazy things, why would this happen?

Last edited by craftingdickson (Oct. 8, 2014 00:13:32)

drmcw
Scratcher
1000+ posts

If x position= and y position= problem

That script makes very little sense and certainly not a tree as it's just incrementing y by 32 forever. Sharing the project would be preferable.

Last edited by drmcw (Oct. 8, 2014 06:37:58)

craftingdickson
Scratcher
84 posts

If x position= and y position= problem

Shared already long time ago, my featured project
drmcw
Scratcher
1000+ posts

If x position= and y position= problem

Any clues where this script is in the project and how to see it run?
craftingdickson
Scratcher
84 posts

If x position= and y position= problem

HI guys,
in my project http://scratch.mit.edu/projects/23946046/ click see inside,
in the block sprite, there is a script: (scroll to the right and scroll down a bit and u will find it)
set to (pick random (0) to (1))
set to ((pick random (-8) to (8)) * (32))
set to


when I start as a clone
forever

if <<(x position) = (x)> and <(y position) = (y)>> then

switch costume to
end
change by (32)
if <<(x position) = (x)> and <(y position) = (y)>> then

switch costume to
end
end


etc. Then it will generate a tree like this

⬛▀⬛

bold=wood
white=leaves
Start my project and all the wood and leaves are in different places, Why???????
craftingdickson
Scratcher
84 posts

If x position= and y position= problem

lederniersamourai
Scratcher
500+ posts

If x position= and y position= problem

In sprite “block” top script at the very right.
I did not see the cloning.
So, I guess you did not yet used the script you propose in your message.
I do not know how your clones are generated and when they are killed, i.e. the exact schedule of clone execution.
But if you have a number of clones with no exact schedule, you cannot expect they will change the global variable y in the correct order. They will do it more or less randomly.
drmcw
Scratcher
1000+ posts

If x position= and y position= problem

craftingdickson wrote:

http://scratch.mit.edu/discuss/topic/61798/?page=1#post-524906
I said it here
Why? Don't start a new topic, just repost on this and it will be bumped. Still cannot see scripts in the block sprite. The only when I start as a clone script looks like this
whenIstartasacloneforever
Perhaps if you could tidy up your scripts it would save anyone else having to sort through the jumble and would be better able to help.
lederniersamourai
Scratcher
500+ posts

If x position= and y position= problem

drmcw wrote:

craftingdickson wrote:

http://scratch.mit.edu/discuss/topic/61798/?page=1#post-524906
I said it here
Why don't start a new topic, just repost on this and it will be bumped.
Yes.
And following your suggestion, this problem is sufficiently difficult to set it in a “dummy project” with just that sprite and the new glitching scripts.
craftingdickson
Scratcher
84 posts

If x position= and y position= problem

drmcw wrote:

craftingdickson wrote:

http://scratch.mit.edu/discuss/topic/61798/?page=1#post-524906
I said it here
Why? Don't start a new topic, just repost on this and it will be bumped. Still cannot see scripts in the block sprite. The only when I start as a clone script looks like this
whenIstartasacloneforever
Perhaps if you could tidy up your scripts it would save anyone else having to sort through the jumble and would be better able to help.
I cleaned up my scripts, the script is now on the very right and at the bottom, the par of the script I need help starts like this:
setSpawn oreto1setore xtopickrandom-8to8*32
drmcw
Scratcher
1000+ posts

If x position= and y position= problem

So its the script at the end of the “when I receive chunks finished” script. Would've save time if you said it was that script first! Can you explain how you think that script will generate a tree?
Jo3s
Scratcher
12 posts

If x position= and y position= problem

This is USEFULL
imfh
Scratcher
1000+ posts

If x position= and y position= problem

Jo3s wrote:

This is USEFULL
Welcome to the Scratch Forums! This is from 2014, which means it is 5 years old! Posting on something old like this makes a lot of people see it again. This is called “necroposting” which is usually not allowed. There's no need to tell everyone it is useful if it is so old.

If you ever have any questions about scripting, feel free to make your own topic with the button at the top right of Help With Scripts page and people will probably be happy to help you. You might want to read Welcome to Help with Scripts to get some good tips on getting better help.

Powered by DjangoBB