Discuss Scratch

craZcat
Scratcher
60 posts

Helpful Blocks Involving Clones of Sprites

One of the problems with scratch 2.0 is that it's very difficult to have a clone act when another clone is touching a different kind of clone (real life example: having a cloned tower fire cloned projectiles at a specific cloned enemy when that enemy is within range.) So I thought of a bunch of possible blocks that could help resolve this kind of situation so it would be much easier for a scratcher to get it to work:

(clone ID)
- this is which, out of the 300 possible clones the refered clone is. It's kind of like a variable that other clones cannot change but can react to.
<if clone of (specific sprite) touching clone with ID (number input)>
_ A boolean that is true when one of the clones from a sprite is touching a specific clone. There might be a similar one reversed of this
{< if clone with ID (number input) touching clone of (specific sprite)>}

- this will identify the clone that satisfied the last boolean in the script.
<if touching clone of (specific sprite)>
- this boolean is only true when the sprite/clone is touching a clone that came from a specific sprite.
(last identified clone)
-This input refers to the clone that has last been identified by the sprite/clone. In example, if a a boolean allowed a script to continue if it was touching a specific kind of clone, then identify that clone saying it was clone 244, then any future block saying will point at the newly identified clone- in this case, clone 244!

These blocks allow clones to respond to specific clones or specific kinds of clones. This would be very useful for projects that use a lot of cloning (like a RPG game, a Tower defense game, and such. The only workaround to this that I know of is extremely long and complicated lists, involving many variables and broadcasts. Not only is using these easier, it also greatly reduces the lengh of long and scripts that could barely even be understood.

Now that I have stated my idea, I'd appreciate it if you could tell me if they are/aren't needed and why, or if you have more ideas for these kinds of blocks.

Last edited by craZcat (June 27, 2013 18:09:01)

curiouscrab
Scratcher
500+ posts

Helpful Blocks Involving Clones of Sprites

I support, although some of those block might be hard for the ST to implement.
Blank1234
Scratcher
500+ posts

Helpful Blocks Involving Clones of Sprites

semi-support for 1, because thers a workaround, but not many people know it
support for 2, because it would be very hard to implement something like that into a projct
samq64
Scratcher
1000+ posts

Helpful Blocks Involving Clones of Sprites

Here are what I think the blocks should look like:

(Clone ID::sensing)
<Clone of [sprite1 v] is touching clone[1] ?::sensing>
<Clone[1] is touching a clone of[sprite 1 v] ?::sensing>
<Touching clone of [sprite 1 v] ?::sensing>
(Last identified clone::sensing)

I put them in the sensing category because they don't control the clones like the other clone blocks.
I can see how some of these can be helpful especially the (Clone ID) block.

Here are some other ideas for clone blocks:
When I start as clone []::control hat
Delete clone []::control stack
(Is a clone?:: sensing boolean)
the2000
Scratcher
1000+ posts

Helpful Blocks Involving Clones of Sprites

Yeah, I support all of these ideas. It would be useful to detect which clone another sprite is touching.
samq64
Scratcher
1000+ posts

Helpful Blocks Involving Clones of Sprites

I find these especially find these helpful for my OS project because for things like the app icons I use clones but then I have to set them up them with these scripts:
when green flag clicked
set [clone number v] to [0]
repeat (...::reporter)
create clone of [myself v]
change [clone number v] by (1)
end
set [clone number v] to [0]
when I start as a clone
if <(clone number) = [1]> then
Do this
end
if <(clone number) = [2]> then
Do that
end
...
Which is fine for one sprite, but I've had to do it for at least 5 sprites so far. So yeah, the Clone ID block should definitely be added!
when I start as clone [1]::control hat
This would be helpful to only activate specific clones when they're first created without all those unneeded if blocks.

Anyway, I give block these ideas full support!

Last edited by samq64 (Jan. 7, 2021 23:00:35)

cavemanster
Scratcher
100+ posts

Helpful Blocks Involving Clones of Sprites

definite support. The workaround takes WAY longer without this
ninjaMAR
Scratcher
1000+ posts

Helpful Blocks Involving Clones of Sprites

Support! I hate using lists to do this
cavemanster
Scratcher
100+ posts

Helpful Blocks Involving Clones of Sprites

ninjaMAR wrote:

Support! I hate using lists to do this
agreed.
Mar10Josh
Scratcher
100+ posts

Helpful Blocks Involving Clones of Sprites

I know there are ones but here are some more we could use:
When clone [first clone id] get interactions with clone [] (Last interaction :: control)  :: control hat

Change the variable [my variable v] owned by clone [clone id] to [new value of variable] :: control

Create self-variable named [my second variable] :: control // This is for the clone ONLY!

(my self variable [my variable v] :: control)

Change id of clone [first id] to [new id] :: control

Create the self-variable [my third variable] for [clone id] :: control

Run following script on clone id [] {
...
} :: control // This would be a C block.

Add nickname for clone [] nickname [] :: control
And a replacement for the create clone block:

create clone of [self v] with the clone id [clone1] :: control

Last edited by Mar10Josh (Nov. 10, 2021 06:17:47)

8to16
Scratcher
1000+ posts

Helpful Blocks Involving Clones of Sprites

Bumping because of dupe.

Powered by DjangoBB