• Just a reminder that providing specifics on, sharing links to, or naming websites where ROMs can be accessed is against the rules. If your post has any of this information it will be removed.
  • Dawn, Gloria, Juliana, or Summer - which Pokémon protagonist is your favorite? Let us know by voting in our poll!
  • Our friends from the Johto Times are hosting a favorite Pokémon poll - and we'd love for you to participate! Click here for information on how to vote for your favorites!
  • 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.

[Scripting Question] Pokemon Safari Zone - Different bait?

  • 31
    Posts
    6
    Years
    Hey guys! I'm playing around with adding a safari zone to my Pokemon fangame, and I was wondering if anyone has examples of a script for different bait? I'm thinking of trying to add bait that provides different effects. You'd have to make and/or buy this bait, but depending on the bait type, you could get a bait with the same effect as throwing rocks/mud but make them stay longer (and yes, this bait would be more difficult to get for that reason), or bait that makes catching certain types of Pokemon easier than the rocks/mud but may or may not make the Pokemon have any different chance of not fleeing.

    If anyone could at least just give me an idea of how I could do it, I'd love to try it.
     
    You'll want to edit the script section PokeBattle_SafariZone then, specifically def pbStartBattle in the section for bait. The variables are all commented so the big part you'll need to edit is the selection dialog to pick out the bait you want to use.
    The scene has a method def pbShowCommands(msg,commands,defaultValue), so you can call it with @scene.pbShowCommands(msg,commands,defaultValue) to show the dialog to pick the bait (this is assuming it's not an actual item in the bag.)

    def pbItemMenu(index) let's you pick an item from the bag, but by default it prevents you from seeing any item that doesn't have an in battle use or isn't a pokeball, so you might want to make a copy of it or something and change this bit here
    Code:
    itemscene.pbStartScene($PokemonBag,true,Proc.new{|item| 
           $ItemData[item][ITEMBATTLEUSE]>0 || pbIsPokeBall?(item)
           },false)
    The big bit is the proc, if it returns true for the item, that item will appear in the item selection screen.
     
    Thanks for the info, Vendily. I'll experiment with it after work tomorrow. ^_^
     
    Back
    Top