The Variable HACK 🔨 Not many Scratchers know... yet
Quickly fix the most annoying of Scratch problems with this super easy variable hack! We've all made this mistake while coding in Scratch; Created a variable "For All Sprites" that should have been "For This Sprite Only". In this video we'll learn what the problem is, and some crazy cool ways to fix it and the underlying bugs it causes!
Also, enjoy my Griffpatch Story time lol - Hope you appreciate the rhyme!
My tutorials are for all budding game & software developers using Code Blocks. Scratch On guys!
🔥 Early Access / Channel membership - / @griffpatch
👀 Quick and Fun Tutorials - • Quick and Fun Scratch ...
❤️ Scratch Addons - scratchaddons.com/
📹 Video Editing Software - techsmith.pxf.io/c/2682566/50...
-------------Video Chapters-------------
0:00 Intro
0:18 The Problem
2:07 Debug
3:53 Try to Fix
4:42 Attempt 1
5:29 Solution 1 - Variable Hack
6:59 Any problems?
7:37 Solution 2 - Hard Work
7:53 Solution 3 - Scratch Addons
9:48 Outro
Пікірлер: 1 100
For those who are interested, Scratch Add-ons does provide a switch option between "for all sprites" and "for this sprite only", BUT it currently only works if you are not using the variable in multiple sprites... Which was the point of this video. Hopefully in future that will be fixed and then this will become super easy!
@PeppermintOSC
Жыл бұрын
nice!
@PeppermintOSC
Жыл бұрын
I already have scratch addons :D Nice tutorial by the way
@blueiicey
Жыл бұрын
I love this video! and nice rhyming
@RidyDaBidy95
Жыл бұрын
ialreadt have scratch addons and great tip
@thelio.l
Жыл бұрын
I already have scratch add-ons
*Poems by Griffpatch* 0:20 Once upon a time, Griffpatch feeling so clever, began to code the most epic Scratch project ever. 0:28 It began with a cat, and a variable for health. But should it be for all sprites, 0:34 or only for itself? Well, he wasn’t quite sure, 0:39 so he just let it be, and continued on blindly, saying “I guess we’ll just see”. 0:45 Then, when green flag clicked, Still unaware of his bloop, he set health to 5, 0:50 then straight into a forever loop. But just to be sure, he muttered “A say 0:56 block won’t lag”, he dropped in the health variable, and smashed that green flag! 1:02 “5” he declared, “Such muscle, such brawn!”, but he did not dally, no he had to Scratch On! 1:10 And so, with much health, Scratchy was ready to fight, with a nimble right click, 1:15 Griff duplicated that sprite. And it looked to be working, 1:19 double avatars of Scratch, reporting 5 health a peace, a genuine perfect match. 1:26 "Now it’s time to mix it up… " Griffpatch declared, and then, 1:30 boosted one cat's heath from 5 up to 10. And that's when it happened, on clicking 1:36 the green flag, it become pretty obvious he'd just hit a big snag. 1:42 For-although each cat's health was, there to plainly see, 1:46 they both still were reporting the very same exact HP. 1:50 But how is this possible? Each sprite's health was individually set, to a completely 1:55 different value when green flag clicked, and yet… "Oh man, this is bad", he disliked code Rewrites, 2:03 "I bet this was all because I opted for "for all sprites".
@triceratops3
6 ай бұрын
_wipes away a single tear_ it's beautiful.
@doogy_wants_doogcakes
6 ай бұрын
ITS A MASTERPIECE
@rajjoplayz
6 ай бұрын
Perfect. Its perfect, to the last minute detail
@iamsupershane69420
5 ай бұрын
best poem ever lol
@thecool1oof
Ай бұрын
Plus, 69 likes oof
You know, that preview mistake where all the enemies jump as you jump could make for quite a fun and interesting game.
@-_lIl_-
Жыл бұрын
yeah, you could make a game with that where you have to make the enemy bounce off the wall or get stuck from a platform to go onto the next level
@ianlopez8178
Жыл бұрын
have you played Hern1's "rescue" game? he sort of does that
@Lens_arcade
Жыл бұрын
you cannot jump over them, so the game would be really hard or even impossible. it would however be interesting to make a game where the goal would have the same velocity as the player and have the player make the goal bump into walls to "push" the goal towards you.
@poultrypants
Жыл бұрын
@@Lens_arcade The goal would be to get the stuck behind or under a platform, so you can get by. It wouldn't be impossible, and I believe a gam by the name of Will You Snail has a mechanic like this.
@laifepearl9271
Жыл бұрын
100th like
Some of my favorite addons: • Separate “for all sprites” and “for this sprite only” • Enhanced fullscreen • Various addons that let one change the editor look
@mateothode5603
Жыл бұрын
Dark mode !!
@reglan_dev
Жыл бұрын
@@mateothode5603 dark mode is cool, but not on scratch
@ergathonbrothersincorporat3238
Жыл бұрын
@@reglan_dev I have Better 3.0 and it gives me dark mode
@1080GBA
Жыл бұрын
U forgot pause button
@reglan_dev
Жыл бұрын
@@1080GBA pause button is amazing
The style of this video from 0:00 to 2:05 is just hilarious!
@griffpatch
Жыл бұрын
Glad you think so :D hehe. I had fun making it!
@draxgrek9880
Жыл бұрын
@@griffpatch it was pretty funny
Been using this for a while and it’s been an absolute lifesaver! Another useful variable add on is one to separate the ‘all sprites’ ones from the ‘this sprite only’ ones in the toolbox :)
Don’t know if you’ll ever see this but your scratch games and well the scratch community got me into programming way back when. I just landed a swe job as a new grad at a faang company and wanted to thank you!
@griffpatch
Жыл бұрын
Woohoo amazing! Well done you!
@imara4389
Жыл бұрын
@@griffpatch Thank you!
It was also interesting learning a bit about how Scratch handles missing variables, too. Now I'm really curious the specific logic they use to do that, but that somehow gets (I'm assuming) the "first sprite you click on that needs the replacement" stuck in the reporter. If you hadn't proved it worked, I would have suspected a bug where they had a new global but with the sprite name prefix in it accidentally or something like that. Hmm...
@griffpatch
Жыл бұрын
Indeed! - It is a bit weird, but the variable reporters are not tightly coupled to the actual variables it seems... The weirdest thing is that I kind of thought after saving and reloading that it might sort itself out... but nope :) - Oneday all these little glitches will get ironed out I'm sure!
Thanks griffpatch we can never have doubted because you never fail to make the scratch community a better place
I’ve been watching your tutorials for a little bit now and always have been on the fence about scratch add ons, but this has convinced me!
Thanks griffpatch! I once also thought i know all about scratch variables and got so puzzled when the project didn't work as i intended. This is an absolute life saver!
@griffpatch
Жыл бұрын
Awesome!
You can also use a "for this sprite only" variable to have *clones* have individual values for variables. Just something to keep in mind.
@CatinaboxReal
Жыл бұрын
wait what
@random3250
Жыл бұрын
I actually use this to ID between clones! I'm glad to know i'm not the only one to know this.
@faretek3545
Жыл бұрын
This clone I'd. You can also use it for much more,like a dual player in a platformer, or different clones in the same sprite. You can also use costume names and built in variables for clone I'd, but getting to know this is even better
I love the rhyming XDDDD I have experienced this 'for all sprites variable thing' before with making hp in multiple clones. It was so odd because a clone with a small hp drops in it would mean all clones will go to low hp aswell. And i was very working back then so i just went with it till this day its still here. I noticed when i decided to recreate my old proojects and make everything better. I realised it wasnt happening again and that openes up much more possible ways to make games on scratch. The old days...
Super useful. I was having a problem with my item variables and set them to "for this sprite only" when they should've been "for all sprites" , without this I would have had to rewrite everything, and now that I've watched it I was able to fix my problem with ease. I'm sure this video will be a big influence for others with a similar problem.
I love your new style of editing! It's way less serious and just mucking around, the poem at the beginning was a prime example, good job! :D
Scratch addons is finally getting the recognition it deserves! I use this extension all the time and I feel so happy you're announcing it!
I must say, the amount of editing you putting into these is a lot of work! Especially the mouse clicking sounds 😉 I know your tricks
I love how he rhymed the words at the start of the video. I didn't know they run in an order from front to back. Thank you for the facts and tips! 👍🏻
Amazing! this is the thing which had happened to me... i created thousands of duplicates for a sprite and changed the scripts a lot, and then realized that the variables were for all sprites * faints * but this video is exactly what i wanted! it was ultra useful, thanks a lot griffpatch!
Nice one, in the beginning I was kind of hoping the whole episode would be in poem form This trick might come in handy in future Scratch teaching sessions! Although I think I'll still get the most minds blown with the most underrated/misunderstood block of all: ([backdrop# v] of (Stage v)). ...whose secret power I learned from one of your videos obviously.
@griffpatch
Жыл бұрын
Yes indeed :D - The mysterious thing of thing block - Such power!!! - And yeah, I could have tried to go fully poem I guess hehe. Maybe another time! It only came to me to do it after I'd recorded the other half of the video already.
@officialtetronome
Жыл бұрын
The power of making scratch games
@debmalyalodh1
Жыл бұрын
@@griffpatch aww thanks :).
@megacadgeo9758
Жыл бұрын
What vid was it?
I don’t even use scratch but still watch these. They’re super well made and interesting! Keep it up!
@Brahvim
Жыл бұрын
Same xD I just... don't use it _anymore._
@BluEatsNuggets
Жыл бұрын
I'm a noob at it and I'm horrible
@wojtekgame
Жыл бұрын
i use it :_Appel:
@ezzeldingamingcoding
Жыл бұрын
@@BluEatsNuggets I'm good at using Scratch
Exhilarated to see more of these add-ons. Lets go! Sure would love to see more in the upcoming videos in the form of a poem :D
Thank you so much! I didn't know what the bug in my project was before I watched this video, and now I've finally fixed it thanks to you.
@griffpatch
Жыл бұрын
Awesome!
Man i swear, i learn new Scratch features from you everyday, from painting hacks to easier variable changing
I can tell Griffpatch's editing got better and funnier Keep it up!
@GabbyandLala
Жыл бұрын
you are right
Wow. That's amazing! I'd love to see more of them.
This is definitely a helpful video and I found out that in turbowarp you actually can change it through there by right clicking on the variable and then chosing convert to "this sprite only". I wish scratch would just add this feature too.
Amazing video, griffpatch! You've helped me get better at coding in scratch with all of your videos.
7:37 Another warning with this; I've found that it can sometimes cause a report monitor to get stuck on screen and never disappear. You can edit your project's JSON file to fix it, but it's a little bit of a hassle.
@griffpatch
Жыл бұрын
On dear!
I love the way that this video is edited 😍😸
Aside from my personal coding strategy, I think this video was very cool! It wad enjoyable and I learned some things even though I expected to just be going through stuff I already knew! Great job!
@griffpatch
Жыл бұрын
Glad it was helpful!
Man, I learned multiple things from this! I didn't know about the order Scratch runs scripts in. Mostly because I work my way around relying on it. I also didn't know about the way Scratch handles variable deletion inside sprites that aren't selected. Ironically, the part of the video I did know about was the Scratch add-ons.
Nice video.
@wojtekgame
Жыл бұрын
oh hi there
@wojtekgame
Жыл бұрын
I will wait for 2 years to be unbanned from the ScratchAddons/ScratchAddons repository
@Enderia2
Жыл бұрын
oh hi scratch addons
by the way this video is really edited
I've been watching you for ages and a did something I was quite proud of on Scratch, it's not public what I coded but it made me happy that just by watching your videos I coded by myself.
@griffpatch
Жыл бұрын
Sounds awesome! Well done
mad respect for the rhyming segment!!! 10/10 video yet again griffpatch! thanks for the awesome content!
This is so cool, it not only teaches kids about global vs local variables but it also teaches you how to get around scratch's bugs
griffpatch i love your videos!!!! Also this video was so good because it really explained to me what the difference is between "For All Sprites" and " For This Sprite Only"
*Loved it!* Hope you'll make more videos with similar format as this!
Love the video! Every video you upload is very exiciting and knolageble. Thank you!
I love it! Scratch addons us really good, with them, you can also right click on a variable and click rename or edit and then you can make it for this sprite only! Also, I love the sound effects! It really makes the video fun! It was also fun to see in the outro your "Inventory" game! I will try make something like that, crediting you!
@griffpatch
Жыл бұрын
Yeah, that sounds great, have a go!
If you are still carrying on the tips on scratch series it would be amazing to go into detail about clone collisions. And also love the content!
The video quality keeps getting better and better! Awesome :D
Thanks so much! Most of the time when I follow tutorials I get wrong the 'this sprite only' and 'for all sprites' and I was so happy! Just one thing, could you p[lease continue on the platformer series because maybe you could add power ups, weapons and all. P.S I actually wanted to see your my stuff for a long time cause I thought it looked interesting.
Nice video but I knew scratch addons a year ago but... still helpful for others who don't know and I loved the way you explained, keep the good work up... 💗💗💗
really usefull add-on! Thank you griffpatch, it was informative and entertaining (poem) at the same time!
I love it! I'd definitely be interested in seeing more add-ons.
thanks for showing me this! It'll allow me to avoid making a x, y, and hp line in a list that becomes massive over time
Griffpatch you're a life saver and that poem was actually really good Cant wait to see what You do next!
This is such a life saver! The sound effects are really effective!
I had no idea that your KZread channel was such an upbeat place! The video felt a little over-edited (audio wise), but the same factor also made it very kid-friendly and easy to understand. Besides that, this video was overall a blast and of course, very useful.
@griffpatch
Жыл бұрын
I just wanted to try something a bit different :)
I was making a game and this kind of error took place and i thought i did everything wrong and gave up on it . if it was not for you i would have never countinued making my game . Thanks!
I love that intro rhyme! Also thanks for putting my project in your studio!
I didn't know about this addon, and it's been quite a fight to switch variables in big projects. So I can already see how useful this addon will be! Thank you, Griffpatch!
@griffpatch
Жыл бұрын
Glad I could help!
@karamjoud6769
3 ай бұрын
@@griffpatch but in your multiplayer tutorial as we add it at the platformer you said we should delete the cloud var from the stage but by that didnrt work :(
Thank you very much man, seriously you helped a lot i started from 0 to 10.
Man, it shows that you know about this. All I can say for myself and for all scratchers is: thank you.
Oh my god !! Thank you so much for your help. I really needed this
I love your videos Griffpatch!Thank you so much for showing us how to do amazing things with scratch!Keep up the great work!
@Clueless9602
Жыл бұрын
Oh,btw,awsome rhyming! :0
Thanks for the video it help me on a update I making for my game
Thank you griffpatch! I needed to do the exact opposite, I accidentally set "for this sprite only" instead of realizing that every sprite had to recieve the data of the variable.
That introduction to the problem was so well made!
What a great advertisement! I just realized all of my projects have every single variable as "for all sprites". Time to change that with the add-on :)
Awesome! Thank you griffpatch! Now if I mess up I can use this hack!
As a user of scratch addons I can say that all the settings make scratch so much easier. Especially the ctrl+space fast code :) Thank you!
@griffpatch
Жыл бұрын
My pleasure :)
i wish i could like this video twice, griffpatch you are so helpfull!
Wow, I Always Wonder How To Make A Score Board Work First & Now I Got It...... THANK YOU SO MUCH FOR THIS AMAZING VIDEO
That is awesome! I never thought of doing that, but Scratch should really just add a “change variable” function.
i only need to remember to create a "only for this sprite" variable but goodvideo i got the scratch addons extenttion now!! thanks
I love the sound effects! Keep doing them!
Woah, you really are active griffpatch! I love how you want to teach others!
I havent finished the vid yet but I'm using your scratch add-ons extension and it's so helpful for this video I also have a question, do you check your old studios like the number counters one or the joystick one?
@griffpatch
Жыл бұрын
I haven't checked those for a while no...
@TypeError2033
Жыл бұрын
Do you still read the lemonoids pt4 studio?
9:10 there is also an add-on, that lets you edit variables attributes *(including **_for this sprite only_** )*
Please make more video like this, i love it!
Hello Griffpatch You make the best scratch tutorials, thanks a lot for that! Is it possible to show us how to create an Arkanoid-like game? Thanks again , your are a great teacher!
I can tell griffpatch has increased his humor levels! Keep it up! :D
I love the rhyming at the beginning it was so awesome!
@griffpatch
Жыл бұрын
Yay, thank you!
I could've saved hours by watching this before, but now I won't ever lose time for one decision again. TY
This is soooooo useful for abundances of clones with health values, awesome
this new editing style is awesome!
I already had this but as always, great video.
Your videos help new scratchers day by day thanks😃
I have been wondering for a while how he can use a search bar to find blocks, scratch adding is going to super helpful, thanks griffpatch.
@griffpatch
Жыл бұрын
Sure thing!
This is for the first time ever griffpatch so informal with sound effects and back story and all. Overall it felt like a complete different video. 😂
@griffpatch
Жыл бұрын
Yep, this was a special episode :)
Hi There is on more way ( I think more efficient too..) In scratch addons there are two more tools. One being edit variable and other being change to for all sprites or this sprite only. Edit variable In this you get to right a click a variable and click on the new 'edit' button. Tgis shows tge same dialogue box that appears before you make a variable. Here you can switch variables to cloud based, rename and switch for all sprites or this sprite only. Switch variable to for all sprites or this sprite only. After turning on this addon, right click the variable and click on the 'switch...' button. Hopefully this is also helpful. Although I didn't know about your way too.
You were right! I AM in luck! Great tutorial as always Griffpatch :3
Amazing video! Keep up the good work :D
fire video as always griffpatch! this really helped me lol! Also, when should we expect the next 'classic platformer' episode?
@miguelemmanuellaroya8004
Жыл бұрын
idk if hes gonna upload more of the classic platformer series
@rexcreates6684
Жыл бұрын
I mean, in the description of ep 12, it does say "Episode 13 - To be announced."
@miguelemmanuellaroya8004
Жыл бұрын
@@rexcreates6684 But thats like months ago.
@miguelemmanuellaroya8004
Жыл бұрын
and hes starting new series so maybe the platformer series is done. Iam so sad if thats gonna happen.
@rexcreates6684
Жыл бұрын
@@miguelemmanuellaroya8004 nope! check his community tab!
i’m surprised more people don’t use this! i do this all the time, and it is so useful, especially with clones!
the story was amazing. well done
i would love to listen to a bedtime story told in griffpatch's soothing voice
One of scratch add-ons is a feature that you can right click on a variable and convert to this sprite only or for all sprites
New video! I must watch it! I love your videos
YES, THERE IS FINALLY A WAY! This is SUCH a life saver!
on turbowarp (scratch addons but with some cool JavaScript and some other cool extra stuff including more addons) theres an addon that lets you do stuff like changing from this sprite only to for all sprites and vise versa while renaming variable
This is a very interesting hack. (or glitch) Something I thought was only broken to stay broken but then all of a sudden you're telling me that you can hack the glitch? This blows my mind, yet it's simple. LOL!
Oh thank you so much! Scratch Addons helped me a lot! But I wish for an addon like "Show variable XY at x:(value) y:(value)" and "set variable looks to [default/white/old/...]". Thank you for your videos!
Griffpatch becoming Dr. Seuss was not something I realized i needed in my life
griffpatch, thanks for making scratch addons. its very useful and i am using it sooo much! truly something everyone should have.
@griffpatch
Жыл бұрын
Well, I made the scratch Dev tools extension, and I host the add-on, but the rest was not coded by me at all, but by worldlanguages
@pixlol
Жыл бұрын
@@griffpatch still, its essential if you are a bigger scrtacher and making lits of projects!
Clones can have their own variables for each when you enable "for this sprite only" I never knew this until recently, no longer do i have to use custom block loops and/or lists!
Have been using Scratch Addons for a while now, it's very helpful!
@griffpatch
Жыл бұрын
Great to hear!