Discuss Scratch
- Discussion Forums
- » Advanced Topics
- » [v1.1-beta] sb3topy: Scratch to Python with Pygame
- bloctans_4
- Scratcher
1000+ posts
[v1.1-beta] sb3topy: Scratch to Python with Pygame
wellhttps://scratch.mit.edu/projects/659120206/ through the converter, and the results are:Hmm, yeah that seems like a stress test of the asset conversion. so as a performance test i ran
the converting assets stage used up all my cpu
the actual project used all my memory
the project cant run in 1920x1080https://assets.scratch.mit.edu/get_image/.%2E/38373c8c5c08f9f4e7ae8b90e6e2dc40.pngNot necessarily… The colors are probably not too hard to fix. The positioning might be a bit harder though.
i feel like this would be too hard to fixIt looks like the username block is broken. I'm not sure how that missed testing. It's an easy fix though. another error with griffpatches gd: ERROR:root:Error in gathered task ‘<Task finished name=’Task-143' coro=<Spritemenu.broadcast_menuin1() done, defined at D:\sb3topy-1.1-beta\sb3topy-1.1-beta\outputs\project.py:2883> exception=NameError(“name ‘co nfig’ is not defined”)>'
Traceback (most recent call last):
File “D:\sb3topy-1.1-beta\sb3topy-1.1-beta\outputs\engine\util.py”, line 170, in _handle_tasks
task.result()
File “D:\sb3topy-1.1-beta\sb3topy-1.1-beta\outputs\project.py”, line 2898, in broadcast_menuin1
await util.sprites.broadcast_getrank(util)
File “D:\sb3topy-1.1-beta\sb3topy-1.1-beta\outputs\project.py”, line 3377, in broadcast_getrank
await self.my_TexttoNumber(util, config.USERNAME)
NameError: name ‘config’ is not definedhttps://assets.scratch.mit.edu/get_image/.%2E/2129bf83add22918656df9391f6e092d.pngFix what?
how did you fix this?
1. ok
2. seems reasonable
3. ok
4. what im talking about is how the rotation is done, it feels too, weird.
also another issue is that the sprite goes a few pixels forward or back when rotating for my vm
- ZZC12345
- Scratcher
500+ posts
[v1.1-beta] sb3topy: Scratch to Python with Pygame
Like the error?
this is weird
If you're talking about the json, that's a Scratch Block.
- imfh
- Scratcher
1000+ posts
[v1.1-beta] sb3topy: Scratch to Python with Pygame
Is that error related to this project? I don’t think so since it is JavaScript.
this is weird
That is a weird error though. Those are not valid inputs/fields for a motion_gotoxy block, which expects two inputs, “X” and “Y,” and no fields. Was the project converted from Scratch 2 to Scratch 3?
- bloctans_4
- Scratcher
1000+ posts
[v1.1-beta] sb3topy: Scratch to Python with Pygame
this is another vm im working onIs that error related to this project? I don’t think so since it is JavaScript.
this is weird
That is a weird error though. Those are not valid inputs/fields for a motion_gotoxy block, which expects two inputs, “X” and “Y,” and no fields. Was the project converted from Scratch 2 to Scratch 3?
also no, it wasnt converted, the code for that block (jn scratch) is:
go to x: (0) y: (0)heres the surrounding blocks:
edit 1: also i wish i was able to talk to people that knew about block parsing outside of this forum inside of another topic or something
but i rarely get any responses
edit 2: just tested with your converter and the project works fine, unless it skips blocks it cant parse
Last edited by bloctans_4 (Aug. 25, 2022 15:22:51)
- bloctans_4
- Scratcher
1000+ posts
[v1.1-beta] sb3topy: Scratch to Python with Pygame
ok i just found the issue
apparently its acting like setvar block is the gotoxy block
apparently its acting like setvar block is the gotoxy block
- bloctans_4
- Scratcher
1000+ posts
[v1.1-beta] sb3topy: Scratch to Python with Pygame
the top is the proper one, the other is the set var block, what makes this happen?
- bloctans_4
- Scratcher
1000+ posts
[v1.1-beta] sb3topy: Scratch to Python with Pygame
another edit, it turns out the actual json has the issue with the blocks
- ZZC12345
- Scratcher
500+ posts
[v1.1-beta] sb3topy: Scratch to Python with Pygame
I learned a lot about Scratch Block parsing from this repo.this is another vm im working onIs that error related to this project? I don’t think so since it is JavaScript.
this is weird
That is a weird error though. Those are not valid inputs/fields for a motion_gotoxy block, which expects two inputs, “X” and “Y,” and no fields. Was the project converted from Scratch 2 to Scratch 3?
also no, it wasnt converted, the code for that block (jn scratch) is:go to x: (0) y: (0)heres the surrounding blocks:
edit 1: also i wish i was able to talk to people that knew about block parsing outside of this forum inside of another topic or something
but i rarely get any responses
edit 2: just tested with your converter and the project works fine, unless it skips blocks it cant parse
- bloctans_4
- Scratcher
1000+ posts
[v1.1-beta] sb3topy: Scratch to Python with Pygame
doesnt really help, the json file is the issue hereI learned a lot about Scratch Block parsing from this repo.this is another vm im working onIs that error related to this project? I don’t think so since it is JavaScript.
this is weird
That is a weird error though. Those are not valid inputs/fields for a motion_gotoxy block, which expects two inputs, “X” and “Y,” and no fields. Was the project converted from Scratch 2 to Scratch 3?
also no, it wasnt converted, the code for that block (jn scratch) is:go to x: (0) y: (0)heres the surrounding blocks:
edit 1: also i wish i was able to talk to people that knew about block parsing outside of this forum inside of another topic or something
but i rarely get any responses
edit 2: just tested with your converter and the project works fine, unless it skips blocks it cant parse
- ZZC12345
- Scratcher
500+ posts
[v1.1-beta] sb3topy: Scratch to Python with Pygame
No, that library parses the blocks dictionary (or JavaScript object? lol) inside the JSON file. I read through the library to learn about how the blocks were structured, then wrote my own parser.doesnt really help, the json file is the issue hereI learned a lot about Scratch Block parsing from ~snip~this repo.
this is another vm im working on
also no, it wasnt converted, the code for that block (jn scratch) is:go to x: (0) y: (0)heres the surrounding blocks: ~snip~
edit 1: also i wish i was able to talk to people that knew about block parsing outside of this forum inside of another topic or something
but i rarely get any responses
edit 2: just tested with your converter and the project works fine, unless it skips blocks it cant parse
- bloctans_4
- Scratcher
1000+ posts
[v1.1-beta] sb3topy: Scratch to Python with Pygame
yeah, my parser checks for the opcode, and reads the inputs based on that opcode, some of the inputs for some reason use inputs from another block, like a set var blockNo, that library parses the blocks dictionary (or JavaScript object? lol) inside the JSON file. I read through the library to learn about how the blocks were structured, then wrote my own parser.doesnt really help, the json file is the issue hereI learned a lot about Scratch Block parsing from ~snip~this repo.
this is another vm im working on
also no, it wasnt converted, the code for that block (jn scratch) is:go to x: (0) y: (0)heres the surrounding blocks: ~snip~
edit 1: also i wish i was able to talk to people that knew about block parsing outside of this forum inside of another topic or something
but i rarely get any responses
edit 2: just tested with your converter and the project works fine, unless it skips blocks it cant parse
Last edited by bloctans_4 (Aug. 28, 2022 15:01:28)
- bloctans_4
- Scratcher
1000+ posts
[v1.1-beta] sb3topy: Scratch to Python with Pygame
turns out that that doesnt mean anything
i now have trust issues with json.parse
i now have trust issues with json.parse
- Keaton42
- Scratcher
34 posts
[v1.1-beta] sb3topy: Scratch to Python with Pygame
I've started on Lua and Python about a month ago and it's been pretty fun, I wanna make a decent game soon, my only goals are to make people happy and have fun making the game.
- bloctans_4
- Scratcher
1000+ posts
[v1.1-beta] sb3topy: Scratch to Python with Pygame
off topic. I've started on Lua and Python about a month ago and it's been pretty fun, I wanna make a decent game soon, my only goals are to make people happy and have fun making the game.
- IAMATP
- Scratcher
79 posts
[v1.1-beta] sb3topy: Scratch to Python with Pygame
You can use I know this might sound stupid, but I'm 12 (I've already learned java and python; yep I'm a nerd) and I'm on a school Chromebook, is there a way I could use this because python doesn't install on herehttps://www.replit.com
- 5_g
- Scratcher
1000+ posts
[v1.1-beta] sb3topy: Scratch to Python with Pygame
replit is slow in many areasYou can use I know this might sound stupid, but I'm 12 (I've already learned java and python; yep I'm a nerd) and I'm on a school Chromebook, is there a way I could use this because python doesn't install on herehttps://www.replit.com
- bloctans_4
- Scratcher
1000+ posts
[v1.1-beta] sb3topy: Scratch to Python with Pygame
then what do you suggest?replit is slow in many areasYou can use I know this might sound stupid, but I'm 12 (I've already learned java and python; yep I'm a nerd) and I'm on a school Chromebook, is there a way I could use this because python doesn't install on herehttps://www.replit.com
(edited cuz i dont wanna be banned for some stupid joke i made)
Last edited by bloctans_4 (Nov. 2, 2022 17:05:20)
- bloctans_4
- Scratcher
1000+ posts
[v1.1-beta] sb3topy: Scratch to Python with Pygame
(btw the stroke means that im jokingly saying it)then what do you suggest? smart guy?replit is slow in many areasYou can use I know this might sound stupid, but I'm 12 (I've already learned java and python; yep I'm a nerd) and I'm on a school Chromebook, is there a way I could use this because python doesn't install on herehttps://www.replit.com
- Discussion Forums
- » Advanced Topics
- » [v1.1-beta] sb3topy: Scratch to Python with Pygame