• 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.
  • There is an important update regarding account security and 2FA. Please click here for more information.
  • ❤️ It's that time of the year again - Happy Valentine's Day! Luvdisc is back to help spread the luv again. Interested in sending a message of appreciation to some special users on the site, and earning a brand-new badge in the process? Then 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.
  • Imgur has blocked certain regions from viewing any images uploaded to their site. If you use Imgur, please consider replacing any image links/embeds you may have on PokéCommunity so everyone can see your images. Click here to learn more.

Some questions about Wild battle

  • 32
    Posts
    13
    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 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