• 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.
  • Ever thought it'd be cool to have your art, writing, or challenge runs featured on PokéCommunity? Click here for info - we'd love to spotlight your work!
  • Our weekly protagonist poll is now up! Vote for your favorite Conquest protagonist in the poll by clicking here.
  • 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] do plugins ovewrite the original code? something odd...

  • 17
    Posts
    1
    Years
    • Seen Apr 28, 2025
    I always think plugins will ovewrite the original code, so I do all my job through plugins, but today something odd happened, I just can't figure it out by myself.
    I simply copy a .rb file into my plugin folder, but I found one method seems can't overwrite the original one.
    This is the file:
    [PokeCommunity.com] do plugins ovewrite the original code? something odd...
    [PokeCommunity.com] do plugins ovewrite the original code? something odd...
    This seems doesn't work: (because it doesn't print "---------------------------------")
    [PokeCommunity.com] do plugins ovewrite the original code? something odd...
    I searched:
    [PokeCommunity.com] do plugins ovewrite the original code? something odd...
    If I delete def pbInitPokemon in the original file, then run:
    [PokeCommunity.com] do plugins ovewrite the original code? something odd...
    If i put "-----------------" in another place above def pbInitPokemon:
    [PokeCommunity.com] do plugins ovewrite the original code? something odd...
    It worked:
    [PokeCommunity.com] do plugins ovewrite the original code? something odd...
    If I move this file into Generation 9 Pack Scripts folder, it also works.
    [PokeCommunity.com] do plugins ovewrite the original code? something odd...
    [PokeCommunity.com] do plugins ovewrite the original code? something odd...
    I am puzzled...
    Need help...
     

    Attachments

    • [PokeCommunity.com] do plugins ovewrite the original code? something odd...
      1714057815573.png
      75 KB · Views: 2
    Last edited:
    Someone more well versed in how the compiler works can correct me if I'm wrong here but I'm pretty certain they do overwrite.
    If you're writing the method that is in the same class it'll overwrite. So by the looks of it, your pbInitPokemon for your plugin is not being declared in the scope of Battle::Battler or whatever the class is for the original.
    Hope that helps!
     
    They absolutely do overwrite, that's what allows plugins to even work in the first place. Most plugins would be pretty pointless otherwise.

    The issue is that def pbInitPokemon needs to exist in the base Essentials files, because the Shadow Pokemon script depends on it existing so that it may edit it for Shadow Pokemon properties. That's why you get that error you posted. You can overwrite it, you can alias it, but you cannot remove it.
     
    They absolutely do overwrite, that's what allows plugins to even work in the first place. Most plugins would be pretty pointless otherwise.

    The issue is that def pbInitPokemon needs to exist in the base Essentials files, because the Shadow Pokemon script depends on it existing so that it may edit it for Shadow Pokemon properties. That's why you get that error you posted. You can overwrite it, you can alias it, but you cannot remove it.
    It should overwrite, but it doesn't, that's what I can't understand.
    I wanna make sure if I did it right:
    1.There is a file called 002_Battler_Initialize in Data\Scripts\011_Battle\002_Battler, I simply copy it and paste it in my plugin called [01] Demanding Yellow Custom Scripts.
    Let's call the original one ORIG, and the paste one COPY, so now the COPY will overwrite ORIG completely, right?
    2.There are two methods in COPY(def pbInitialize and def pbInitPokemon), and I want it to print something, then run the game:
    [PokeCommunity.com] do plugins ovewrite the original code? something odd...
    [PokeCommunity.com] do plugins ovewrite the original code? something odd...
    It seems def pbInitialize overwrote, but def pbInitPokemon didn't.
    I searched ensure that there is no other over-overwrite.
    [PokeCommunity.com] do plugins ovewrite the original code? something odd...
    3. Now if I move COPY from my plugin into Generation 9 Pack Scripts, both method worked.
    [PokeCommunity.com] do plugins ovewrite the original code? something odd...
    [PokeCommunity.com] do plugins ovewrite the original code? something odd...
    def pbInitialize and def pbInitPokemon both overwrote properly.
    What's the problem of the method def pbInitPokemon...I can't get it...
     
    Back
    Top