Hello, Gimkitters! It’s me, Landyn, and I’ve got something for you. It’s my all-new Item Randomizer! I’ve seen a few guides on this, but the problem with those guides is that they’re not TRULY random. And my method is not only very random, but all it uses is 1 Button, 1 trigger and item granters! (And a good chunk of block code.) I call it: The Item Randomizer Trigger! (Super unique title, eh? ) And it’s not only memory-friendly, but the randomness can actually be modified to make certain things more common and vice-versa! (See my Modifier Guide I posted earlier today) As always, El Goblino will help me out with this one, and let’s get started!
What You’ll Need
1 Button
1 Trigger
X Item Granters
OPTIONAL: 1 Notification
Step 1. Grab that button and have it say “Open Drawer.” Make it scope = global. Also make it transmit Random_Item and Deactivate on that very same channel.
Step 2. Grab that trigger and make it trigger when receiving on Random_Item. Make it NOT visible and NOT trigger on player collision. Make it player scope.
Step 3. Here’s where things get SUPER complicated. Go into the block code and do the “When Triggered…” block section. If you would just like to copy my code, then reference to the picture. If you want to know what you actually NEED to do, follow the instructions titled Code Instrux.
Code Instrux
Code Instrux: So, first off create a variable named Random_Item. Then, create a block. Set “Random_Item” to “Random Integer from 0 to 10.” Now, create an 11-if-long If Block, with each If checking to see if the variable “Random_Item” is a certain number. Make sure that each If checks a different number.
Now, under each If block, (in the “Do” section") make a “Broadcast Message On Channel ______” block. It does not matter what the channels are, as long as each channel ties to an item granter. (you’ll understand later, just trust me on this one.) BUT! Make sure that under the “If Random_Item = 0” block is broadcasts on “Nothing!” (Once again, just trust me. I know what I’m doing. I think. )
Step 4. Tie an item granter to each channel of the trigger. Say, if you wanted to grant a lockpick, have the trigger channel be “Get_Lockpick.” Note: for me, the lockpick was a black seed. and you’re basically done!
OPTIONAL: remember that “Nothing!” Channel I mentioned? well, grab that notification and have it send you the notification when receiving on “Nothing!” and have the text be “You found nothing! Hmmm…”
El Goblino Summary: Hola, amigo! This was a tough guide, dud! So let me break it down for you.
Basically, whenever you press the button, it’ll randomly give you either an item or cash. The randomizer is skewed to be more likely to give you moolah, but that can be changed; it’s completely up to you. Now, THAT is pretty easy for such a lot of code! Now, let’s hand it off to Landyn! Hasta luego!
Variations
The Encounter Randomizer
This variation is similar to the Item Randomizer, but it randomizes encounter that you can have with creatures/Entities. It also uses inequalities, not singular digits. Pretty simple!
Well, I hope you’ve enjoyed this short guide! I also hope you will utilize this guide and implement it into your own game! This is Landyn Speed, signing off!