RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
Basic and Non-basic Fishing systems (rm2k3)

0 Members and 1 Guest are viewing this topic.

****
Bitch
Rep:
Level 87
Bits'n'Pixels
I found other fishing tutorials out there, but i didn't like them, so i built my own.  I've used other people stuff here, so i feel i owe it to everyone else to contribute something of my own, whether it be useful or not, so here is my first written tutorial.

I'll start with the super-basic pokemon style system i used to start it off.  This is mainly for beginners or people who want super-simple systems.

Basic Fishing:
Spoiler for:
What you'll need (to understand)
An event, two pages
A variable
A fishing rod item
Some 'caught fish' items
Conditional branches

Make a variable and set it to random number Y - X (i chose 1 - 30) and name it.  For now, we'll call it 'fishing'.

Make some fish. I made 'grey fish' and 'yellow' fish.

Make a fishing rod.

Set the event on the water shore and make it an invisible tile.  Make it same layer as hero and set it to action key activation.
On the first page, just leave it at 'there are fish in the water' or something.

On the second page, set a precondition for ''fishing rod' held', so this can only be accessed by having the fishing rod item.  That's that done, it has no further use.

Set a message 'do you want to fish' and then pop in a choice 'fish' or 'don't fish'  For 'don't fish', leave that empty, so nothing happens if it's selected.

Under 'fish' put a conditional branch, with execute handler and set it to have a variable for 20 or more.  Then put on effects of your choice, for example, a wait, sound effects, hero jumps or something and have a message saying 'caught yellow fish' and then make a 'yellow fis' item appear in inventory.

This is what it should look like for now:

<> Message: Do you want to fish?
<> Variable Oper: [xxxx Fishing] Set, Rnd [0-30]
<> Show Choices Fish/Don't Fish
: [Fish] Handler
 <> Branch if Var [xxxx Fishing] is 20 or more
  <> Wait 3.0 Sec
  <> Play Sound Effect: ~~~
  <> Message: Caught a yellow fish
  <> Change Items: Yellow Fish 1 add
  <>
 : Else Handler
  <>
: [Don't fish]
 <>
: End
<>


That means, simply that if the random number selected by the variable is 20 or more, you get a yellow fish.  Now we'll set what happens if it's not 20 or more.

In the Else Handler, put another conditional branch (also with execute handler) and set the same fishing variable but set it to 10 or more, and do the same as catching fish, except make it 'grey' fish'.  Then,  in that else handler, set the variable number to 9 or below and put a message saying 'didn't catch anything'.  And that's it!  It should look like this:

<> Message: Do you want to fish?
<> Variable Oper: [xxxx Fishing] Set, Rnd [0-30]
<> Show Choices Fish/Don't Fish
: [Fish] Handler
 <> Branch if Var [xxxx Fishing] is 20 or more
  <> Wait 3.0 Sec
  <> Play Sound Effect: ~~~
  <> Message: Caught a yellow fish
  <> Change Items: Yellow Fish 1 add
  <>
 : Else Handler
  <> Branch if Var [xxxx Fishing] is 10 or more
   <> Wait 3.0 Sec
   <> Play Sound Effect: ~~~
   <> Message: caught a grey fish
   <> Change items: grey fish 1 add
  : Else Handler
    <> Wait 3.0 Sec
    <> Message: didn't catch anything
    <>
: [Don't fish]
 <>
: End
<>


So, if the variable selected is 20+, you get a yellow.  If it is 1-19, it moves onto the else.  In that branch, if it is 10+ you get a grey fish.  If it is 1-9, it moves onto the last branch, and you get nothing.  It's as simple as that!  You can edit it as much as you want, or even use the non-basic tutorial below

Okay, with that simple tutorial done, i'll move onto the non-basic one.  This includes random waiting times and bait.

Non-Basic
Spoiler for:
What you'll need (to understand)
An event with 2 pages
Three variables
Two 'caught fish' items
A fishing rod item
Two 'bait' items
A good few conditional branches

First, make your fish items.  For now, we'll go with yellow fish and grey fish.  The yellow fish is the rare one in this case.  Make your fishing rod item as well. 
The fishing bait, i used worms and maggots, worms being the more effective ones
On the event, make it same layer, action key activated and put it on the water next to the shore.   the first page says only 'there are fish in the water'.
The second page is where the fun starts.  Set the precondition to 'item 'fishing rod' held', so it only starts if you're holding the fishing rod.

On that page, set your three variables. 
Fishing: random number 1-30
   This will be the chances of catching fish
Waiting Time: random number 1-3
   This will be the chances of long or short waits
Lost Bait: random number 1-4
   This will be the chances of losing bait when nothing is caught.

Right, first, the message 'do you want to fish?', followed by a select choice 'yes' and 'no'.  Leave 'no' empty.
For 'yes', put a message 'which bait will you use'? and another select choice with 'worms' and 'maggots'
We'll do maggots first.
Put a conditional with execute handler on and set it to check for items: maggots 'held'.  If we jump straight to the 'else' handler, we can put in a message saying 'you have no maggots' and that'll be that. you can't fish without bait.
In the handler for having maggots, there's a few more conditional branches involved.
First, put in another branch and set it to check the variable 'waiting time' for a number.  If the number selected is 1, then set a 'wait 8.0 Sec' command.  In the else handler, put another branch, checking the same waiting time variable and put a command for 'wait 12.0 sec'.
In that else handler, put a command for 'wait 4.0 sec'.

Before we even get to catching the fish now, we have a randomly determined wait of 4, 8 or 12 seconds.

This is what it should look like just now.

<> Variable Oper: [xxxxFishing] set rnd [1-30]
<> Variable Oper: [yyyyWaitingTime] set rnd [1-3]
<> Variable Oper: [zzzzLostBait] set rnd [1-3]
<> Message: start fishing?
<> Show choices: yes/no
: [yes] handler
  <> Message: Which bait?
  <> Show choices: Maggots/Worms
  : [Maggots] handler
    <> Branch if maggots possessed
      <> branch if var [yyyywaitingtime] is 1
        <> wait 8.0 sec
        <>
      : else handler
        <> branch if var [yyyywaitingtime] is 2
           <> wait 12.0 sec
           <>
        : else handler
           <> wait 4.0 sec
           <>
        : end
          <>
      : end
        <>
    : else handler
      <> message: you have no maggots


Simple, huh?
Now, we determine fish catching rates. 
At the end of the branch for checking [yyyywaitingtime] variable, set another branch to check [xxxxfishing] and set it to, say 15 or more.
After that, put a command in for a message saying 'caught a grey fish', then any sound effects or whatever that you wish, and in the item manager, give the hero a grey fish and remove a maggot.

In the else handler, if the [xxxxfishing] number selected was not 15 or more, then set a message saying 'no fish were caught'.  Now, put one last branch for the maggot choice and have this branch check [zzzzlostbait] and set it to see if the random number is 1.  Under that, set a command to remove 1 maggot.  You can leave the else handler empty, or just not put one. 

This means that whe you fish with maggots, you have a 15/30 (50%) chance of catching a grey fish, and catching nothing.  Then, after that you have a 1/4 (25%) chance of losing bait anyways, either fish nibbled it, or it dropped off the hook, whatever.  You could even put a message saying 'lost some maggots'.

How should it look so far:

<> Variable Oper: [xxxxFishing] set rnd [1-30]
<> Variable Oper: [yyyyWaitingTime] set rnd [1-3]
<> Variable Oper: [zzzzLostBait] set rnd [1-3]
<> Message: start fishing?
<> Show choices: yes/no
: [yes] handler
  <> Message: Which bait?
  <> Show choices: Maggots/Worms
  : [Maggots] handler
    <> Branch if maggots possessed
      <> branch if var [yyyywaitingtime] is 1
        <> wait 8.0 sec
        <>
      : else handler
        <> branch if var [yyyywaitingtime] is 2
           <> wait 12.0 sec
           <>
        : else handler
           <> wait 4.0 sec
           <>
        : end
          <> branch if var [xxxxfishing] is 15 or more
             <> message: caught a grey fish
             <> change items: grey fish 1 add
             <> change items: maggots 1 remove
             <>
          : else handler
             <> message: nothing was caught
             <> branch if var [zzzzlostbait] is 1
               <> change items: maggots 1 remove
               <>
              : end
               <>
           : end
             <>
       : end
         <>
    : else handler
      <> message: you have no maggots
      <>
    : end
      <>
  : [worms] handler


Okay, now we have the maggots finished totally.  If you understood that, setting up the worms should be a breeze, because it's pretty much the same, but the chances aer changed, and there is one more fork, to give way to letting the yellow fish be caught.

Set the timers for [yyyywaitingtime] to be shorter, just by a bit though, but other than that, keep it the same.  Then, put in the branches for worms and the catchin' chances, again just the same except that the first [xxxxfishing] check should be for 28 or more, then message saying caught yellow fish.  then, set another branch to check if [xxxxfishing] is 5 or more and set it to give you one grey fish, and in that else handler, set it to then say you caught nothing.  That's a 2/30 chance of getting a yellow, 23/30 chance of catching a grey, and 5/30 chance of getting nothing.
Finish up with setting another branch to see if any bait was lost if nothing was caught. and leave all the branches to end there!

This is how it should look now:

<> Variable Oper: [xxxxFishing] set rnd [1-30]
<> Variable Oper: [yyyyWaitingTime] set rnd [1-3]
<> Variable Oper: [zzzzLostBait] set rnd [1-3]
<> Message: start fishing?
<> Show choices: yes/no
: [yes] handler
  <> Message: Which bait?
  <> Show choices: Maggots/Worms
  : [Maggots] handler
    <> Branch if maggots possessed
      <> branch if var [yyyywaitingtime] is 1
        <> wait 8.0 sec
        <>
      : else handler
        <> branch if var [yyyywaitingtime] is 2
           <> wait 12.0 sec
           <>
        : else handler
           <> wait 4.0 sec
           <>
        : end
          <> branch if var [xxxxfishing] is 15 or more
             <> message: caught a grey fish
             <> change items: grey fish 1 add
             <> change items: maggots 1 remove
             <>
          : else handler
             <> message: nothing was caught
             <> branch if var [zzzzlostbait] is 1
               <> change items: maggots 1 remove
               <>
              : end
               <>
           : end
             <>
       : end
         <>
    : else handler
      <> message: you have no maggots
      <>
    : end
      <>
  : [worms] handler
     <> branch if worms possessed
       <> branch if var [yyyywaitingtime] is 1
          <> wait 4.0 sec
          <>
        : else handler
           <> branch if [yyyywaitingtime] is 2
             <> wait 8.0 sec
             <>
           : else handler
             <> wait 2.0 sec
             <>
           : end
             <>
         : end
           <> branch if var [xxxxfishing] is 28 or more
             <> message: caught a yellow fish
             <> change items: yellow fish 1 add
             <> change items: worms 1 remove
             <>
           : else handler
              <> branch if var [xxxxfishing] is 5 or more
                <> message: caught a grey fish
                <> change items: grey fish 1 add
                <> worms 1 remove
               : else handler
                   <> message: no fish were caught
                   <> branch if var [zzzzlostbait] is 1
                      <> change items: worms 1 remove
                      <>
              : end
                <>
          : end
            <>
       : end
          <>
       : else handler
           <> message: you have no worms
           <>
     : end
       <>
  : end
    <>
: [no] handler
   <>
: end
<>


I can only hope that was simple enough.

And that's it.  You can of course mix the two, add your own elements to it, or change probabilities more.  I have more bait than that in my events, but didn't want to add in more than necessary and complicate things. 

Any comments, questions et cetera, you know what to do.  I only ask, as always, if you use this, that i get credit.

Thank-you for reading my first tutorial.  Hope ye liked it!

***
Rep:
Level 88
Paradoxial failboats are cool.
Nice tutorial. I think that a "fishing level" system could be easily put into it too. (Like, if your guy has fished a bunch, he has a better chance of catching a fish.)

Anyway, nice tut.
The message below is false.
The message above is true.

****
Bitch
Rep:
Level 87
Bits'n'Pixels
Woohoo, first comment!  I feel acknowledged by other people here!  :D

***
Rep:
Level 88
Paradoxial failboats are cool.
Congrats. You got acknowlaged! You win an ego cookie.

>>

The message below is false.
The message above is true.