• 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.
  • 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!
  • Scottie, Todd, Serena, Kris - which Pokémon protagonist is your favorite? Let us know by voting in our poll!
  • 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.

How to make escape ropes usable with NPC partners.

  • 6
    Posts
    9
    Years
    • Seen Sep 4, 2016
    Title question. I'm not sure where in the script editor I'd find this, but if anyone could lend me a hand I'd greatly appreciate this.
     
    In Essentials 16.1, item handlers are found in the PItem_ItemEffects script section. Here's how the Escape Rope is handled:

    Code:
    ItemHandlers::UseFromBag.add(:ESCAPEROPE,proc{|item|
       if $game_player.pbHasDependentEvents?
         Kernel.pbMessage(_INTL("It can't be used when you have someone with you."))
         next 0
       end
       if ($PokemonGlobal.escapePoint rescue false) && $PokemonGlobal.escapePoint.length>0
         next 4 # End screen and consume item
       else
         Kernel.pbMessage(_INTL("Can't use that here."))
         next 0
       end
    })
    You can copy that code into a new script section above main and make modifications to it, and your handler will replace the handler previously defined in the PItem_ItemEffects section. Keep in mind, when removing the block while having a dependent event, that what the library will do with the dependent event may be undefined and may cause some fun errors. :P

    (And I really need to finish rewriting the Script Sections page to update it to 16.1 and make it more searchable.)
     
    Back
    Top