Discuss Scratch

jokebookservice1
Scratcher
1000+ posts

Global Define Blocks (New idea)

Please, just say if you support, semi-support, no-support, or don't understand how it works
-Addify-
Scratcher
54 posts

Global Define Blocks (New idea)

blump
Jonathan50
Scratcher
1000+ posts

Global Define Blocks (New idea)

Support.

jokebookservice1 wrote:

EDIT: Reminder; the workaround exists, but it seems inconvenient, and uses lists + broadcasts
How would you work around global blocks in this?
when gf clicked
block [foo] :: custom
block [bar] :: custom

when gf clicked
block [baz] :: custom
block [qux] :: custom

Last edited by Jonathan50 (Aug. 4, 2016 00:37:23)

jokebookservice1
Scratcher
1000+ posts

Global Define Blocks (New idea)

Jonathan50 wrote:

Support.

jokebookservice1 wrote:

EDIT: Reminder; the workaround exists, but it seems inconvenient, and uses lists + broadcasts
How would you work around global blocks in this?
when gf clicked
block [foo] :: custom
block [bar] :: custom

when gf clicked
block [baz] :: custom
block [qux] :: custom
broadcast and wait + you would need to combine the scripts together because you will have race conditions there anyway so why not predefine which goes first…
jokebookservice1
Scratcher
1000+ posts

Global Define Blocks (New idea)

Bump.

But from now on, please don't just state your support, or lack thereof. Instead please add to the discussion.
jokebookservice1
Scratcher
1000+ posts

Global Define Blocks (New idea)

b u m p
Lythium
Scratcher
1000+ posts

Global Define Blocks (New idea)

SUPPORT HAHAHAHAHAHA

In reality though, I don't quite understand the suggestion. Could you explain it to me?
jokebookservice1
Scratcher
1000+ posts

Global Define Blocks (New idea)

Lythium wrote:

SUPPORT HAHAHAHAHAHA

In reality though, I don't quite understand the suggestion. Could you explain it to me?
So currently, every custom block created can only be invoked from the sprite that it is in. Sometimes you have projects where you need to have a sprite call another to do something. Broadcasting basically. Maybe for a cloud list engine. You need the broadcast to take arguments.

So if the Cat sprite has

Encode () ::custom
then (with different wording)
Tell Cat : Encode () ::custom
(It would say “Tell cat:” but yeah..)

Unlike the problems with other global broadcasts, here, only one sprite executes the custom block, but others can call another block to run it (with arguments)

Last edited by jokebookservice1 (Nov. 14, 2016 18:29:52)

TheUltimatum
Scratcher
1000+ posts

Global Define Blocks (New idea)

Support I like your idea as per making this run the block in the scope of the sprite it is defined in. Though it could simply run in its own little sandbox like a clone.
dvargasews
Scratcher
500+ posts

Global Define Blocks (New idea)

jokebookservice1 wrote:

joefarebrother wrote:

Support!

Maybe in other sprites than the one defines, they could be prefixed with the sprite name, for example if “Sprite1” had

define do stuff (a) (b) (c)

and this option was checked, other sprites would do (and see in their more blocks pallet)

Sprite1: do stuff (a) (b) (c) :: custom

to call it.
Good Idea!
Or maybe there could be global and local custom blocks, like local and global variables and lists, so
Sprite1: define dodge left
change x by (-50)
wait (2) seconds
change x by (50)
could only be used by Sprite1, but
define square dance
repeat (4)
move (50) steps
turn cw (90) degrees
wait (0.8) secs
end
could be accessed by any sprite in the project.
braxbroscratcher
Scratcher
1000+ posts

Global Define Blocks (New idea)

I'm thinking; this is the only efficient method for variable broadcasts. Otherwise you'd need to be looking for random broadcasts all the time.

Powered by DjangoBB