Add the ability to share custom blocks across all scenes

With the new scenes in snap, you can now make multiple levels of a game in different scenes, which is great. The big problem is, you can't share scripts across scenes in a user friendly way. This is really bad since if you are making a big game with lots of levels, you have to copy the same scripts for each level. This can really, and I mean, really really make the file size unnecessarily large. This could be fixed by adding super global custom blocks that can be used in all the scenes. This could also add an easier way to share values across scenes, like, lives, and powerups.

Technically you can share rings, so it's able to be worked around. But I kind of do want this feature.

Interesting idea. We'll see what Jens thinks.

I did say

meaning, yes, I know about that way, it's just not very ideal.

What? No! You can't "share" anything - at least that's the intention, you can only transmit values, not share references among scenes. The idea is not to have another super-scope but to ensure modularity on the scene-level, and let scenes communicate the way nodes in the internet do.

So scenes are meant to be what I would call "modules"? (Python terminology)

What I meant was what you mean by "transmit values". Rings are values!

But that's not what the OP asked for.

P.S. But eventually we'll have the ability to make custom blocks programmatically, and then you'll be able to send block definitions as messages. :~) See Jens's reply.

Well, did you try sending a ring to another scene yourself? Or did you just claim it's possible? I've made it so you can only send text, numbers and Booleans. If you manage to send anything else, it's a bug. But I would appreciate if instead of speculating over what's possible folks would try something before instructing others about it.

Oh. It's still possible, though. (codification + user-made reverse codification)

Ach, this is why I dislike the forums. This doesn't share anything, it copies. It's sad how discussions that could be instructive are turning into show-off competitions.

why tho, isnt snap supposed to be so data can all be first class, I mean I would expect I could put anything in any slot If I wanted because snap is supposed to have support for that, I thought you could send a message, and it has data attached to it, but I guess that is not the case, would have been cool tho, because thats kinda how ine internet works btw, packets have like headers or smth, and then values, I know this isnt gonna get added cus 7 just released, but it would have been cool, the other thing I thought could happen was a "When switched to this scene block" with an upvar called data, kinda like the "when I recieve any message" block, and it would only trigger when the scene switches, and any data can be sent, but I guess thats not the case either tho, too late now,

srry for all spelling mistakes im on the bus rn and it is bouncing me when I try to type

One of the ideas behind scenes is to let folks collaborate by contributing levels to a game, chapters to a book, songs to an album and the like. For this we'd love to let each contributor develop their own part as a stand-alone project, so they can play with it and test it out themselves on their own computer. If we introduce another overarching scope of shared resources scenes won't work by themselves anymore, and we'd loose the ability to collaborate in this way. Yes, an individual programmers who "owns" all the scenes in a project would have a more powerful tool, but a group of friends undertaking to create something together would find it much harder.

Another point to think about is what is there to learn from yet another level of scope? You already know about global, sprite-local and script-local scope, and you can even nest more levels of scope inside rings. Scope is a powerful idea, but slogans like "everything first-class" work best inside a clearly defined environment. When you scale up to worlds / networks etc. having everything more or less directly connected to everything else can be extremely limiting, because you need to consider the possible side-effects of every change and every name etc. One way to deal with complexity is to define modules that encapsulate things deeply connected to each other and have very few links on their "outside". Think about a biological cell, a family, objects on your table, countries, continents, computers in the internet.

I understand that what we have right now is a minimalistic implementation, but it really is everything you need to have full control both over the data flow and the flow of control among scenes. Also notice that a powerful way to reuse blocks and scripts in more than one scene is by exporting and importing them as sprites. As we continue to explore multi-scene projects we'll probably add more shortcuts and maybe also other mechanisms of communication. In the meantime we're really curious what you'll do with the new possibilities!

Yeah, I see how chapters to a book, and songs to an album don't need to share data, but what about the game engine? What if you have a very large game engine that you want for every single level? You want to define the engine in one place but if you can't share custom blocks with other scenes it makes editing the engine a little harder because then you need to edit the same script in every single scene which takes a lot of time and also makes the file size unnecessarily large.

Sorry if this doesn't make sense I'm typing this on an ipad, and my back hurts. I would say more, but...

Well, how would you design a multi-player online game? You don't share state among the clients, you synchronize it. Your "game engine" can be a library and / or a (set of) sprite(s) present in every scene that needs it (some won't, for sure), and they pass the game state on. Scenes don't run at the same time, there's only ever one scene after another. You can create your own message protocol now that v7 lets you send lists including nested lists of data. This lets you keep track of things like score, health, an inventory of collected goods etc. Your friends and you are going to design which things are going to be passed on among which scenes and then you abstract them into a library.

oh right us can use the split by json, that's nice is makes things easier

If scene-local were the default in make-a-block, then the ability to change it to "all scenes" scope wouldn't hurt collaborators, who just wouldn't use that capability.

Not saying we have to do that, just that getting the user interface right can avoid this sort of "adding this capability would just confuse users" argument. That's what the Scratch Team used to say about lists, back in the day, remember? ;~)

not the same thing. imagine projects with scenes on different computers. This is the era of the internet!

that would be cool on multiplayer lol, can we get this in snap! (joke I know this will not get added soon if at all)

Yes, but there are some tricky issues. Can players edit the blocks? Do other players see the edits? What happens when two players try to edit the same block at the same time? And so on. As of my conversation with him last night, Jens is open to considering this feature eventually, but he wants to start simple.

Netsblox has fully functional rooms, roles, coediting.