Local Block(s) in Global Definition

I'm implementing a "Database" in :snap: using a reporter block as a "getter". I made an edit key %'k' of %'dbBlck' to %'v' block, though without dbBlck (i.e., setting dbBlck as a script var to the DB block) it sent me this popup:

Though when I made dbBlck and argument to the "setter" block and not as a script var, suddenly, the popup disappeared and let me save the block!

Does anyone know why does this happen, and why does making the block an argument to the block fix the issue?

ik this probably goes in advanced help

I think I finally understood what the dialog said. Basically, said DB object block was a local block to the sprite I mainly worked in, and so when I referenced the local block, :snap: acted all freaky about it. My fix works, because it works. Quite literally.

I may be using a little too less brain power like Jens said /j

You are saving the global block so that it can be used in some other project. But you aren't saving your sprite(s) with it. So, what do you expect to happen in that other project when your global block tries to call the local block that wasn't saved with it?

Sometimes it makes sense for a global block to call a sprite-local block, e.g., if you have different versions of the same block in different sprites, and you want the global block to use whichever local block belongs to the sprite that's running it. But to make that work, you have to save the sprites (including their local blocks) along with your global block! I.e., you have to save the entire project.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.