• 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!
  • Serena, Kris, Dawn, Red - which Pokémon protagonist is your favorite? Let us know by voting in our grand final favorite protagonist poll!
  • PokéCommunity supports the Stop Killing Games movement. If you're a resident of the UK or EU, consider signing one of the petitions to stop publishers from destroying games. Click here for more information!
  • 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.

Some questions about Wild battle

  • 30
    Posts
    12
    Years
    • Seen Jul 26, 2015
    Hey, in RSE versions, when you're battling a zigzagoon, you can't flee, but the text is not "Can't escape", like in the essentials, there is another way to edit the text than editing the script? (i dont want this text permanent, just for this battle), and when the player's lifebar is in red color the wild pokemon flees.

    how can i do it? (that the wild pokemon flees and to change the text when can't escape).

    Thanks!
     
    You could always do the old favourite of using a Global Switch to decide whether this is your special battle, and display a different message if so. It's simple enough to set up. It'll be the first "Can't escape!" message in def pbRun.

    You can set up a wild battle as one which the player can't ever escape from. Check the wiki.

    The wild Pokémon fleeing is slightly more involved, but it works on the same principle. Check the def pbProcessTurn and copy-paste the "alwaysrun" bit (which is used for roaming Pokémon) and make it apply only while the Switch is ON and the player's Pokémon is weak.
     
    I didn't tell you to put anything in pbBeginTurn.

    Try using pbOpposing1.hp (I assume it'll be a single battle). Also, you've done the "if" statement wrong (you've deleted the hp check and some &&).
     
    i made it like that, below the original one, because i wanted to change the text (if i used "Or" statement it showed me only "fled" in the battle.

    if [email protected] && @battle.rules["alwaysflee"] && self.hp>0 &&
    @battle.pbIsOpposing?(self.index) && @battle.pbCanRun?(self.index)
    pbBeginTurn(choice)
    @battle.pbDisplay(_INTL("{1} fled!",self.pbThis))
    @battle.decision=3
    pbEndTurn(choice)
    return
    end
    if $game_switches[55] && pbOpposing1.hp<4
    pbBeginTurn(choice)
    @battle.pbDisplay(_INTL("Wild Zigzagoon fled!"))
    @battle.decision=3
    pbEndTurn(choice)
    return
    end

    It works, almost, the wild zigzagoon flees when his hp is low than 4, not when the player's hp is low than 4, i tried to change the pbOpposing1 to pbOppsing2 and then again to pbOppsing0, and it didnt work.
    (sry about my english, this is my second language)
     
    Oh, so you did put it in the right place.
    Code:
        if [email protected] &&
           $game_switches[55] && self.hp>0 && self.pbOpposing1.hp<=(self.pbOpposing1.totalhp/4) &&
           @battle.pbIsOpposing?(self.index) && @battle.pbCanRun?(self.index)
          pbBeginTurn(choice)
          @battle.pbDisplay(_INTL("{1} fled!",self.pbThis))
          @battle.decision=3
          pbEndTurn(choice)
          return
        end
    Use that. Your problem was that you'd deleted the @battle.pbIsOpposing?(self.index) bit, which meant that, in your game, the fleeing happened when either Pokémon reached a low HP, not just the wild Pokémon.

    The displayed message in my code will be "The wild Zigzagoon fled!", so you don't need to change it.
     
    i didnt knew how to do this only for the opponent, i'm not new in ruby, but i am new in essentials, Thannk you :)
    Edit: Works perfect :)
     
    Back
    Top