# A Memory Efficient, Upgradable Fishing System

This guide will teach you how to make the most efficient fishing system, while having the possibility of upgrading your rod!

First, we’re going to make the rod’s level. Make a player-scoped number property that’s called “rodLevel”. Make a player-scoped counter that edits the “rodLevel” property. Increase and decrease this however you want.

# Storing the Probabilities

Now, we’re going to get into the meat of the guide! Basically, we’re going to store the probabilities in text properties. So first we need to store the numbers in a text property. We’re going to use a format where each probability is separated by a / from each other. Let’s look at a sample storing:

50/20/10/5/3/2/

This means that the first possibility has a 50% chance of happening, the 2nd possibility has a 20% chance of happening, and so on. You can have as many possibilities as you want, but the properties for each level must have the same number of possibilities. However, you can put 0 for some slots so you don’t have any chance to get that possibility. Note that you must have them all add up to 100.

## Naming the Properties

To access these based on the rod level, we’ll be using concatenation. The format will be “fishingProbs[ROD_LEVEL]”, where you put the rod level in that spot.

# Interpreting the probabilities

This part is where we start to read the properties. We’re going to loop the code because the code for reading one number is big, and we’d only be able to fit 2 or 3 inside one block. First, let’s get our looping property. It’s going to be player scoped and have a default of 0. I’m going to call it “indexingNum”. Make a counter with a default 0 and target of 2 more than however many possibilities you have. Make the target reset the counter. that edits the property. Make the “indexingNum” property broadcast on “indexingNumChange”. Make a checker receive on that channel and check if the property is greater than 0. If so, the checker should broadcast on “doIndexing”. Make a trigger receive on that channel. Add these blocks to it:

Make sure to replace the 7 in the condition for the first if statement with 1 more than however many possibilities you have. I have 6 possibilities, so I need 6+1=7 inside the condition.

Make a player-scoped text property called “ProbText”. Make player scoped number properties from “Prob0” all the way to “Prob[NUMBER_OF_POSSIBILITIES_HERE]”. Make a trigger that receives on “doRandomizer”. Add this block code to it:

More applications of this guide are where you can tweak the parameters of a random function however you want and such. The showcase link for this is in my bio.

8 Likes

well done. its so good I dont understand it. but I think this has been done before (I’m checking right now)

dang, I’m really surprised! with all of the people telling newer forum users “a fishing system has been done before” I can’t believe you found something that hasn’t been done before. this is just such a simple idea that nobody except you thought of.

I’ve been waiting for a guide like this!

Understandable block code, and the point gets across. And finally, the organization of the guide is actually well put together!

I’m a little confused with the blocks and all, but good guide!

Nice guide!
I actually understand the whole process thanks to your clear step-by-step instructions!

Great guide. Very clearly demonstrates block code!

Here are a few possible optimizations that i might have found

I have a similar system i am working on and i found that it is more efficient to make each probability a fixed length

`502010050302`

And then decipher based on the indexing property * 2

Also you can use the round operator to convert text to a number instead of a multiplier

You can also instead of adding the last probability number to the current you can subtract the current probability number from 100 and use les block code

That would probably work! It might even shorten the first block code enough that I can condense all the blocks into just one block! I’ll look into that. Thanks!

1 Like

Also this

Doesn’t match the properties in the image (Prob1-possibilities)

1 Like

Prob0 is a dummy property so that the other block code (adding the previous property along with the number in the text) works.

2 Likes