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

Unidentified ghost pokemon

MrVokan

Developer of Pokémon FireRedux Overhaul
  • 13
    Posts
    10
    Years
    Hiya.

    I wanted to add ghost pokemon like those in pokemon tower in Fire Red, and so i followed the 'adding ghosts' tutorial on the pokemon essentials wikia page. Couldn't get it to work right so i added this to 'PField_EncounterModifiers and everything seemed to work.
    Code:
    if $game_switches[116]
         pokemon.species=PBSpecies::GHOST
         pokemon.level=15
         pokemon.name="Ghost"
        end

    However, i can't for the life of me figure out why i get "pokemon too scared to move" in trainer battles and why, when the ghost switch is disabled, all wild pokemon are named 'Ghost'. Even after deleting the code above from EncounterModifiers.

    I know i messed up somewhere, if anyone could shed some light on this it would be greatly appreaciated!
     
  • 129
    Posts
    8
    Years
    • Seen Mar 23, 2023
    The first step: open up a clean project in another instance of RMXP and start comparing relevant code so you can revert your project to before the attempt, then maybe try again. Then at least you'll be at a known starting point to try again, and we might be able to help you better.

    Looking at the tutorial now, it actually looks like the second half of the tutorial (the "Edit by dbzfanatic") has its logic backwards. He's testing $game_switches[170] == false, which blatantly does the exact opposite effect of the rest of the tutorial. Get rid of the == false parts (in both places) when you try again and maybe this time it'll function properly.

    If that works, someone will need to edit the tutorial to fix his mistake.
     

    MrVokan

    Developer of Pokémon FireRedux Overhaul
  • 13
    Posts
    10
    Years
    Hi tustin2121,

    After getting rid of the "== false" parts of the section of the tutorial edited by dbzfanatic, and toggling the switch for the ghosts ingame during play-testing, everything seems to work just fine.

    Thanks for pointing this out for me! :D
     

    MrVokan

    Developer of Pokémon FireRedux Overhaul
  • 13
    Posts
    10
    Years
    Excellent. I fixed the tutorial to get rid of those false checks. :)

    One last question;
    While everything seems to work as intended, I've noticed that during trainer battles, if the ghost switch is toggled on, you still get the "{1} is too scared to move!" and since its a trainer battle, you can not escape.

    Is it possible to add a check for when you're fighting a trainer? If so, how?
    Apologies if the answer is obvious, I'm still new to coding :)
     
  • 129
    Posts
    8
    Years
    • Seen Mar 23, 2023
    One last question;
    While everything seems to work as intended, I've noticed that during trainer battles, if the ghost switch is toggled on, you still get the "{1} is too scared to move!" and since its a trainer battle, you can not escape.

    Is it possible to add a check for when you're fighting a trainer? If so, how?
    Apologies if the answer is obvious, I'm still new to coding :)

    Well, the obvious answer is to make sure the ghost switch is never on when a trainer battle starts. So basically make sure you set it off before every trainer (and I guess back on again after depending on how you're setting it in the first place).

    If you're messing around in PokeBattle_Battle, however, you can check to see if you're currently fighting a trainer by checking if @opponent, as the @opponent instance variable will be nil if you are against a wild pokemon. So you could well do this:

    Code:
    if $game_switches[170] && !@opponent
      pbDisplay(_INTL("{1} is too scared to move!",@battlers[i].pbThis))
      return
    end

    But for the sake of not having all the various effects of ghosts pop up in the middle of a trainer battle, you still should make sure the ghost switch is off before a trainer battle begins. But applying the above at least means you don't have to lose to a trainer to escape a battle.
     
    Back
    Top