Dynamically populating dropdown input slots

I agree with separating variables from lists, but not custom blocks in other. I do think it would be a little bit weird to have the variables category with only like three or four blocks.

Is there any way to get the value of slots and the amount and names of slots there are?

you can use the definition's formal parameters in any script to get the slot values. The names you don't need, because you already know them (because you've defined the block).

ok that makes sense. I'm trying to figure out this block

and how to make both variadic inputs always have the same about of slots.

what does any of this code mean?

We are trying to fix your problems not discuss Jens example that works :slight_smile:

Have you tried the things i suggested?

Your code is very complex to try and debug but I suspect that it is failing due to you trying to change a slot that you are also using as a dynamic dropdown menu

I think trying to use a dynamic menu slot as a pseudo console/debugger is maybe not the thing to do

Interesting. Why?

Yep - you can't set use the set slot value if its a dynamic menu

listmenu script pic (1)

that part isn't done yet...

Ah, I see what you're trying to do here. You're attempting to set the value of a slot in the block definition body. That can't work, because that block's domain is a particular custom block instance which is reacting to a (direct) user interaction. In other words: Those blocks can only be used in scripts topped by the new block-instance-user-interaction hat blocks. Make sense?

Well it's not me attempting :slight_smile:

I just came up with a minimal example of what I think @owlsss is attempting :slight_smile:

But I did have the wrong explanation

I don't know what the use case of changing the slot value is yet

And I've no idea what the expand slot does

It worked when I tested it here?

What is it?

huh?

what is the "it" that worked?

Have you read and understood what Jens said?

I replaced the code that handles the dynamic menus in my backpack block to only be set slot [ V] to []::control and when I clicked the drop-down in the backpack it automatically set the content of the input to whatever I put in there

That's what Jens says will work - the set slot needs to be under a when slot x menu clicked hat or the when slot x edited hat

ooohhhh

Oh.