Export and import source codes - prove of concept with using automatic keyboard
-
Hi, i have created a video that demonstrates possibility of exporting and importing source codes from Fuze 4 to PC. The concept uses Arduino Pro Micro as an automatic keyboard that cares about everything. If you are interested, have a look :)
-
@sigixxx This is brilliant, superb job, and very entertaining video too :D
The Switch just does USB HID stuff, all it cares about is having characters come over the wire. How those characters are generated, it doesn't care! So, put a little computer like an Arduino on the other side in lieu of a keyboard, write a little Python program or whatever, and viola. Fantastic idea!
The only part I'm not quite following is how you're generating the image. I suppose you figured out how to generate one of these "QR code on steroids" images in Fuze, and then your Arduino program just sends that encoding code to the Fuze editor, wrapping the target source in quotes like you show?
-
Yes, when you press the button on my A-keyboard module, it starts sending several key presses. Firstly it press double HOME in order to move cursor to the begining of the game code. Then it press Ctrl+H in order to pop up a replace dialog. Then it fills this dialog with replacing quote character for ^^ characters. Then it types first section of wrapping code (text="\n/[insert source code here]/\n). After that it sends double END in order to move to the end of the game code and pres the ending quote for 'text' variable and starts typing the second part of the wrapping code.
The wrapping code that the A-Keyboard is typing automatically when the button is pressed is as follows:text = "\n/*[insert source code here]*/\n" clear() setmode(1280, 720) ln = len(text) x = 0 y = 0 for i = 0 to ln loop box(x, y, 2, 2, red, false) x = x + 2 for ii = 0 to 8 loop if (chrVal(text[i]) & (1 << ii)) then box(x, y, 2, 2, white, false) endif x = x + 2 repeat if (x > 1200) then box(x, y, 2, 2,lime, false) x = 0 y = y + 2 update() endif repeat cursor(1, 25) print("[Completed] ", ln, " B \n") update() loop update() repeat
-
I would just like to add a very fundamental correction however to the whole "issue" with Fuze code not being possible to be backed up and not existing outside of the Switch itself. This is simply not true and false information. Your projects, including source code and all assets can be backed up to the Fuze servers by simply sharing / publishing your projects. Once on the Fuze servers anyone with the ID can then download them. We've even ensured that you don't have to have Nintendo online to do this.
Now, granted, I understand that this isn't the same as having your code in an editor on your PC or being able to put it on GitHub or anything like that. But it's the best option we have whilst still staying within the restrictions of the Nintendo platform.
@sigixxx I've not had time to watch the entirety of your video as yet but if you don't make this clear then I would appreciate it if you modify your video to make it clear, otherwise anyone seeing your video who has not bought Fuze may think there is no way to backup your code outside of your personal Switch which is simply not true. Many thanks.
[EDIT] Sorry, if that comes across a bit harsh, I don't mean it to - but I would hate for people to think that it's not possible for your code to be safely backed up to the Fuze servers in the event of a Switch failure.
-
@sigixxx Thanks for posting this, superb!
Technically, the Fuze team could implement import and export based on "source encoded as images" right in the user interface-- like what you're doing, except copying screenshots back and forth between PC and Switch would be manual. However, I think they are legally hamstrung by Nintendo edicts.
I took your video as "code can't be backed up outside of the Fuze ecosystem", but maybe that's just because I know better. I'd add a quick clarification to your video, as Martin is voluntelling you to do :D -- people who haven't used the Fuze product won't understand the nuance.
-
What an awesome video! @sigixxx, you really made me laugh out loud. Aside from it being a great idea and very clever indeed, you obviously have many talents!
ps. please check email.