Pandadude12321

I believe in scratch 2.0 one could put a string block into a block's drop-down menu, however as far as i can tell this feature is missing from 3.0.

This prevents me from doing things like
(item ( 1) of (join [loot table of ] (enemy)) :: list) 

is there any efficient 3.0 workaround for this that isn't just an if block for every list?

a-jar-of-tuna

Huh. That's weird. Unless scratch 3.0 is updated to fix that or you can hack it, then no, I don't think there's an efficient workaround.

Pandadude12321

a-jar-of-tuna wrote:

Huh. That's weird. Unless scratch 3.0 is updated to fix that or you can hack it, then no, I don't think there's an efficient workaround.
oh no, has anyone by any chance figured out hacked blocks for 3.0?

codeman1044

Hacked blocks are a feature that 3.0 basically stomped out. I haven't seen any working hacked blocks in scratch since 3.0 dropped (except for some blocks that exist in the JSON files of scratch but aren't actually used or shown and lack code). If you try and pull up any project that has hacked blocks that was made before 3.0, it will just crash the page.
You can make an array, which is a list of lists. Each item on the array would have a label so you could read the info off of the correct item. Examples (based on a loot table example):
Zombie| armor sword key coin
Spider| Cobweb coin
Goblin| Cloth coin
Etc etc. You could add numbers next to the items so you can change their rarity of dropping, which would go in the pick random block.
If you need an example, just ask.

dual_creator43

Pandadude12321 wrote:

I believe in scratch 2.0 one could put a string block into a block's drop-down menu, however as far as i can tell this feature is missing from 3.0.

This prevents me from doing things like
(item ( 1) of (join [loot table of ] (enemy)) :: list) 

is there any efficient 3.0 workaround for this that isn't just an if block for every list?
It is slightly longer, but what could work is this:
add (join [loot table of ] (enemy)) to [enemyLoot v]
(item (1 v) of [enemyLoot v] :: list)

Pandadude12321

codeman1044 wrote:

Hacked blocks are a feature that 3.0 basically stomped out. I haven't seen any working hacked blocks in scratch since 3.0 dropped (except for some blocks that exist in the JSON files of scratch but aren't actually used or shown and lack code). If you try and pull up any project that has hacked blocks that was made before 3.0, it will just crash the page.
Hopefully this changes, in 3.0 I've seen some key detection for keys unavailable from the key pressed Boolean, which i believe requires basic block hacking. But i can't seem to figure out how it was done.


codeman1044 wrote:

You can make an array, which is a list of lists. Each item on the array would have a label so you could read the info off of the correct item. Examples (based on a loot table example):
Zombie| armor sword key coin
Spider| Cobweb coin
Goblin| Cloth coin
Etc etc. You could add numbers next to the items so you can change their rarity of dropping, which would go in the pick random block.
If you need an example, just ask.
Could you give an example of how this would be done in the most elegant and efficient way?

codeman1044

Here's an engine for it:
https://scratch.mit.edu/projects/321434386/
this took a lot more scripting than I thought it would…
I haven't tested this out to the max, so let me know if it's buggy.
Feel free to use this if you need. Let me know if you want me to change how the loot tables work.