Discuss Scratch
- SDFTDusername
- Scratcher
42 posts
need help with a mod!
i need help with a few things for a mod and i would appreciate it if you can help with one of the things.
1. can i edit scratch-vm inside the node_modules folder of scratch-gui with only scratch-blocks linked? (scratch-blocks wont build if scratch-vm is also linked)
1. how do i set the position of a variable and list monitor via blocks? (like set variable pos to x: 0 y: 0)
2. how do i set the type of a variable monitor via blocks? (like set type to normal readout, large readout and slider) and how do i set the slider min and max? like (set min: 1 max: 10)
3. how do i set the size of a list monitor via blocks? (like set list size to width: 10 height: 10)
4. when i make a custom extension and use it, it wont load when i try loading the project with that extension in the mod (says cannot be loaded). why?
5. how do i set turbo mode via blocks? (like set turbo mode )
6. how do i put custom variables like camera x and camera y in extensions? (in extensions theres tempo and pen color and it gets saved to project.json)
7. how do i make local variables/lists blocks like this: using (a) (b) © { }
8. how do i make return blocks? (my blocks that returns values without having to make a return variable)
9. how to insert a pre-defined block via a button on the my blocks category?
10. how to i get the number of sounds playing in a sprite? (like (number of sounds playing))
11. how do i make a draw triangle pen block? (like draw triangle -10 0, 0 10, 10 0)
completed:
1. how do i get turbo mode via blocks? (like <is turbo mode on?>)
2. how do i convert a list to json? (like (convert list to json))
thats all i need help with.
1. can i edit scratch-vm inside the node_modules folder of scratch-gui with only scratch-blocks linked? (scratch-blocks wont build if scratch-vm is also linked)
1. how do i set the position of a variable and list monitor via blocks? (like set variable pos to x: 0 y: 0)
2. how do i set the type of a variable monitor via blocks? (like set type to normal readout, large readout and slider) and how do i set the slider min and max? like (set min: 1 max: 10)
3. how do i set the size of a list monitor via blocks? (like set list size to width: 10 height: 10)
4. when i make a custom extension and use it, it wont load when i try loading the project with that extension in the mod (says cannot be loaded). why?
5. how do i set turbo mode via blocks? (like set turbo mode )
6. how do i put custom variables like camera x and camera y in extensions? (in extensions theres tempo and pen color and it gets saved to project.json)
7. how do i make local variables/lists blocks like this: using (a) (b) © { }
8. how do i make return blocks? (my blocks that returns values without having to make a return variable)
9. how to insert a pre-defined block via a button on the my blocks category?
10. how to i get the number of sounds playing in a sprite? (like (number of sounds playing))
11. how do i make a draw triangle pen block? (like draw triangle -10 0, 0 10, 10 0)
completed:
1. how do i get turbo mode via blocks? (like <is turbo mode on?>)
2. how do i convert a list to json? (like (convert list to json))
thats all i need help with.
Last edited by SDFTDusername (Jan. 16, 2022 20:18:52)
Scratch mod
https://scratchmod.netlify.app/ - the Scratch mod with many blocks and stuff
soon it will change into a TurboWarp mod with even more blocks and stuff
scroll down for more info!
plans:
189 new blocks
6 new features
4 useful changes
3 new extensions
50 new extension blocks
development:
0/2 ready up the mod: setup and test (0%)
0/189 new blocks done (0%)
0/6 new features done (0%)
0/4 useful changes done (0%)
0/3 new extensions done (0%)
0/50 new extension blocks done (0%)
total: 0/250 (0%)
- god286
- Scratcher
1000+ posts
need help with a mod!
I am not sure but I think lists are stored as JSON in the project.json file 8. how do i convert a list to json? (like (convert list to json))
They're exactly the same as arrays
Last edited by god286 (Jan. 6, 2022 09:29:51)
Here are some of my followers!
I joined: 5 years, 9 months, 24 days ago (31/03/2018)
I have: 479 followers
In total, I have attained: 1,403 loves, 1,145 favourites, and 33,731 views.
Fun Fact: If my account continued to gain followers at a similar rate to right now, in 14,210 years I would reach the number of followers griffpatch has today! Try to imagine how many followers he would have then!
Thank you everyone!
Script created by god286.
- Maximouse
- Scratcher
1000+ posts
need help with a mod!
Don't change the contents of node_modules – it will be overwritten when running npm install again (for example if new dependencies are added). What exactly is the problem with using npm link for both scratch-vm and scratch-blocks? 1. can i edit scratch-vm inside the node_modules folder of scratch-gui with only scratch-blocks linked? (scratch-blocks wont build if scratch-vm is also linked)
- SDFTDusername
- Scratcher
42 posts
need help with a mod!
when i link scratch-vm and scratch-blocks to scratch-gui, scratch-gui and scratch-vm will build but scratch-blocks wont and doesn't change anything (i did try installing dev scratch-blocks in scratch-blocks and it did give no errors but still appeared as a red hat block)Don't change the contents of node_modules – it will be overwritten when running npm install again (for example if new dependencies are added). What exactly is the problem with using npm link for both scratch-vm and scratch-blocks? 1. can i edit scratch-vm inside the node_modules folder of scratch-gui with only scratch-blocks linked? (scratch-blocks wont build if scratch-vm is also linked)
Scratch mod
https://scratchmod.netlify.app/ - the Scratch mod with many blocks and stuff
soon it will change into a TurboWarp mod with even more blocks and stuff
scroll down for more info!
plans:
189 new blocks
6 new features
4 useful changes
3 new extensions
50 new extension blocks
development:
0/2 ready up the mod: setup and test (0%)
0/189 new blocks done (0%)
0/6 new features done (0%)
0/4 useful changes done (0%)
0/3 new extensions done (0%)
0/50 new extension blocks done (0%)
total: 0/250 (0%)
- SDFTDusername
- Scratcher
42 posts
need help with a mod!
s
so just JSON.stringify(args.list)?I am not sure but I think lists are stored as JSON in the project.json file 8. how do i convert a list to json? (like (convert list to json))
They're exactly the same as arrays
Scratch mod
https://scratchmod.netlify.app/ - the Scratch mod with many blocks and stuff
soon it will change into a TurboWarp mod with even more blocks and stuff
scroll down for more info!
plans:
189 new blocks
6 new features
4 useful changes
3 new extensions
50 new extension blocks
development:
0/2 ready up the mod: setup and test (0%)
0/189 new blocks done (0%)
0/6 new features done (0%)
0/4 useful changes done (0%)
0/3 new extensions done (0%)
0/50 new extension blocks done (0%)
total: 0/250 (0%)
- Maximouse
- Scratcher
1000+ posts
need help with a mod!
I think you can use 2. how do i set the position of a variable and list monitor via blocks? (like set variable pos to x: 0 y: 0)
util.runtime.requestUpdateMonitor({ id, x, y });
3. how do i set the type of a variable monitor via blocks? (like set type to normal readout, large readout and slider) and how do i set the slider min and max? like (set min: 1 max: 10)
util.runtime.requestUpdateMonitor({ id, mode: "default" }); util.runtime.requestUpdateMonitor({ id, mode: "large" }); util.runtime.requestUpdateMonitor({ id, mode: "slider" });
4. how do i set the size of a list monitor via blocks? (like set list size to width: 10 height: 10)
util.runtime.requestUpdateMonitor({ id, width, height });
- SDFTDusername
- Scratcher
42 posts
need help with a mod!
will updating pos with list also work?I think you can use 2. how do i set the position of a variable and list monitor via blocks? (like set variable pos to x: 0 y: 0)util.runtime.requestUpdateMonitor({ id, x, y });3. how do i set the type of a variable monitor via blocks? (like set type to normal readout, large readout and slider) and how do i set the slider min and max? like (set min: 1 max: 10)util.runtime.requestUpdateMonitor({ id, mode: "default" }); util.runtime.requestUpdateMonitor({ id, mode: "large" }); util.runtime.requestUpdateMonitor({ id, mode: "slider" });4. how do i set the size of a list monitor via blocks? (like set list size to width: 10 height: 10)util.runtime.requestUpdateMonitor({ id, width, height });
Scratch mod
https://scratchmod.netlify.app/ - the Scratch mod with many blocks and stuff
soon it will change into a TurboWarp mod with even more blocks and stuff
scroll down for more info!
plans:
189 new blocks
6 new features
4 useful changes
3 new extensions
50 new extension blocks
development:
0/2 ready up the mod: setup and test (0%)
0/189 new blocks done (0%)
0/6 new features done (0%)
0/4 useful changes done (0%)
0/3 new extensions done (0%)
0/50 new extension blocks done (0%)
total: 0/250 (0%)
- Maximouse
- Scratcher
1000+ posts
need help with a mod!
Positions of list and variable monitors work the same way. will updating pos with list also work?
Last edited by Maximouse (Jan. 6, 2022 12:57:43)
- Maximouse
- Scratcher
1000+ posts
need help with a mod!
You need to manually run when i link scratch-vm and scratch-blocks to scratch-gui, scratch-gui and scratch-vm will build but scratch-blocks wont and doesn't change anything (i did try installing dev scratch-blocks in scratch-blocks and it did give no errors but still appeared as a red hat block)npm run prepublish and npm run translate (you might need to run the second command twice to prevent red hat blocks) after making changes to scratch-blocks.
The implementation of the list reporter (scratch-vm/src/blocks/scratch3_data.js, line 93) usesso just JSON.stringify(args.list)?I am not sure but I think lists are stored as JSON in the project.json file 8. how do i convert a list to json? (like (convert list to json))
They're exactly the same as arrays
const list = util.target.lookupOrCreateList(args.LIST.id, args.LIST.name);
- SDFTDusername
- Scratcher
42 posts
need help with a mod!
i tried doing that but didnt work, i also tried doing sudo npm install and using WSLYou need to manually run when i link scratch-vm and scratch-blocks to scratch-gui, scratch-gui and scratch-vm will build but scratch-blocks wont and doesn't change anything (i did try installing dev scratch-blocks in scratch-blocks and it did give no errors but still appeared as a red hat block)npm run prepublish and npm run translate (you might need to run the second command twice to prevent red hat blocks) after making changes to scratch-blocks..
Scratch mod
https://scratchmod.netlify.app/ - the Scratch mod with many blocks and stuff
soon it will change into a TurboWarp mod with even more blocks and stuff
scroll down for more info!
plans:
189 new blocks
6 new features
4 useful changes
3 new extensions
50 new extension blocks
development:
0/2 ready up the mod: setup and test (0%)
0/189 new blocks done (0%)
0/6 new features done (0%)
0/4 useful changes done (0%)
0/3 new extensions done (0%)
0/50 new extension blocks done (0%)
total: 0/250 (0%)
- SDFTDusername
- Scratcher
42 posts
need help with a mod!
got this error and dont know what to doI think you can use 2. how do i set the position of a variable and list monitor via blocks? (like set variable pos to x: 0 y: 0)util.runtime.requestUpdateMonitor({ id, x, y });
ERROR in ./node_modules/scratch-vm/src/blocks/scratch3_data.js
Module build failed (from ./node_modules/babel-loader/lib/index.js):
SyntaxError: /mnt/c/Users/Gebruiker/Downloads/scratch-mods/mod/scratch-gui/node_modules/scratch-vm/src/blocks/scratch3_data.js: Unexpected token, expected “,” (98:41)
96 |
97 | setVariablePositionTo (args) {
> 98 | util.runtime.requestUpdateMonitor({args.VARIABLE.id, args.X, args.Y });
| ^
99 | }
Last edited by SDFTDusername (Jan. 6, 2022 13:16:56)
Scratch mod
https://scratchmod.netlify.app/ - the Scratch mod with many blocks and stuff
soon it will change into a TurboWarp mod with even more blocks and stuff
scroll down for more info!
plans:
189 new blocks
6 new features
4 useful changes
3 new extensions
50 new extension blocks
development:
0/2 ready up the mod: setup and test (0%)
0/189 new blocks done (0%)
0/6 new features done (0%)
0/4 useful changes done (0%)
0/3 new extensions done (0%)
0/50 new extension blocks done (0%)
total: 0/250 (0%)
- Maximouse
- Scratcher
1000+ posts
need help with a mod!
got this error and dont know what to doI think you can use 2. how do i set the position of a variable and list monitor via blocks? (like set variable pos to x: 0 y: 0)util.runtime.requestUpdateMonitor({ id, x, y });
ERROR in ./node_modules/scratch-vm/src/blocks/scratch3_data.js
Module build failed (from ./node_modules/babel-loader/lib/index.js):
SyntaxError: /mnt/c/Users/Gebruiker/Downloads/scratch-mods/mod/scratch-gui/node_modules/scratch-vm/src/blocks/scratch3_data.js: Unexpected token, expected “,” (98:41)
96 |
97 | setVariablePositionTo (args) {
> 98 | util.runtime.requestUpdateMonitor({args.VARIABLE.id, args.X, args.Y });
| ^
99 | }
{id: args.VARIABLE.id, x: args.X, y: args.Y }
- SDFTDusername
- Scratcher
42 posts
need help with a mod!
it doesn't seem to do any errors on build but when i test the block this error happens:got this error and dont know what to doI think you can use 2. how do i set the position of a variable and list monitor via blocks? (like set variable pos to x: 0 y: 0)util.runtime.requestUpdateMonitor({ id, x, y });
ERROR in ./node_modules/scratch-vm/src/blocks/scratch3_data.js
Module build failed (from ./node_modules/babel-loader/lib/index.js):
SyntaxError: /mnt/c/Users/Gebruiker/Downloads/scratch-mods/mod/scratch-gui/node_modules/scratch-vm/src/blocks/scratch3_data.js: Unexpected token, expected “,” (98:41)
96 |
97 | setVariablePositionTo (args) {
> 98 | util.runtime.requestUpdateMonitor({args.VARIABLE.id, args.X, args.Y });
| ^
99 | }is the right syntax for the object in this case.{id: args.VARIABLE.id, x: args.X, y: args.Y }
Uncaught TypeError: monitor.get is not a function
at Runtime.requestUpdateMonitor (lib.min.js:304234:24)
at Scratch3DataBlocks.setVariablePositionTo (lib.min.js:295190:20)
at execute (lib.min.js:301331:34)
at Sequencer.stepThread (lib.min.js:305297:11)
at Sequencer.stepThreads (lib.min.js:305203:18)
at Runtime._step (lib.min.js:303919:40)
at lib.min.js:304573:16
Scratch mod
https://scratchmod.netlify.app/ - the Scratch mod with many blocks and stuff
soon it will change into a TurboWarp mod with even more blocks and stuff
scroll down for more info!
plans:
189 new blocks
6 new features
4 useful changes
3 new extensions
50 new extension blocks
development:
0/2 ready up the mod: setup and test (0%)
0/189 new blocks done (0%)
0/6 new features done (0%)
0/4 useful changes done (0%)
0/3 new extensions done (0%)
0/50 new extension blocks done (0%)
total: 0/250 (0%)
- Maximouse
- Scratcher
1000+ posts
need help with a mod!
Looks like the function excepts a Map.it doesn't seem to do any errors on build but when i test the block this error happens:is the right syntax for the object in this case.{id: args.VARIABLE.id, x: args.X, y: args.Y }
Uncaught TypeError: monitor.get is not a function
at Runtime.requestUpdateMonitor (lib.min.js:304234:24)
at Scratch3DataBlocks.setVariablePositionTo (lib.min.js:295190:20)
at execute (lib.min.js:301331:34)
at Sequencer.stepThread (lib.min.js:305297:11)
at Sequencer.stepThreads (lib.min.js:305203:18)
at Runtime._step (lib.min.js:303919:40)
at lib.min.js:304573:16
new Map({id: args.VARIABLE.id, x: args.X, y: args.Y })
- SDFTDusername
- Scratcher
42 posts
need help with a mod!
i tried this codeLooks like the function excepts a Map.it doesn't seem to do any errors on build but when i test the block this error happens:is the right syntax for the object in this case.{id: args.VARIABLE.id, x: args.X, y: args.Y }
Uncaught TypeError: monitor.get is not a function
at Runtime.requestUpdateMonitor (lib.min.js:304234:24)
at Scratch3DataBlocks.setVariablePositionTo (lib.min.js:295190:20)
at execute (lib.min.js:301331:34)
at Sequencer.stepThread (lib.min.js:305297:11)
at Sequencer.stepThreads (lib.min.js:305203:18)
at Runtime._step (lib.min.js:303919:40)
at lib.min.js:304573:16new Map({id: args.VARIABLE.id, x: args.X, y: args.Y })
this.runtime.requestUpdateMonitor(new Map({id: args.VARIABLE.id, x: args.X, y: args.Y }));
Uncaught TypeError: object is not iterable (cannot read property Symbol(Symbol.iterator))
at new Map (<anonymous>)
at Scratch3DataBlocks.setVariablePositionTo (lib.min.js:295190:41)
at execute (lib.min.js:301331:34)
at Sequencer.stepThread (lib.min.js:305297:11)
at Sequencer.stepThreads (lib.min.js:305203:18)
at Runtime._step (lib.min.js:303919:40)
at lib.min.js:304573:16
Last edited by SDFTDusername (Jan. 6, 2022 14:35:11)
Scratch mod
https://scratchmod.netlify.app/ - the Scratch mod with many blocks and stuff
soon it will change into a TurboWarp mod with even more blocks and stuff
scroll down for more info!
plans:
189 new blocks
6 new features
4 useful changes
3 new extensions
50 new extension blocks
development:
0/2 ready up the mod: setup and test (0%)
0/189 new blocks done (0%)
0/6 new features done (0%)
0/4 useful changes done (0%)
0/3 new extensions done (0%)
0/50 new extension blocks done (0%)
total: 0/250 (0%)
- Maximouse
- Scratcher
1000+ posts
need help with a mod!
I think Map needs to be imported from the “immutable” library first. i tried this codebut it returnsthis.runtime.requestUpdateMonitor(new Map({id: args.VARIABLE.id, x: args.X, y: args.Y }));
Uncaught TypeError: object is not iterable (cannot read property Symbol(Symbol.iterator))
at new Map (<anonymous>)
at Scratch3DataBlocks.setVariablePositionTo (lib.min.js:295190:41)
at execute (lib.min.js:301331:34)
at Sequencer.stepThread (lib.min.js:305297:11)
at Sequencer.stepThreads (lib.min.js:305203:18)
at Runtime._step (lib.min.js:303919:40)
at lib.min.js:304573:16
- SDFTDusername
- Scratcher
42 posts
need help with a mod!
not sure what you mean, how do i import the library?I think Map needs to be imported from the “immutable” library first. i tried this codebut it returnsthis.runtime.requestUpdateMonitor(new Map({id: args.VARIABLE.id, x: args.X, y: args.Y }));
Uncaught TypeError: object is not iterable (cannot read property Symbol(Symbol.iterator))
at new Map (<anonymous>)
at Scratch3DataBlocks.setVariablePositionTo (lib.min.js:295190:41)
at execute (lib.min.js:301331:34)
at Sequencer.stepThread (lib.min.js:305297:11)
at Sequencer.stepThreads (lib.min.js:305203:18)
at Runtime._step (lib.min.js:303919:40)
at lib.min.js:304573:16
Scratch mod
https://scratchmod.netlify.app/ - the Scratch mod with many blocks and stuff
soon it will change into a TurboWarp mod with even more blocks and stuff
scroll down for more info!
plans:
189 new blocks
6 new features
4 useful changes
3 new extensions
50 new extension blocks
development:
0/2 ready up the mod: setup and test (0%)
0/189 new blocks done (0%)
0/6 new features done (0%)
0/4 useful changes done (0%)
0/3 new extensions done (0%)
0/50 new extension blocks done (0%)
total: 0/250 (0%)
- Maximouse
- Scratcher
1000+ posts
need help with a mod!
Something like not sure what you mean, how do i import the library?
const {Map} = require("immutable");
this.runtime.requestUpdateMonitor(Map({id: args.VARIABLE.id, x: args.X, y: args.Y }));
- kccuber
- Scratcher
1000+ posts
need help with a mod!
maximouse, they are editing the scratch vm in node_modules which may be the issue
- SDFTDusername
- Scratcher
42 posts
need help with a mod!
it does seem to work and do no errors but when testing block it still doesn't do anything, no errors on runtime and buildSomething like not sure what you mean, how do i import the library?at the top of the file, then use it like this:const {Map} = require("immutable");this.runtime.requestUpdateMonitor(Map({id: args.VARIABLE.id, x: args.X, y: args.Y }));
i have put
const {Map} = require("immutable");
const Cast = require('../util/cast');
Last edited by SDFTDusername (Jan. 7, 2022 09:07:14)
Scratch mod
https://scratchmod.netlify.app/ - the Scratch mod with many blocks and stuff
soon it will change into a TurboWarp mod with even more blocks and stuff
scroll down for more info!
plans:
189 new blocks
6 new features
4 useful changes
3 new extensions
50 new extension blocks
development:
0/2 ready up the mod: setup and test (0%)
0/189 new blocks done (0%)
0/6 new features done (0%)
0/4 useful changes done (0%)
0/3 new extensions done (0%)
0/50 new extension blocks done (0%)
total: 0/250 (0%)