Telemetius
Tele*
- 267
- Posts
- 9
- Years
- Italy
- Seen Jan 9, 2022
EDIT
Found a way! Solved! It's a bit of a long process and I need to write down all the edits but as soon as I'm 100% sure that it's safe for the game I think I'll post a tutorial.
Hello forum, I'm currently trying to set up a double battle against one trainer.
Except that I'd like for him/her to always send out just one Pokémon at the time.
I've located the part that takes care of the opponent's initial send out animation, of what they say etc. :
Now I think the interesting part is this one in red:
Since it's more complicated that I thought I'd appreciate anyone who could help me with this problem or just point me in the right direction (or just straight up tell me that it'd take a lot of time to do it and that it's better to find another way). Thank you :)
Found a way! Solved! It's a bit of a long process and I need to write down all the edits but as soon as I'm 100% sure that it's safe for the game I think I'll post a tutorial.
Hello forum, I'm currently trying to set up a double battle against one trainer.
Except that I'd like for him/her to always send out just one Pokémon at the time.
I've located the part that takes care of the opponent's initial send out animation, of what they say etc. :
Code:
#=======================================
# Initialize opponents in double battles
#=======================================
if @opponent.is_a?(Array)
if @opponent.length==1
@opponent=@opponent[0]
elsif @opponent.length!=2
raise _INTL("Opponents with zero or more than two people are not allowed")
end
end
if @player.is_a?(Array)
if @player.length==1
@player=@player[0]
elsif @player.length!=2
raise _INTL("Player trainers with zero or more than two people are not allowed")
end
end
@scene.pbStartBattle(self)
if @opponent.is_a?(Array)
pbDisplayPaused(_INTL("{1} and {2} want to battle!",@opponent[0].fullname,@opponent[1].fullname))
sendout1=pbFindNextUnfainted(@party2,0,pbSecondPartyBegin(1))
raise _INTL("Opponent 1 has no unfainted Pokémon") if sendout1 < 0
sendout2=pbFindNextUnfainted(@party2,pbSecondPartyBegin(1))
raise _INTL("Opponent 2 has no unfainted Pokémon") if sendout2 < 0
@battlers[1].pbInitialize(@party2[sendout1],sendout1,false)
@battlers[3].pbInitialize(@party2[sendout2],sendout2,false)
pbDisplayBrief(_INTL("{1} sent {2}! {3} sent {4}!",@opponent[0].fullname,getBattlerPokemon(@battlers[1]).name,@opponent[1].fullname,getBattlerPokemon(@battlers[3]).name))
pbSendOutInitial(@doublebattle,1,@party2[sendout1],3,@party2[sendout2])
else
pbDisplayPaused(_INTL("{1}\r\nwants to battle!",@opponent.fullname))
sendout1=pbFindNextUnfainted(@party2,0)
sendout2=pbFindNextUnfainted(@party2,sendout1+1)
if sendout1 < 0 || sendout2 < 0
raise _INTL("Opponent doesn't have two unfainted Pokémon")
end
@battlers[1].pbInitialize(@party2[sendout1],sendout1,false)
@battlers[3].pbInitialize(@party2[sendout2],sendout2,false)
pbDisplayBrief(_INTL("{1} sent {2} and {3}!",
@opponent.fullname,getBattlerPokemon(@battlers[1]).name,getBattlerPokemon(@battlers[3]).name))
pbSendOutInitial(@doublebattle,1,@party2[sendout1],3,@party2[sendout2])
end
else
Now I think the interesting part is this one in red:
Code:
[COLOR="Red"]pbDisplayPaused(_INTL("{1}\r\nwants to battle!",@opponent.fullname))
sendout1=pbFindNextUnfainted(@party2,0)
[COLOR="DarkOrchid"]sendout2=pbFindNextUnfainted(@party2,sendout1+1)[/COLOR]
[COLOR="PaleGreen"]#this will check what's the species of the second pokemon (removing it will crash the game)[/COLOR]
if sendout1 < 0 || sendout2 < 0
raise _INTL("Opponent doesn't have two unfainted Pokémon")
end
@battlers[1].pbInitialize(@party2[sendout1],sendout1,false)
@battlers[3].pbInitialize(@party2[sendout2],sendout2,false)
pbDisplayBrief(_INTL("{1} sent {2} and {3}!",
@opponent.fullname,getBattlerPokemon(@battlers[1]).name,getBattlerPokemon(@battlers[3]).name)) [COLOR="PaleGreen"]#this is just what the system will say, it's easy to edit[/COLOR]
[COLOR="DarkOrchid"]pbSendOutInitial(@doublebattle,1,@party2[sendout1],3,@party2[sendout2])[/COLOR][/COLOR]
[COLOR="PaleGreen"]#here's the actual animation, removing the ",3,@party2[sendout2]" part will make the game crash[/COLOR]
Since it's more complicated that I thought I'd appreciate anyone who could help me with this problem or just point me in the right direction (or just straight up tell me that it'd take a lot of time to do it and that it's better to find another way). Thank you :)
Last edited: