• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

Difficulty implementing new Fishing-based Encounters

  • 76
    Posts
    10
    Years
    • Seen Mar 31, 2014
    Hello,

    Ok, I want to beef up the variety of fishing-based encounters by adding a bait system. This doesn't replace the old fishing system; it just enhances it by changing the pool of Pokemon that fishing on a given map will draw from. You can still fish without bait if you want (though I need to mod the code so that you have to have at least one rod in your inventory to use bait). I would also like to do special baits that increase the chance of getting a shiny Pokemon, and possibly certain baits that will have a 100% hook rate. I know there's switches that can be turned on to change these factors but I'm not sure where to put them in the item code to make them bait-specific.

    I've got one type of bait partially implemented, but I seem to be unable to find the last little bit of code to modify/copy to get it to work right. Whenever I try to use it wherever I can use a rod, it just says "You can't use that here."

    Here are all the changes I've made to the code so far:

    PokemonItemEffects
    Spoiler:

    I looked at the Fishing section of PokemonField. I see the code that manages the animation, bite chances, reaction testing (which I modified to increase the reaction time), etc. I do not see anything that defines the Rods as Encounter methods....

    PokemonEncounters
    Spoiler:

    I've edited the Items.txt file to include the item and I didn't have problems getting it into my inventory. I just can't seem to be able to use it.
    Code:
    527,OLDBAIT,Old Bait,8,100,"BROKEN This isn't very fresh, but it might attract something....",0,0,0,
    Oh, and I spotted that I needed to add it to the PokemonBalls section under Lure Balls:
    Code:
    BallHandlers::ModifyCatchRate.add(:LUREBALL,proc{|ball,catchRate,battle,battler|
       catchRate*=3 if $PokemonTemp.encounterType==EncounterTypes::OldRod ||
                       $PokemonTemp.encounterType==EncounterTypes::GoodRod ||
                       $PokemonTemp.encounterType==EncounterTypes::OldBait ||
                       $PokemonTemp.encounterType==EncounterTypes::SuperRod
    Could someone tell me what I'm still overlooking?

    Thank you!
     

    Skystrike

    [i]As old as time itself.[/i]
  • 1,641
    Posts
    15
    Years
    Code:
    527,OLDBAIT,Old Bait,8,100,"BROKEN This isn't very fresh, but it might attract something....",0,0,0,!

    I didn't see any other problems, besides this one:
    Code:
    527,OLDBAIT,Old Bait,8,100,"BROKEN This isn't very fresh, but it might attract something....",0,0,0,!

    From the Pokémon Essentials Wiki, Defining Items article:
    Pokemon Essentials Wiki said:
    Usability out of battle
    Is one of the following values:
    • 0 - The item cannot be used out of battle.
    • 1 - The item can be used on a Pokémon, and disappears after use (e.g. Potions, Elixirs). The party screen will appear when using this item, allowing you to choose the Pokémon to use it on. Not for TMs and HMs, though.
    • 2 - The item can be used out of battle, but it isn't used on a Pokémon (e.g. Repel, Escape Rope, usable Key Items).
    • 3 - The item is a TM. It teaches a move to a Pokémon, and disappears after use.
    • 4 - The item is a HM. It teaches a move to a Pokémon, but does not disappear after use.
    • 5 - The item can be used on a Pokémon, but it does not disappear after use (e.g. Poké Flute)
    Anyways, your problem is that
    Code:
    527,OLDBAIT,Old Bait,8,100,"BROKEN This isn't very fresh, but it might attract something....",[B]0[/B],0,0,!


    is 0, which means that it can't be used at all out of battle. You want to change it to

    Code:
    527,OLDBAIT,Old Bait,8,100,"BROKEN This isn't very fresh, but it might attract something....",[B]2[/B],0,0,!

    so you can use it out of battle.
     

    Daruda

    Grinder
  • 33
    Posts
    10
    Years
    • Seen Aug 24, 2014
    I think that if you want to increase the shiny chances you should do momething like add this in the script.

    SHINYPOKEMONCHANCE = 32500 #out off 65000 or so

    then after the encounter return it normal (8)
    That is the global setting for shiny pokemon, I hope it works.
     
  • 76
    Posts
    10
    Years
    • Seen Mar 31, 2014
    I didn't see any other problems, besides this one:
    Code:
    527,OLDBAIT,Old Bait,8,100,"BROKEN This isn't very fresh, but it might attract something....",0,0,0,!
    From the Pokémon Essentials Wiki, Defining Items article:
    [/LIST]
    Anyways, your problem is that
    Code:
    527,OLDBAIT,Old Bait,8,100,"BROKEN This isn't very fresh, but it might attract something....",[B]0[/B],0,0,!
    is 0, which means that it can't be used at all out of battle. You want to change it to

    Code:
    527,OLDBAIT,Old Bait,8,100,"BROKEN This isn't very fresh, but it might attract something....",[B]2[/B],0,0,!
    so you can use it out of battle.
    *headdesk* Wow, why didn't I catch that? I was looking at the "defining an item" page when I wrote that. I suck so hard with numbers....

    Thank you, though! Bait is useable now! ^o^ Although for some reason, the quantity of bait in my inventory isn't going down when I use it.... When I copied the OldRod info in the Pokemon Item Effects, I thought I changed the variable that determines whether or not an item gets consumed.
    Code:
    # UseFromBag handlers
    # Return values: 0 = not used
    #                1 = used, item not consumed
    #                2 = close the Bag to use, item not consumed
    #                3 = used, item consumed
    #                4 = close the Bag to use, item consumed
    
    ItemHandlers::UseFromBag.add(:OLDBAIT,proc{|item|
       terrain=Kernel.pbFacingTerrainTag
       notCliff=$game_map.passable?($game_player.x,$game_player.y,$game_player.direction)
       if (pbIsWaterTag?(terrain) && !$PokemonGlobal.surfing && notCliff) ||
          (pbIsWaterTag?(terrain) && $PokemonGlobal.surfing)
         next 4
       else
         Kernel.pbMessage(_INTL("Can't use that here."))
         next 0
       end
    })
    I've tried "next 4" and "return 4," but neither have resulted in the bait actually getting consumed (as well as either next or return 3, and that didn't work at all). (Although I guess if I want to put in lures, too, now would be the time. :P) But thanks again! I'd been staring at this stuff for hours trying to figure out what I was missing.....


    Daruda - Thanks for the tip! I'll start experimenting with that once the regular baits are working perfectly.
     

    tImE

    It's still me, 44tim44 ;)
  • 673
    Posts
    17
    Years
    Code:
    527,OLDBAIT,Old Bait,[B][FONT="Arial Black"]8[/FONT][/B],100,"BROKEN This isn't very fresh, but it might attract something....",2,0,0,!
    There is your problem right there. The 8 stands for key item. That's why it isn't consumed.

    Code:
    527,OLDBAIT,Old Bait,1,100,"BROKEN This isn't very fresh, but it might attract something....",2,0,0,!
    Use this, and it should consume properly.
     
    Back
    Top