NOOOOTE! - Most of the stuff I go through here is perfect if you're someone who uses Scratch as your game engine to export to Newgrounds, and maybe other platforms like itch.io and whatnot. Because, let's be honest, are you, someone currently on NG, really gonna devote your work to Scratch and Scratch only?
CHAPTER 0
The basic process of putting your Scratch game on Newgrounds is literally as simple as 1-2-3.
- le grab scratch .sb3
- le export thru HTMLifier and put in le .zip
- le upload to Newgrounds
That's the best way for a Scratch game to go on Newgrounds... if you don't care. Or if you're bored, or unimaginative, or if you were just forced to upload the damn thing on this site.
So how do we spice stuff up? Well, I present with you 2 ways, among some other notes to implement on your Scratch project before uploading here on NG.
Without further ado, I'd like to introduce to you...
CHAPTER 1 - A stupidly brief intro on TurboWarp
I don't just mean the packager, though we'll get to that later. If you can, get the TurboWarp Desktop application, which is available for Windows, Mac and Linux. Or, if not, just use the web app. Either way, both come with most of the addons on ScratchAddons which you can turn on or off (!!!), and it also has said packager built in. For the rest of this newspost, I'll be talking about the Desktop app.
Now why do we need this? Well, for starters, it's actually nice. An offline (desktop-only) editor for Scratch, complete with some quality of life improvements and a built-in packager. And also, to quote our dear Doc Marty, we get to see some serious shit.
CHAPTER 2 - Cool additions
Now, obviously none of these work on Scratch (the site, not the programming language btw), which is why I added a disclaimer above saying this is for people who want their Scratch games outside of Scratch. If you were hoping to use these for Scratch projects to be uploaded on the actual Scratch site, boy I have some bad news for you.
CHAPTER 2.1 - USB GAMEPAD SUPPORT
For this, you'll need... a gamepad. Wow! But seriously, of course you'll need a USB gamepad for this one, because you literally can't add gamepad support if TurboWarp has nothing to map stuff to.
Firstly, when you have TurboWarp's editor open, go click that Addons button on the top. It'll open up a window; on the search bar, type "gamepad"; it'll greet you with the "Gamepad support" addon. Turn that on.
Though you can change these mappings anytime, I recommend you do this once you've finalized your Scratch game's controls. Plus, these map keyboard keys to the gamepad, so if you mapped the A key to, well, the A button for example, your Scratch game/project will do just about everything you've programmed it to do when you press the A key.
When the time actually comes to export your Scratch project as an .html file or whatever, go to Input and check the "Support USB or Bluetooth gamepads/controllers" box. This allows the packager to, well, support gamepad controllers.
Now, for the other cool thing I want to show you that you can do:
CHAPTER 2.2 - SCRATCH + NEWGROUNDS.IO
NOTE: YOU NEED TO EXPORT THE PROJECT WITH THIS SPECIFIC VERSION OF TURBOWARP PACKAGER
For some reason, newer releases fail to connect with the NG API. BIG SHOUTOUTS TO @s-zenmode FOR THIS
If your game looks like it could need some medals and scoreboards, then let's add some medals and scoreboards, baby. Oh yeah. If you're unaware, and I don't know why you would be, Newgrounds.io is the NG API which makes medals and stuff happen.
Now, almost a year ago, @lajbel made a newspost teaching everyone how to hook up your Scratch projects with Newgrounds.io, even writing a whole bunch of custom code for it. The instructions are pretty simple, and if you're too lazy to click that link above, don't worry, because to summarize:
1 - Make cloud variable titled "eval"
2 - Somewhere on your Scratch project, add a When FLAG clicked event and add a set ☁ eval to Newgrounds.Init("appid", "enckey") block, replacing "appid" and "enckey" with your game project's App ID and Encryption Key, respectively, in API Tools
3 - TO ADD...
MEDALS - add a set ☁ eval to Newgrounds.UnlockMedal(medalID) block, replacing "medalID" with respective medal's ID
SCORES - add a set ☁ eval to Newgrounds.PostScore(boardID, score) block, replacing "boardID" with respective board's ID and "score" with the score for posting, e.g. "1234"
4 - EXPORT TO HTML
At this point in the tutorial, lajbel tells you to export the thing in HTMLifier, which is understandable because for some reason apparently TurboWarp wasn't able to process cloud variables at the time he made the post.
But now it can, I literally just tested it today. And here's how I made that happen.
As you package your project that very much has a cloud variable, go down to the Cloud Variables category.
Now this is important. Set mode to "Store in local storage." That's the first step.
The second step is to check both "Special cloud variable behaviors like HTMLifier" and "Additional unsafe cloud behaviors."
"Oh God. 'including the ability to install viruses'?" Yeah, I know. But the reason we still have to turn that on is because eval cloud variables don't work if you don't check that box. Seriously.
And don't cry about eval being used because honestly, 1. I don't really care, 2. there is afaik no other way to do this and 3. see point 1 but more aggressive
That's all for cloud variables, now it's time for the last but very much not the least step.
Originally, in HTMLifier, you just add this link in a section that says "Include custom JavaScript". It works there, but for some reason, it doesn't work in TurboWarp; hell, it only causes the loading screen to never go away, therefore freezing the game. But I managed to find a solution.
The third last section, find "Advanced Options". And instead of copying "https://cdn.jsdelivr.net/gh/lajbel/reversion-newgrounds@1.1/newgrounds.js" and putting it on "Custom extensions (one URL per line), you need to actually go to https://cdn.jsdelivr.net/gh/lajbel/reversion-newgrounds@1.1/newgrounds.js, copy everything, and paste it on "Custom JS" down below.
CHAPTER 2.3 - CLOUD SAVES, REDIRECTS, ETC
@s-zenmode made this kewl new Scratch guide (that's three Scratch guides on Newgrounds now!) talking about how you can do cloud saves, redirects, and some other tweaks like 60fps!
https://s-zenmode.newgrounds.com/news/post/1300067
CHAPTER 3 - Some notes
CHAPTER 3.1 - Dude, where's my sounds?
Now, as demonstrated in the NG release of An Ordinary Adventure 1, since the flag is automatically clicked, for some reason the project plays out fine, but the sounds don't start unless you actually click on the project.
TurboWarp can't do anything about it; it's a limitation. The easiest solution for this--and it's something most of everyone here on NG has been doing for a long time now--is to simply just program a screen to show up first before anything at all. And when you click it, it quickly goes away, and the game begins as normal.
A black screen that just has "click screen to start" does the job. Please don't do anything fancy, like have waiting music playing or something, because that just defeats the whole purpose.
CHAPTER 3.2 - MY EYES / TURBOWARP DARK MODE THEME
One other reason I switched to TurboWarp: dark mode! But, yikes, these default colors are honestly still too bright.
Worry not. Here's a solution.
- Copy all this lmao https://pastebin.com/NTthGBhZ paste it into Notepad or something
- Save it as a .json file
- On TurboWarp, open Addons, scroll to very bottom, click "Import settings".
- Import that .json file baby
CONCLUSION
In the end, it's the game itself that matters.
The stuff above are all just enhance the experience, especially if you're bringing said experience to Newgrounds. If it sucks, it sucks, no medals or gamepad support can save that.
It all returns to nothing.
s-zenmode
i actually know all of this but in the latest packager, Newgrounds.io never works (1.0.0 tw packager). I have to use the old 0.7.0 packager from April (that is how I made Dux TD, and now Tankmen SOS.)