Discuss Scratch

JGames101
Scratcher
100+ posts

Guide to Modding Scratch 3.0

MDCCCLXVII wrote:

I get the following error when trying to use the “npm start” command: (I have added a new block already)
Did you use
npm prepublish
or
yarn prepublish
in the scratch-blocks directory? The file it can't find should be generated when you run one of those.
MasterOfGizmo
New to Scratch
20 posts

Guide to Modding Scratch 3.0

I've followed these instructions to setup a custom block and a custom category and would now have to add my own classes to the VM.

But is this really the way to go for a custom set of blocks? It seems most modding like this would actually be an extension like the ones already present in the vm.

I do find some very raw specification for the extension here:
https://github.com/LLK/scratch-vm/wiki/Scratch-3.0-Extensions-Specification. But this is very sparse.

Is there some small “how to” that explains how extensions are to be implemented correctly and what purposes they should be used for? I'd like to add a small set of about ten custom blocks to interact with a custom hardware.
SimpleScratch
Scratcher
500+ posts

Guide to Modding Scratch 3.0

There is no way at present for us to add our own extensions into Scratch 3 - only official ones are allowed

Best method of playing around at them moment is to use @sheep_maker extension setup

https://scratch.mit.edu/discuss/topic/277217/?page=6#post-3445574

You basically make your extension (look at utilities.js to see hwo its done) - host it somewhere and then use its URL like

https://sheeptester.github.io/scratch-gui/?url=yourownurl
MasterOfGizmo
New to Scratch
20 posts

Guide to Modding Scratch 3.0

I can live with the fact that the extensions are somewhat hard coded into the GUI and the VM. I can easily run a local setup with my own extension included and i could even publish that. The question is if that's the right approach in the long term.

Adding support for some hardware is supposed to be done through extensions, even though this short tutorial here tells us how to mod the core, right?
SimpleScratch
Scratcher
500+ posts

Guide to Modding Scratch 3.0

The question is if that's the right approach in the long term.

it all depends on

1. How long it is before Scratch team let us use our own extensions in Scratch 3

2. What restrictions they put in place on what can be included in our extensions

If it takes a long time before extensions are allowed - then worth putting effort into modding instead
MasterOfGizmo
New to Scratch
20 posts

Guide to Modding Scratch 3.0

SimpleScratch wrote:

If it takes a long time before extensions are allowed - then worth putting effort into modding instead

Modding requires you to run your own instance. But if that's ok you can also run your own extensions in your own instance. This is exactly what i am doing now after have played with the modding as described here for a few hours.
samsuffi
Scratcher
19 posts

Guide to Modding Scratch 3.0

JGames101 wrote:

s_federici wrote:

s_federici wrote:

When I run
npm link
I get an error complaining that I have no Python installed. Why do I need Python in order to change Scratch 3 source code? Isn't it just Javascript?
After having installed python (version 2.x; version 3.x apparently DOESN'T work with the Scratch 3 source code) I get the following error when I run “npm link”:

> python build.py && webpack

Traceback (most recent call last):
File “build.py”, line 569, in <module>
test_proc = subprocess.Popen(test_args, stdin=subprocess.PIPE, stdout=subprocess.PIPE)
File “C:\Python27\lib\subprocess.py”, line 394, in __init__
errread, errwrite)
File “C:\Python27\lib\subprocess.py”, line 644, in _execute_child
startupinfo)
WindowsError: Impossibile trovare il file specificato
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! scratch-blocks@0.1.0-prerelease.1540417094 prepublish: `python build.py && webpack`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the scratch-blocks@0.1.0-prerelease.1540417094 prepublish script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\s_fed\AppData\Roaming\npm-cache\_logs\2018-11-01T10_45_46_092Z-debug.log
The new instructions addresses this issue with a workaround. I'm looking into a proper fix. Is it possible for you to run the code in an environment without Java installed? If so, try running the command without java, in which case it uses the web version to compile, which should work successfully. I'm looking into how to make it work without this workaround.
I got the same error, so I:
- Ran the command from the Bash Terminal of git (and the window's terminal)
(Not working)
- Temporarily deactivated Java without uninstalling
(Still not working)
- Uninstalled Java
(Desperately not working)
- Rebooted my PC
(…)
- Raged
(I need to take a break know)
- Sent this message on this forum
(lol, I'm terrible)
What should I do know? X)
JGames101
Scratcher
100+ posts

Guide to Modding Scratch 3.0

samsuffi wrote:

JGames101 wrote:

s_federici wrote:

s_federici wrote:

When I run
npm link
I get an error complaining that I have no Python installed. Why do I need Python in order to change Scratch 3 source code? Isn't it just Javascript?
After having installed python (version 2.x; version 3.x apparently DOESN'T work with the Scratch 3 source code) I get the following error when I run “npm link”:

> python build.py && webpack

Traceback (most recent call last):
File “build.py”, line 569, in <module>
test_proc = subprocess.Popen(test_args, stdin=subprocess.PIPE, stdout=subprocess.PIPE)
File “C:\Python27\lib\subprocess.py”, line 394, in __init__
errread, errwrite)
File “C:\Python27\lib\subprocess.py”, line 644, in _execute_child
startupinfo)
WindowsError: Impossibile trovare il file specificato
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! scratch-blocks@0.1.0-prerelease.1540417094 prepublish: `python build.py && webpack`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the scratch-blocks@0.1.0-prerelease.1540417094 prepublish script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\s_fed\AppData\Roaming\npm-cache\_logs\2018-11-01T10_45_46_092Z-debug.log
The new instructions addresses this issue with a workaround. I'm looking into a proper fix. Is it possible for you to run the code in an environment without Java installed? If so, try running the command without java, in which case it uses the web version to compile, which should work successfully. I'm looking into how to make it work without this workaround.
I got the same error, so I:
- Ran the command from the Bash Terminal of git (and the window's terminal)
(Not working)
- Temporarily deactivated Java without uninstalling
(Still not working)
- Uninstalled Java
(Desperately not working)
- Rebooted my PC
(…)
- Raged
(I need to take a break know)
- Sent this message on this forum
(lol, I'm terrible)
What should I do know? X)
The python script doesn't work on windows. On my old windows laptop, the only workaround I knew of was running without Java. It might be worth creating an issue on the Scratch-Blocks github to see what they say to do.
eaglemountain95
New to Scratch
2 posts

Guide to Modding Scratch 3.0

I am in the process of modding Scratch and have some questions, I would be thrilled if anyone can answer.

How does the VM connect to the GUI for changes? For example, I want to change the default project when Scratch is started. I managed to change the backdrop in the folder default-project in Scratch-GUI, but not the sprite. Then I found a function called loadProject in scratch-vm/src/virtual-machine.js line 289, but how do I call upon that so it runs?
wilson_li
Scratcher
2 posts

Guide to Modding Scratch 3.0

Great post!
Do you know how the Scratch-GUI save/load the projects created within it? I'd like to host the GUI and projects on my own server, but couldn't find any API documents for every single module of Scratch 3.0.
JGames101
Scratcher
100+ posts

Guide to Modding Scratch 3.0

eaglemountain95 wrote:

I am in the process of modding Scratch and have some questions, I would be thrilled if anyone can answer.

How does the VM connect to the GUI for changes? For example, I want to change the default project when Scratch is started. I managed to change the backdrop in the folder default-project in Scratch-GUI, but not the sprite. Then I found a function called loadProject in scratch-vm/src/virtual-machine.js line 289, but how do I call upon that so it runs?
Scratch-GUI creates an instance of Scratch-VM by importing from its NPM Module. You could find where Scratch-VM is imported and add code there. GitHub has a really useful search feature that makes it easy to find files involved in this.
infinitytec
Scratcher
1000+ posts

Guide to Modding Scratch 3.0

Just fixing the link; don't mind me.


Not here much, but sometimes I lurk.
God has a plan. He has a plan for everything, and everyone.
xxscienceboyxx
Scratcher
100+ posts

Guide to Modding Scratch 3.0

Cool!

~xxscienceboyxx
Maximouse
Scratcher
1000+ posts

Guide to Modding Scratch 3.0

I've just cloned Scratch GUI from Github and tried to run
$ npm install
inside it, it outputs a lot of warnings that say that things are deprecated and
npm ERR! Unexpected end of JSON input while parsing near '...Version: OpenPGP.js v'
How to fix this error?

EDIT: It's fixed now. It looks like something went wrong while cloning the repository.

Last edited by Maximouse (Aug. 19, 2019 13:11:10)



This is Maximouse's signature. Learn more about signatures.
ThegreatestAshley
New to Scratch
100+ posts

Guide to Modding Scratch 3.0

Ooh. I'm so in on this!

CatsUnited wrote:
ThegreatestAshley wrote:
Also, why is it fine for animals to hurt us, but not for us to even consider eating them?
because vegans
PETA makes a nice sandwich! Oh wait, they're not bread?
You eat plants!?!?
Plant liberation! I call it… JustLEGO! Not to be confused with the toy brick.
It stands for just let everything grow organization! Then we can all starve to death and bring about the end of the world! Not to mention, it will look super beautiful when all that stuff just grows! Be sure to tear down buildings and let things grow over them!
It even has a cool icon! Wait… It's copyright infringement to use a Lego… Nevermind, then. The icon is pretty lame. In your face, Team Flare!
Last edited by ThegreatestAshley (Today 10:28:08)
ThegreatestAshley
New to Scratch
100+ posts

Guide to Modding Scratch 3.0

Would this Work on mobile devices?

CatsUnited wrote:
ThegreatestAshley wrote:
Also, why is it fine for animals to hurt us, but not for us to even consider eating them?
because vegans
PETA makes a nice sandwich! Oh wait, they're not bread?
You eat plants!?!?
Plant liberation! I call it… JustLEGO! Not to be confused with the toy brick.
It stands for just let everything grow organization! Then we can all starve to death and bring about the end of the world! Not to mention, it will look super beautiful when all that stuff just grows! Be sure to tear down buildings and let things grow over them!
It even has a cool icon! Wait… It's copyright infringement to use a Lego… Nevermind, then. The icon is pretty lame. In your face, Team Flare!
Last edited by ThegreatestAshley (Today 10:28:08)
infinitytec
Scratcher
1000+ posts

Guide to Modding Scratch 3.0

ThegreatestAshley wrote:

Would this Work on mobile devices?
It would run…

You probably wouldn't want to model it on a mobile device though.


Not here much, but sometimes I lurk.
God has a plan. He has a plan for everything, and everyone.
duongtrancua
New to Scratch
1 post

Guide to Modding Scratch 3.0

hi JGames101.
I'm having trouble matching scratch-blocks and scratch-gui.i used npm start but it messing erro.
Can't you help me.
Thanks!
Sheep_maker
Scratcher
1000+ posts

Guide to Modding Scratch 3.0

duongtrancua wrote:

hi JGames101.
I'm having trouble matching scratch-blocks and scratch-gui.i used npm start but it messing erro.
Can't you help me.
Thanks!
Help us figure out what's wrong by pasting the error message here; you can surround it with [code] and [/code] so it's easier to read, like this:
[code]
Error message here.
[/code]
Perhaps you haven't run `npm install` beforehand?

- Sheep_maker This is a kumquat-free signature. :P
This is my signature. It appears below all my posts. Discuss it on my profile, not the forums. Here's how to make your own.
.postsignature { overflow: auto; } .scratchblocks { overflow-x: auto; overflow-y: hidden; }
joeyer666
Scratcher
32 posts

Guide to Modding Scratch 3.0

can someone make a mod that increases the individual asset limit?

Powered by DjangoBB