This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.
  • Index
  •  » Suggestions
  •  » New Scratch Function: Assigning "Tags" to Sprites for Better Detection

#26 2012-10-22 23:27:42

TorbyFork234
Scratcher
Registered: 2012-03-01
Posts: 1000+

Re: New Scratch Function: Assigning "Tags" to Sprites for Better Detection

Zparx wrote:

TorbyFork234 wrote:

I support, but in the meantime you can use this relatively long workaround:

Make a list with a name of Tags:(TagName)
Then, for every sprite you have that you would want to be under that tag, you would put a

add [spritename] to [Tags:TagName v]
then, for sensing, you would do this:
when I receive [touching tagName v] //has to be under the sprite that you want to be checked for touching
set [i v] to [1]
set [touching v] to [0]
repeat <length of [Tags:TagName v]>
if <touching <item (i) of [Tags:TagName v]>?>
set [touching v] to [1]
end
change [i v] by (1)
end
if <(touching)=[1]>
say [you touched one of the sprites with a tag of tag name!]
end
Alternatively, for that script, since it's only for sensing, if you want to make it go faster, you could change the repeat to this:
repeat until <<((i)+(1))=<length of [Tags:TagName v]>>or<(touching)=[1]>>
end
You could also just have the bunch of or's sitting at the edge of the screen, and when you need it just duplicate it.

Anyways, it would be better to have it built in.

This is an effective method, and I've used it in some of my big games, such as "Cyber Defense" in which I added 10 sprites to the list. It worked fine because the turrets didn't require quick touch sense detection. However, if I had 10 or more ground sprites added to a list for a platformer and used this method, it would be very ineffective unless I used turbo mode.

But since nothing is going to happen until 2.0, you can put this into it's own block and have it run in "warp speed" (a c-block that I hear is already put in)

Offline

 

#27 2012-10-23 02:41:21

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

Re: New Scratch Function: Assigning "Tags" to Sprites for Better Detection

TorbyFork234 wrote:

But since nothing is going to happen until 2.0, you can put this into it's own block and have it run in "warp speed" (a c-block that I hear is already put in)

Really? How do I do that?  yikes


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

Offline

 

#28 2012-10-23 19:07:38

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

Re: New Scratch Function: Assigning "Tags" to Sprites for Better Detection

bump


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

Offline

 

#29 2012-10-24 15:36:39

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

Re: New Scratch Function: Assigning "Tags" to Sprites for Better Detection

bump


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

Offline

 

#30 2012-10-24 21:51:29

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

Re: New Scratch Function: Assigning "Tags" to Sprites for Better Detection

Bump


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

Offline

 

#31 2012-10-25 08:48:47

dvd4
Scratcher
Registered: 2010-06-30
Posts: 1000+

Re: New Scratch Function: Assigning "Tags" to Sprites for Better Detection

BUYP
up
your
post


I made a mod  big_smile  It's called blook!
http://i49.tinypic.com/16ia63p.png

Offline

 

#32 2012-10-25 09:00:48

technoboy10
Scratcher
Registered: 2007-08-25
Posts: 1000+

Re: New Scratch Function: Assigning "Tags" to Sprites for Better Detection

TorbyFork234 wrote:

But since nothing is going to happen until 2.0, you can put this into it's own block and have it run in "warp speed" (a c-block that I hear is already put in)

It's not in the alpha ATM. I think they took it out.  sad


So long, 1.4.
http://goo.gl/3JEV9

Offline

 

#33 2012-10-25 09:02:20

dvd4
Scratcher
Registered: 2010-06-30
Posts: 1000+

Re: New Scratch Function: Assigning "Tags" to Sprites for Better Detection

technoboy10 wrote:

TorbyFork234 wrote:

But since nothing is going to happen until 2.0, you can put this into it's own block and have it run in "warp speed" (a c-block that I hear is already put in)

It's not in the alpha ATM. I think they took it out.  sad

Yep, they did.

But at least there will be turbo blocks  hmm


I made a mod  big_smile  It's called blook!
http://i49.tinypic.com/16ia63p.png

Offline

 

#34 2012-10-25 16:24:22

Mokat
Scratcher
Registered: 2011-12-08
Posts: 1000+

Re: New Scratch Function: Assigning "Tags" to Sprites for Better Detection

@Zparx: You might want to delete some of your previous bumps...


http://www.eggcave.com/egg/977371.pnghttp://www.eggcave.com/egg/977376.pnghttp://www.eggcave.com/egg/1005291.pnghttp://www.eggcave.com/egg/996745.png

Offline

 

#35 2012-10-26 13:00:21

Martiscratch
Scratcher
Registered: 2012-05-04
Posts: 100+

Re: New Scratch Function: Assigning "Tags" to Sprites for Better Detection

[agree](In other words,support)


http://signaturecraft.us/signatures/eJw1yDEOgCAMBdC9p_gnICphdnA18QwoNZIAJRTD9Z184-uP74gKjxIvxi3tzaii3ZA-PjPijdgxvBpjcCYeeOtKW2Ou3OhIAbuUIOUvpdnNtDhH1tL0AQVCHgk~.png

Offline

 

#36 2012-10-27 17:20:05

Rexpup
Scratcher
Registered: 2010-10-17
Posts: 100+

Re: New Scratch Function: Assigning "Tags" to Sprites for Better Detection

YES I SUPPORT ALOT.
(I support alots.  They are kind creatures.)

First,  I could finally make that platformer that I've always wanted to do, and second, I could make better collision engines that I have been experimenting with.


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

Offline

 

#37 2012-10-27 17:48:24

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

Re: New Scratch Function: Assigning "Tags" to Sprites for Better Detection

Rexpup wrote:

YES I SUPPORT ALOT.
(I support alots.  They are kind creatures.)

First,  I could finally make that platformer that I've always wanted to do, and second, I could make better collision engines that I have been experimenting with.

It's so hard without a script like the one I'm suggesting  hmm

In BYOB, I've actually put this script together but without tags. I edited a true/false sensing block, like this:

when gf clicked
forever
if <(touching [sprite 1 v]?) or (touching [sprite 2 v]?)>
report true
else
report false
And called the block "touching ground sprites?"

and it worked like a charm! I added 5 new sprites to the created block and it still worked flawlessly. So I doubt it will be hard to implement if BYOB has already (sort of) done it! Thanks for the support (:


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

Offline

 

#38 2012-10-29 20:46:06

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

Re: New Scratch Function: Assigning "Tags" to Sprites for Better Detection

bump


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

Offline

 

#39 2012-10-30 02:37:59

scimonster
Community Moderator
Registered: 2010-06-13
Posts: 1000+

Re: New Scratch Function: Assigning "Tags" to Sprites for Better Detection

Zparx wrote:

TorbyFork234 wrote:

I support, but in the meantime you can use this relatively long workaround:

Make a list with a name of Tags:(TagName)
Then, for every sprite you have that you would want to be under that tag, you would put a

add [spritename] to [Tags:TagName v]
then, for sensing, you would do this:
when I receive [touching tagName v] //has to be under the sprite that you want to be checked for touching
set [i v] to [1]
set [touching v] to [0]
repeat <length of [Tags:TagName v]>
if <touching <item (i) of [Tags:TagName v]>?>
set [touching v] to [1]
end
change [i v] by (1)
end
if <(touching)=[1]>
say [you touched one of the sprites with a tag of tag name!]
end
Alternatively, for that script, since it's only for sensing, if you want to make it go faster, you could change the repeat to this:
repeat until <<((i)+(1))=<length of [Tags:TagName v]>>or<(touching)=[1]>>
end
You could also just have the bunch of or's sitting at the edge of the screen, and when you need it just duplicate it.

Anyways, it would be better to have it built in.

This is an effective method, and I've used it in some of my big games, such as "Cyber Defense" in which I added 10 sprites to the list. It worked fine because the turrets didn't require quick touch sense detection. However, if I had 10 or more ground sprites added to a list for a platformer and used this method, it would be very ineffective unless I used turbo mode.

Aha! And if you run this in an atomic block, so there's no need for tagging.  smile

Offline

 

#40 2012-10-30 02:51:32

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

Re: New Scratch Function: Assigning "Tags" to Sprites for Better Detection

scimonster wrote:

Aha! And if you run this in an atomic block, so there's no need for tagging.  smile

What on earth is an atomic block? ): Is it in 1.4 or is it being released in Scratch 2.0?

Last edited by Zparx (2012-10-30 02:51:56)


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

Offline

 

#41 2012-10-30 02:55:33

scimonster
Community Moderator
Registered: 2010-06-13
Posts: 1000+

Re: New Scratch Function: Assigning "Tags" to Sprites for Better Detection

Zparx wrote:

scimonster wrote:

Aha! And if you run this in an atomic block, so there's no need for tagging.  smile

What on earth is an atomic block? ): Is it in 1.4 or is it being released in Scratch 2.0?

Scratch 2.0 custom blocks will have the option to become "atomic", meaning run without screen refresh, which is what takes all the time.

Offline

 

#42 2012-10-30 03:05:21

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

Re: New Scratch Function: Assigning "Tags" to Sprites for Better Detection

scimonster wrote:

Zparx wrote:

scimonster wrote:

Aha! And if you run this in an atomic block, so there's no need for tagging.  smile

What on earth is an atomic block? ): Is it in 1.4 or is it being released in Scratch 2.0?

Scratch 2.0 custom blocks will have the option to become "atomic", meaning run without screen refresh, which is what takes all the time.

Awesome! How can I be assured that the "atomic speed" will be fast enough? Is it faster than turbo?


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

Offline

 

#43 2012-10-30 04:12:30

scimonster
Community Moderator
Registered: 2010-06-13
Posts: 1000+

Re: New Scratch Function: Assigning "Tags" to Sprites for Better Detection

Zparx wrote:

scimonster wrote:

Zparx wrote:


What on earth is an atomic block? ): Is it in 1.4 or is it being released in Scratch 2.0?

Scratch 2.0 custom blocks will have the option to become "atomic", meaning run without screen refresh, which is what takes all the time.

Awesome! How can I be assured that the "atomic speed" will be fast enough? Is it faster than turbo?

Yes. It's like it's a single block.

Offline

 

#44 2012-10-30 04:20:06

Willpower
Scratcher
Registered: 2012-01-26
Posts: 1000+

Re: New Scratch Function: Assigning "Tags" to Sprites for Better Detection

I support the tag idea  big_smile


http://i49.tinypic.com/e84kdj.png

Offline

 

#45 2012-10-30 21:07:44

nitromian
Scratcher
Registered: 2012-09-02
Posts: 9

Re: New Scratch Function: Assigning "Tags" to Sprites for Better Detection

I support I guess... but what I want to know is if atomic blocks could allow you to interact with other scratchers inside the program you made. How ever do this:

 repeat until<(scratch 2.0) = [out]>
 say [keep on scratching!] 
end
 say [scratch 2.0 is out!] 

Last edited by nitromian (2012-10-30 21:10:43)

Offline

 

#46 2012-10-31 12:03:31

firedrake969_test
Scratcher
Registered: 2012-08-08
Posts: 500+

Re: New Scratch Function: Assigning "Tags" to Sprites for Better Detection

One script solution is here, although a bit glitchy.


Alt of Firedrake969.

Offline

 

#47 2012-10-31 18:14:31

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

Re: New Scratch Function: Assigning "Tags" to Sprites for Better Detection

firedrake969_test wrote:

One script solution is here, although a bit glitchy.

That was already suggested. It works perfectly fine if you aren't working on a platforming game, or a game that requires fast detection. Because the entire time that the variable is on the sprites that your main sprite isn't touching, it will fall through your ground sprites.


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

Offline

 

#48 2012-11-01 15:51:07

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

Re: New Scratch Function: Assigning "Tags" to Sprites for Better Detection

bump


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

Offline

 

#49 2012-11-02 19:25:07

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

Re: New Scratch Function: Assigning "Tags" to Sprites for Better Detection

bump


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

Offline

 

#50 2012-11-03 14:07:30

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

Re: New Scratch Function: Assigning "Tags" to Sprites for Better Detection

bump


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

Offline

 
  • Index
  •  » Suggestions
  •  » New Scratch Function: Assigning "Tags" to Sprites for Better Detection

Board footer