• 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!
  • 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.

Mod to Event Encounter Pokemon not working

  • 19
    Posts
    10
    Years
    • Seen Aug 23, 2015
    I have an event encounter with a swampert and used this script to edit some of it's moves and ability.

    pbWildBattle(PBSpecies::SWAMPERT,30,false,true)
    poke.setAbility(1)
    poke.item=PBItems::ORANBERRY
    poke.pbDeleteMove(:FORESIGHT)
    poke.pbDeleteMove(:BIDE)
    poke.pbLearnMove(:MUDDYWATER)
    poke.pbLearnMove(:EARTHQUAKE)

    It shows up at level 30 and I can't run from it, but Doesn't have it's second ability.

    Not even sure you can delete moves from a wild pokemon, but if you can, it still used the ones I deleted and didnt have the ones I added. Am I doing something wrong?
     
    For the ability, are you referring to it's Hidden Ability?

    In the pokemon.txt file Swampert only has one ability available, so I think it's just going to give you Torrent no matter what index you put in setAbility

    maybe try altering the pokemon.txt file so there is a second ability for Swampert

    Code:
    Abilities=TORRENT,DAMP

    should do it, I hope (don't take my word for it)
     
    For the ability, are you referring to it's Hidden Ability?

    In the pokemon.txt file Swampert only has one ability available, so I think it's just going to give you Torrent no matter what index you put in setAbility

    maybe try altering the pokemon.txt file so there is a second ability for Swampert

    Code:
    Abilities=TORRENT,DAMP

    should do it, I hope (don't take my word for it)

    The ability was actually working right. I had swift swim for him, thought it was a new ability I made so I was thinking it wasn't working. So the only problem is giving it moves/ IV-EV boosts from a script. Thanks for the reply though.

    EDIT: Turns out, whenever I start a line with "poke" or pokemon, the game crashes after the battle. Very confused by all this.
     
    Last edited:
    your script doesn't define what poke is, so your game crashes. also you need to define the pokemon before starting a battle.

    Code:
    poke=PokeBattle_Pokemon.new(:SWAMPERT,30)
    poke.setAbility(1)
    poke.item=PBItems::ORANBERRY
    poke.pbDeleteMove(:FORESIGHT)
    poke.pbDeleteMove(:BIDE)
    poke.pbLearnMove(:MUDDYWATER)
    poke.pbLearnMove(:EARTHQUAKE)
    pbWildBattle(poke)

    This should work unless you made a typo in any of the poke scripts
     
    your script doesn't define what poke is, so your game crashes. also you need to define the pokemon before starting a battle.

    Code:
    poke=PokeBattle_Pokemon.new(:SWAMPERT,30)
    poke.setAbility(1)
    poke.item=PBItems::ORANBERRY
    poke.pbDeleteMove(:FORESIGHT)
    poke.pbDeleteMove(:BIDE)
    poke.pbLearnMove(:MUDDYWATER)
    poke.pbLearnMove(:EARTHQUAKE)
    pbWildBattle(poke)

    This should work unless you made a typo in any of the poke scripts

    Sorry about being so new at this. So you're script goes first in the event then another one that actually calls the battle?

    edit: I got the battle to end without an error. But the Swampert still knew the moves I tried deleting and didn't know any of the new ones. Can anyone help with that?
     
    Last edited:
    Sorry about being so new at this. So you're script goes first in the event then another one that actually calls the battle?

    edit: I got the battle to end without an error. But the Swampert still knew the moves I tried deleting and didn't know any of the new ones. Can anyone help with that?

    Try

    Code:
    poke.pbLearnMove(:MUDDYWATER,:EARTHQUAKE,:etc)
     
    Try

    Code:
    poke.pbLearnMove(:MUDDYWATER,:EARTHQUAKE,:etc)

    Didn't work. Also, I think I have something wrong because I set the gender to female and it's showing up male.

    Can't post pictures yet, but here's what the event looks like (Just get rid of the space).

    http: //i220.photobucket.com/albums/dd29/jadepuget1/ISSUES_zps6494a940.png
     
    Didn't work. Also, I think I have something wrong because I set the gender to female and it's showing up male.

    Can't post pictures yet, but here's what the event looks like (Just get rid of the space).

    http: //i220.photobucket.com/albums/dd29/jadepuget1/ISSUES_zps6494a940.png

    you have 2 events that start a wild battle, one with the defined Swampert and one with a normal one.

    anyway i tried the event myself and i ended up getting an error, gonna try and fix it on my own and tell you what happens
     
    Why don't you just make an event modifier activated by a switch? That's what the section is there for.
    Do this.

    You can't create a specific wild Pokémon to battle with (in the way you're trying). The only options you can give the battle are its species and level.

    That's where encounter modifiers come in. Have a look at the existing ones (particularly the one that makes Pokémon shiny when a given switch is on). Copy that, change the switch number, and make all your adjustments in there. Then be sure to turn that switch on and off around the event script call to the battle. See the shiny Mew in the example maps for how the event should look.
     
    Do this.

    You can't create a specific wild Pokémon to battle with (in the way you're trying). The only options you can give the battle are its species and level.

    That's where encounter modifiers come in. Have a look at the existing ones (particularly the one that makes Pokémon shiny when a given switch is on). Copy that, change the switch number, and make all your adjustments in there. Then be sure to turn that switch on and off around the event script call to the battle. See the shiny Mew in the example maps for how the event should look.

    (Please excuse my total lack of knowledge with this)

    So, the way the shiny modifier works. A switch is made and put in the settings script. Then in the script PokemonEncounterModifiers there's a code that actually makes them shiny.

    So would doing this be as simple as using the script I already made and plugging it in PokemonEncounterModifiers just with a different switch? Something like

    EDIT: Except change all the "poke" into "pokemon"?

    Code:
    pokemon=e[0]
     if $game_switches[SWAMPERT_SWITCH]
         poke.setAbility(1)
         poke.item=PBItems::ORANBERRY
         poke.pbDeleteMove(:FORESIGHT)  
         poke.pbDeleteMove(:BIDE) 
         poke.pbLearnMove(:MUDDYWATER)
         poke.pbLearnMove(:EARTHQUAKE)
         end
     
    You could bypass defining the switch in the Settings script section, and just use $game_switches[42] in the code you provided (or whichever number you choose). But yes, that looks about right (and do change poke into pokemon, because pokemon=e[0]).
     
    You'll want to add a few things so the game doesn't get an error:

    Code:
    # Swampert Event
    Events.onWildPokemonCreate+=proc {|sender,e|  
      pokemon=e[0]
       if $game_switches[SWAMPERT_EVENT_MOD] # <--- Whatever switch you used. 
         pokemon.setAbility(1)
         pokemon.item=PBItems::ORANBERRY
         pokemon.setGender(1)
         pokemon.pbDeleteMove(:FORESIGHT)  
         pokemon.pbDeleteMove(:BIDE) 
         pokemon.pbLearnMove(:MUDDYWATER)
         pokemon.pbLearnMove(:EARTHQUAKE)
       end
    }




    You could bypass defining the switch in the Settings script section, and just use $game_switches[42] in the code you provided (or whichever number you choose). But yes, that looks about right (and do change poke into pokemon, because pokemon=e[0]).

    Maruno, is it simple to make it so if an event encounter pokemon beats you it doesn't disappear? The mew event encounter has some variables and comments on it, i'm thinking that's what they were for? Like it's Comment: Caught. What is that for?
     
    You'll want to add a few things so the game doesn't get an error:

    Code:
    # Swampert Event
    Events.onWildPokemonCreate+=proc {|sender,e|  
      pokemon=e[0]
       if $game_switches[SWAMPERT_EVENT_MOD] # <--- Whatever switch you used. 
         pokemon.setAbility(1)
         pokemon.item=PBItems::ORANBERRY
         pokemon.setGender(1)
         pokemon.pbDeleteMove(:FORESIGHT)  
         pokemon.pbDeleteMove(:BIDE) 
         pokemon.pbLearnMove(:MUDDYWATER)
         pokemon.pbLearnMove(:EARTHQUAKE)
       end
    }






    Maruno, is it simple to make it so if an event encounter pokemon beats you it doesn't disappear? The mew event encounter has some variables and comments on it, i'm thinking that's what they were for? Like it's Comment: Caught. What is that for?

    Caught is for any event that happens after you catch the Pokemon. For example you can have a NPC come and talk to you about how you caught a rare pokemon.

    Unless you are using the continue after battle option, the Pokemon should still be there if it beats you. I do wonder, what happens to the switch.
     
    Back
    Top