Go Back   The PokéCommunity Forums > Creative Discussions > Game Development > Pokémon Essentials
Reload this Page [Question] Some questions about Wild battle

Notices
For all updates, view the main page.

Pokémon Essentials All questions and discussion about Pokémon Essentials, the Pokémon game kit for RPG Maker XP, go in here. Also contains links to the latest downloads and the Essentials Wiki.



Reply
 
Thread Tools
  #1    
Old April 1st, 2013 (08:17 AM).
Littleroot's Avatar
Littleroot Littleroot is offline
...
 
Join Date: Jul 2012
Gender: Male
Nature: Adamant
Posts: 29
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!
Reply With Quote
  #2    
Old April 1st, 2013 (09:47 AM).
Maruno's Avatar
Maruno Maruno is offline
Lead Dev of Pokémon Essentials
Moderator
 
Join Date: Jan 2008
Location: England
Posts: 4,070
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.
__________________
Reply With Quote
  #3    
Old April 1st, 2013 (12:15 PM).
Maruno's Avatar
Maruno Maruno is offline
Lead Dev of Pokémon Essentials
Moderator
 
Join Date: Jan 2008
Location: England
Posts: 4,070
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 &&).
__________________
Reply With Quote
  #4    
Old April 2nd, 2013 (12:37 AM).
Littleroot's Avatar
Littleroot Littleroot is offline
...
 
Join Date: Jul 2012
Gender: Male
Nature: Adamant
Posts: 29
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.

Quote:
if !@battle.opponent && @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)
Reply With Quote
  #5    
Old April 2nd, 2013 (03:53 AM).
Maruno's Avatar
Maruno Maruno is offline
Lead Dev of Pokémon Essentials
Moderator
 
Join Date: Jan 2008
Location: England
Posts: 4,070
Oh, so you did put it in the right place.
Code:
    if !@battle.opponent &&
       $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.
__________________
Reply With Quote
  #6    
Old April 2nd, 2013 (04:14 AM).
Littleroot's Avatar
Littleroot Littleroot is offline
...
 
Join Date: Jul 2012
Gender: Male
Nature: Adamant
Posts: 29
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
Reply With Quote
Reply
Quick Reply

Sponsored Links
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are UTC -8. The time now is 04:36 PM.