00:00
00:00
Dungeonation
Dunk this fool in the milk pool.
Banner by ScepterDPinoy!

Age 23, Cookie Bunny

Joined on 6/23/15

Level:
25
Exp Points:
6,933 / 6,940
Exp Rank:
5,883
Vote Power:
6.72 votes
Audio Scouts
1
Art Scouts
10+
Rank:
Police Officer
Global Rank:
11,867
Blams:
456
Saves:
336
B/P Bonus:
10%
Whistle:
Bronze
Trophies:
17
Medals:
1,373
Supporter:
3y 4m 3d

Scratch to GameMaker conversion WIP

Posted by Dungeonation - December 11th, 2020


It's this guy again! Wanted to talk about what I've been working on. And what I'm working on, is a Python tool that's very daunting but do-able. It's a tool I would have loved to have when I was younger, it's something I'm gonna use for an old games collection, and it's...

iu_207371_5431202.png

When I was around 6 to 7 years old my introduction to game programming was Scratch, an educational tool but powerful coding environment considering it's a buncha blocks you snap together to make things do things. You can make whatever you want within the confines of the program, and Scratch's FAQ states your creations with it are yours to sell or do as you please with. But to bring your work OUTSIDE of the program, you were very limited in functionality and still are. There's a bit of functionality that budding game developers comfortable with Scratch could benefit from...or COULD have benefitted from:

  • Save data for less arcade-style games
  • APIs for Newgrounds and GameJolt (etc), if you so desired
  • Exporting to devices other than PCs
  • [insert things other game dev software can do that Scratch can't]


With Graze, you run your .sb2 Scratch project file through the program and it reads your project's code, moves over the sprites and sounds and basically re-codes the game in GML as a GameMaker Studio 1.4 project file! Upon doing some digging around I found that all the code stored within a Scratch project is just stored in a .JSON file, making this conversion tool STUPIDLY easy. It's just a matter of re-creating each Scratch function in GameMaker from the ground up.

So far, the tool carries over the game's background sprites, and object sprites and sounds are next. Once that's all done it'll just be a matter of doing the re-coding code which I've like, started 1% on already and was the first thing I did. As such, Variables from the scratch project are also carried over, seen here:

(yes I later appended "global." to variables and "var_" to the names so they wouldn't conflict with GameMaker function names)

iu_207372_5431202.png


The tool's origins begin with @Megacharlie attempting to code such a tool in Lua and me immediately being like "zomg I need to see something like this exist". Eventually the project stagnated but once I figured out the JSON and GameMaker metadata heavy lifting, the project was back on and even Charlie's like "sweeeeeet" looking at my progress with it so far. So thanks Charlie, for making this happen.


Once it's finished I guess it'll go up on GitHub so stay tuuuned!


In other news my Flash game (emulated in Ruffle) Face It! got frontpaged on Newgrounds. Oh, and the Henry Stickmin fangame Attacking the Tower I'm coding for is still going well - expect some animation teasers in 2021.


OK time to go play the Friday Night Funkin' update.

-Dungeon <3


Tags:

10

Comments

This is a super cool project!
Also, Graze may be TOO clever of a name ;)

DUDE!!! i've been waiting for ages for something like this

This is cool to see! You're doing all sorts of neat stuff.

Thank you for bringing this idea to life @Megacharlie !!!

Sounds awesome. Now I am probably hyped beyond reasonable reason because I've never actually used Scratch myself, but remember some point when I was playing around with some particular Scratch submission and thinking how it'd be awesome if only this could be converted to a more easily distributable format and say find its way here to NG... and it seems like that'd finally be possible! Potential for a tonna good content by people who've until now possibly be somewhat distanced from these here Grounds to finally make its way here... so yeah this sounds awesome.

Hyped.

There are Scratch-based Newgrounds submissions already with standalone Scratch player tools, but this should hopefully give Scratch games tons more functionality!

I totally don't know enough about this to be speaking on it then huh! XD Maybe that one moment of portability-lacking regret was back when we only accepted Flash files... aaanyway still awesome!

Looking forward to the API integration bit in particular then! Nothing makes a game like medals.

y e s

Stuff like this exists? Time to use yet another thing for my Ultra Sans Fight.

Yeah, I actually have had some trouble with Scratch not being able to handle my massive yet tightly packed projects, it takes long loading, it sometimes has saving errors (as in not being able to save at all) when I import a sound effect, and the frames drop significantly. Would this be better or worse when converted?

Since it'll become a GameMaker game my hope is that it'll run without those issues - just a matter of emulating Scratch functions in GameMaker well.

@Dungeonation Another thing, I cheat a lot with the blocks.
Like using join(enter)and( ) into a key input
Putting blocks in a sprite that would be unavailable to the sprite normally;
(like making a pointtowards make the sprite's clones point towards the same sprite, which isn't available on the dropbox)
The relationship between clones and broadcasts. They both are my biggest concern.
Fun fact; broadcasts affect the clones, too.
Deletethisclone block would end the script, so I use a if 1 == 1 then delete this clone, it makes
the true sprite (the original non-clone) steer around that dead end. helps separate the clones
from the original without using costumes.

Nice knowing this! I use Scratch sometimes and I REALLY want all these features, but now they are all here! Very cool!

I love everything that this has, Scratch to GMS, the name holy shit "Graze". This is so poggers of you!

How is this possible!?

Scratch project reverse engineering

I'm still thinking about this. I don't even have gamemaker, but this idea is so cool. I want to redesign the GRAZE logo sometime.

It’s designed around the Scratch logo’s font but I’d be interested to see what you come up with

@CJspellsfish @Dungeonation I'm going to try to keep the scratch style, but make it different enough

cool

great
i need one for clickteam fusion