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
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!
nice!
I already have scratch addons :D Nice tutorial by the way
I love this video! and nice rhyming
ialreadt have scratch addons and great tip
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".
_wipes away a single tear_ it's beautiful.
ITS A MASTERPIECE
Perfect. Its perfect, to the last minute detail
best poem ever lol
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.
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
have you played Hern1's "rescue" game? he sort of does that
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.
@@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.
100th like
The style of this video from 0:00 to 2:05 is just hilarious!
Glad you think so :D hehe. I had fun making it!
@@griffpatch it was pretty funny
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
Dark mode !!
@@mateothode5603 dark mode is cool, but not on scratch
@@reglan_dev I have Better 3.0 and it gives me dark mode
U forgot pause button
@@1080GBA pause button is amazing
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!
Woohoo amazing! Well done you!
@@griffpatch Thank you!
Thanks griffpatch we can never have doubted because you never fail to make the scratch community a better place
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...
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!
I don’t even use scratch but still watch these. They’re super well made and interesting! Keep it up!
Same xD I just... don't use it _anymore._
I'm a noob at it and I'm horrible
i use it :_Appel:
@@BluEatsNuggets I'm good at using Scratch
You can also use a "for this sprite only" variable to have *clones* have individual values for variables. Just something to keep in mind.
wait what
I actually use this to ID between clones! I'm glad to know i'm not the only one to know this.
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...
I can tell Griffpatch's editing got better and funnier Keep it up!
you are right
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’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!
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.
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.
The power of making scratch games
@@griffpatch aww thanks :).
What vid was it?
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!
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
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
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!
Awesome!
Wow. That's amazing! I'd love to see more of them.
I love the way that this video is edited 😍😸
mad respect for the rhyming segment!!! 10/10 video yet again griffpatch! thanks for the awesome content!
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.
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.
On dear!
Nice video.
oh hi there
I will wait for 2 years to be unbanned from the ScratchAddons/ScratchAddons repository
oh hi scratch addons
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! 👍🏻
Man i swear, i learn new Scratch features from you everyday, from painting hacks to easier variable changing
by the way this video is really edited
Love the video! Every video you upload is very exiciting and knolageble. Thank you!
*Loved it!* Hope you'll make more videos with similar format as this!
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.
Awesome!
Amazing video, griffpatch! You've helped me get better at coding in scratch with all of your videos.
The video quality keeps getting better and better! Awesome :D
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!
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!
Glad it was helpful!
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!
Yeah, that sounds great, have a go!
This is such a life saver! The sound effects are really effective!
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"
I love that intro rhyme! Also thanks for putting my project in your studio!
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.
Sounds awesome! Well done
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.
That introduction to the problem was so well made!
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!
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.
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
I love it! I'd definitely be interested in seeing more add-ons.
Griffpatch you're a life saver and that poem was actually really good Cant wait to see what You do next!
Griffpatch becoming Dr. Seuss was not something I realized i needed in my life
really usefull add-on! Thank you griffpatch, it was informative and entertaining (poem) at the same time!
I love your videos Griffpatch!Thank you so much for showing us how to do amazing things with scratch!Keep up the great work!
Oh,btw,awsome rhyming! :0
i would love to listen to a bedtime story told in griffpatch's soothing voice
I love the sound effects! Keep doing them!
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... 💗💗💗
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
the story was amazing. well done
this new editing style is awesome!
I can tell griffpatch has increased his humor levels! Keep it up! :D
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!
Glad I could help!
@@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 :(
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 :)
Amazing video! Keep up the good work :D
Thank you very much man, seriously you helped a lot i started from 0 to 10.
I had no idea that your KZhead 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.
I just wanted to try something a bit different :)
Awesome! Thank you griffpatch! Now if I mess up I can use this hack!
i wish i could like this video twice, griffpatch you are so helpfull!
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
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!
Woah, you really are active griffpatch! I love how you want to teach others!
Your videos help new scratchers day by day thanks😃
I love the rhyming at the beginning it was so awesome!
Yay, thank you!
New video! I must watch it! I love your videos
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.
Please make more video like this, i love it!
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!
My pleasure :)
fire video as always griffpatch! this really helped me lol! Also, when should we expect the next 'classic platformer' episode?
idk if hes gonna upload more of the classic platformer series
I mean, in the description of ep 12, it does say "Episode 13 - To be announced."
@@rexcreates6684 But thats like months ago.
and hes starting new series so maybe the platformer series is done. Iam so sad if thats gonna happen.
@@miguelemmanuellaroya8004 nope! check his community tab!
Thanks for the video it help me on a update I making for my game
I already had this but as always, great video.
That is awesome! I never thought of doing that, but Scratch should really just add a “change variable” function.
2:09 Awesome story creator!
That’s amazing! I always need it
been waiting for this for hours!
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 love the rhymes they're so unique!
He he
@@griffpatch how long did it take to make the poem?
9:10 there is also an add-on, that lets you edit variables attributes *(including **_for this sprite only_** )*
You were right! I AM in luck! Great tutorial as always Griffpatch :3
i only need to remember to create a "only for this sprite" variable but goodvideo i got the scratch addons extenttion now!! thanks
The fact that the beginning rhymes is the amazing
Wow, I Always Wonder How To Make A Score Board Work First & Now I Got It...... THANK YOU SO MUCH FOR THIS AMAZING VIDEO
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. 😂
Yep, this was a special episode :)
0:20 Once upon a time, griffpatch feeling so clever, began to code the most epic scratch project ever!
This is soooooo useful for abundances of clones with health values, awesome
griffpatch, thanks for making scratch addons. its very useful and i am using it sooo much! truly something everyone should have.
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
@@griffpatch still, its essential if you are a bigger scrtacher and making lits of projects!
Have been using Scratch Addons for a while now, it's very helpful!
Great to hear!
I like the story and the music what you add XD its funny
Naturally, when a person finds a hack, when the creator finds out, he/she deletes it, but Griffpatch IS the crator
i like the new effects and sounds griffpatch got from his editor :)
nice ryming! love it!
This is a very helpful tutorial 😀