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

#1 2012-10-19 23:24:50

Zparx
Scratcher
Registered: 2011-03-23
Posts: 500+

Does any mod have this feature? (Or anything close to it?)

I think that we should be able to assign tags to sprites for more efficient means of detection. This would be especially helpful in platformer games. For instance, the ground sprites. Here is what someone would normally use for their scripts (this is my personal style. idk about anyone else);

when gf clicked
forever
if <(touching? [sprite 1 v]) or <(touching? [sprite 2 v]) or <(touching? [sprite 3 v]) or (touching? [etc! ;b v])>>>
//execute actions here        
end
That script always becomes a pest, and fairly large if you're making some huge platformer/scroller

Instead of putting that code, I think we should be able to go to the menu where the scratch blocks are (upper left corner) and have another category called "Tags". It would work similar to the variables function, and when you clicked it, there would be various functions, two of which called "Create Tag" and "Delete Tag". When you create a Tag, you could name it whatever you want (sort of like a variable), then "assign" your created Tag to any sprite you wanted. In this case, we would assign the tag to all of your ground sprites in the project you're making. So let's say you made a tag called "ground". You could then go to all of the sprites you are going to use to simulate ground in your project, and under the control blocks you would see blocks that say something like ;
add me to Tag [Ground v]
delete me from Tag [Ground v]
I think this would make this sort of programming very very efficient. Your script would look something like this after you've created and assigned your tag;

when gf clicked
forever
if (touching? [Tag: Ground v])
//execute actions here
So, does any available mod have this feature or anything close to it? Thanks in advance!


http://images3.wikia.nocookie.net/__cb20101119183412/halo/images/4/43/Hero2.png
^ My rank on Halo: Reach :3

Offline

 

#2 2012-10-20 00:47:51

ahirbhairav
Scratcher
Registered: 2012-10-06
Posts: 100+

Re: Does any mod have this feature? (Or anything close to it?)

If you make it then obviously yes. Otherwise no. I think.

Offline

 

#3 2012-10-20 00:48:51

nathanprocks
Scratcher
Registered: 2011-04-14
Posts: 1000+

Re: Does any mod have this feature? (Or anything close to it?)

That is a very cool and useful idea, but I don't think there is currently any mods with this feature. I am sure someone will make it.


http://carrot.cassiedragonandfriends.org/Scratch_Signature/randomsig.php
http://trinary.site40.net/images/scratchrank.php?username=nathanprocks&amp;display=small

Offline

 

#4 2012-10-20 01:21:59

bharvey
Scratcher
Registered: 2008-08-10
Posts: 1000+

Re: Does any mod have this feature? (Or anything close to it?)

Zparx wrote:

So, does any available mod have this feature or anything close to it?

In BYOB you can make a sprite-local variable TAGS in your first sprite with an empty list as its value, clone that one to make all your other sprites, and define "add me to tag (tag)" to be "add (tag) to (tags)."


http://cs.berkeley.edu/~bh/sig5.png

Offline

 

#5 2012-10-20 02:51:08

Zparx
Scratcher
Registered: 2011-03-23
Posts: 500+

Re: Does any mod have this feature? (Or anything close to it?)

bharvey wrote:

Zparx wrote:

So, does any available mod have this feature or anything close to it?

In BYOB you can make a sprite-local variable TAGS in your first sprite with an empty list as its value, clone that one to make all your other sprites, and define "add me to tag (tag)" to be "add (tag) to (tags)."

I'm kind of confused. Could you compose a project in BYOB of what you just said and email it to me? My email is: [email removed by moderator - please don't share contact information]

Last edited by Paddle2See (2012-10-20 05:35:14)


http://images3.wikia.nocookie.net/__cb20101119183412/halo/images/4/43/Hero2.png
^ My rank on Halo: Reach :3

Offline

 

#6 2012-10-20 03:29:00

blob8108
Scratcher
Registered: 2007-06-25
Posts: 1000+

Re: Does any mod have this feature? (Or anything close to it?)

Does the "touching?" block accept variable reporters? Then you could iterate over a list, which could be a (kludgey) workaround...


Things I've made: kurt | scratchblocks2 | this cake

Offline

 

#7 2012-10-20 07:26:01

Zparx
Scratcher
Registered: 2011-03-23
Posts: 500+

Re: Does any mod have this feature? (Or anything close to it?)

blob8108 wrote:

Does the "touching?" block accept variable reporters? Then you could iterate over a list, which could be a (kludgey) workaround...

The "touching?" block does accept variable reporters, and I've actually tried that method, but its terrible. Since the variable constantly has to switch, all of the sprites in the list that your sprite is not touching at the moment, aren't detected until the variable loops back around, while your sprite is falling helplessly in the meantime..


http://images3.wikia.nocookie.net/__cb20101119183412/halo/images/4/43/Hero2.png
^ My rank on Halo: Reach :3

Offline

 

#8 2012-10-20 08:08:51

blob8108
Scratcher
Registered: 2007-06-25
Posts: 1000+

Re: Does any mod have this feature? (Or anything close to it?)

Zparx wrote:

blob8108 wrote:

Does the "touching?" block accept variable reporters? Then you could iterate over a list, which could be a (kludgey) workaround...

The "touching?" block does accept variable reporters, and I've actually tried that method, but its terrible. Since the variable constantly has to switch, all of the sprites in the list that your sprite is not touching at the moment, aren't detected until the variable loops back around, while your sprite is falling helplessly in the meantime..

Ah, sure. The repeat loop makes it multiple frames. I should've thought of that...

The tags do sound like a nice idea, though  smile


Things I've made: kurt | scratchblocks2 | this cake

Offline

 

#9 2012-10-20 17:49:42

bharvey
Scratcher
Registered: 2008-08-10
Posts: 1000+

Re: Does any mod have this feature? (Or anything close to it?)

Zparx wrote:

Could you compose a project in BYOB of what you just said?

Here you go:

http://cs.berkeley.edu/~bh/tags.ypr

Click the green flag to make a bunch of sprites, each with a couple of tags.


http://cs.berkeley.edu/~bh/sig5.png

Offline

 

#10 2012-10-20 18:10:12

northmeister
Scratcher
Registered: 2011-07-12
Posts: 1000+

Re: Does any mod have this feature? (Or anything close to it?)

I think I suggested this (or something like this) in Scratch Suggestions named 'Sprite Classes,' but it was declined as apparently the clone feature will let us do this.


http://i48.tinypic.com/5a25g5.png

Offline

 

#11 2012-10-20 18:21:21

blob8108
Scratcher
Registered: 2007-06-25
Posts: 1000+

Re: Does any mod have this feature? (Or anything close to it?)

northmeister wrote:

I think I suggested this (or something like this) in Scratch Suggestions named 'Sprite Classes,' but it was declined as apparently the clone feature will let us do this.

Here.


Things I've made: kurt | scratchblocks2 | this cake

Offline

 

Board footer