Go Back   The PokéCommunity Forums > Creative Discussions > Game Development > Pokémon Essentials
Reload this Page [Question] Double battle versus 1 pokemon

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 February 6th, 2015 (09:41 AM).
Yero's Avatar
Yero Yero is offline
 
Join Date: Aug 2011
Location: Australia
Gender: Male
Nature: Brave
Posts: 61
We all got the idea of double Wild battles etc. but I am trying to force a double battle against 1 Wild/Trainer Pokemon. Like using your first 2 pokemon against one Legendary Pokemon. (Similar to the encounter against shadow Lugia in Gales of Darkness where you use two Pokemon against Verrich's one Lugia.)
For my game I try to do similar but then teaming up with a partner trainer and challenge Archie using only Kyogre. But I keep getting an error and can't figure it out. :-S

Any ideas?
Reply With Quote
  #2    
Old February 6th, 2015 (10:27 AM).
viperk1 viperk1 is offline
 
Join Date: Jan 2015
Gender: Male
Posts: 22
Could you post the error you're getting just so we can see what issue it is you're having? Can't really do anything to help if we don't have the full picture.
Reply With Quote
  #3    
Old February 6th, 2015 (10:40 AM).
Yero's Avatar
Yero Yero is offline
 
Join Date: Aug 2011
Location: Australia
Gender: Male
Nature: Brave
Posts: 61
Yes, sure!


So basically it mentions PokeBattle_Battle (ln. 2099) and PokemonTrainers (lns. 428-430) Logically there is a def that states that the opponent must have at least 2 or more Pokemon in order to call for a double battle, but I have been scanning thru all the Double defs. but can't find where to turn this off. I want to be able to do double battles even against a trainer with just one pokemon. (or one Legendary wild pokemon as an encounter)
Reply With Quote
  #4    
Old February 8th, 2015 (04:11 PM).
Badhaas's Avatar
Badhaas Badhaas is offline
 
Join Date: Jul 2013
Gender: Male
Posts: 96
I believe I've got this working. Yet I still have to run some tests, and really need some sleep now. So I'll update this post tomorrow (Monday) with the required code changes (for both trainers and wild encounters).
__________________

View my profile page for scripts/tutorials made by me, even ones which aren't posted yet.
(note: all projects temporarily postponed)
Reply With Quote
  #5    
Old February 9th, 2015 (03:01 AM).
Yero's Avatar
Yero Yero is offline
 
Join Date: Aug 2011
Location: Australia
Gender: Male
Nature: Brave
Posts: 61
That would be awesome! I have been checking the script and run tests for weeks but couldn't find this one trigger that keeps blocking this feature...
I have looked all over the forum and the essentials wiki and was surprised that there weren't any mentions about it before. (Although I couldn't find them) Thought it would be a quite general question to game-makers... :-)
Reply With Quote
  #6    
Old February 9th, 2015 (07:13 AM).
Badhaas's Avatar
Badhaas Badhaas is offline
 
Join Date: Jul 2013
Gender: Male
Posts: 96
To allow 2v1 against other trainers (this still requires the player to have 2 Pokémon on them) do the following:
- In PokemonTrainers find "battle.doublebattle=doublebattle" and remove the part which comes after it ("battle.pbDoubleBattleAllowed?() : false")
- In PokeBattle_Battle find the following section and add the red parts (it's just above "Initialize opponent in single battles")

Code:
        if sendout1<0 || sendout2<0
#          raise _INTL("Opponent doesn't have two unfainted Pokémon")
#        end
          sendout2 = nil
          pbDisplayBrief(_INTL("{1} sent\r\nout {2}!",@opponent.fullname,@party2[sendout1].name))
          @battlers[1].pbInitialize(@party2[sendout1],sendout1,false)
          @battlers[3].pbInitBlank
          @battlers[3].fainted = true
          pbSendOut(1,@party2[sendout1])
        else
          pbDisplayBrief(_INTL("{1} sent\r\nout {2} and {3}!",
            @opponent.fullname,@party2[sendout1].name,@party2[sendout2].name))
          @battlers[1].pbInitialize(@party2[sendout1],sendout1,false)
          @battlers[3].pbInitialize(@party2[sendout2],sendout2,false)
          pbSendOut(1,@party2[sendout1])
          pbSendOut(3,@party2[sendout2])
        end
That should do the trick. If it causes any bugs/crashes, then let me know.
__________________

View my profile page for scripts/tutorials made by me, even ones which aren't posted yet.
(note: all projects temporarily postponed)
Reply With Quote
  #7    
Old February 10th, 2015 (04:38 AM).
Yero's Avatar
Yero Yero is offline
 
Join Date: Aug 2011
Location: Australia
Gender: Male
Nature: Brave
Posts: 61
Hey Badhaas, thanks heaps for the scripting adjustment! It certainly removed some kinda lock on 2v1 battles. However almost there... Now it send an error at the time that the opponent actually have to send out the one pokemon he has.
It shows this message at this screenshot:



I've tried to adjust several other scripts around it, but can't get it past here. Any suggestions?
Reply With Quote
  #8    
Old February 10th, 2015 (09:26 AM). Edited February 10th, 2015 by Badhaas.
Badhaas's Avatar
Badhaas Badhaas is offline
 
Join Date: Jul 2013
Gender: Male
Posts: 96
Sorry, I forgot to add that part XD

To fix it find "attr_reader :fainted" in the PokeBattle_Battler script, and replace it with "attr_accessor :fainted"

Note: It's possible that the game starts giving an AI error (related to stealth rock), or only the first Pokémon acting during battle (if $). I got this after applying these changes, yet its a bug in essentials itself rather than these script changes. To fix it go to the PokeBattle_AI script; search for "StealthRock]>0" and replace it by "StealthRock]==true".
__________________

View my profile page for scripts/tutorials made by me, even ones which aren't posted yet.
(note: all projects temporarily postponed)
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 12:58 AM.