• Hi, Guest!
    Some images might be missing as we move away from using embedded images, sorry for the mess!
    From now on, you'll be required to use a third party to host images. You can learn how to add images here, and if your thread is missing images you can request them here.
    Do not use Discord to host any images you post, these links expire quickly!
Resource icon

v19 Trainer comments during Battle 2.0

This resource pertains to version 19 of Pokémon Essentials.
A couple years ago, I was working on my fangame and I required to add a way for trainer to make comments during a battle, like we see in canon games. I know it's possible with the Elite Battle system, but it doesn't fit my game style at all. So I came with my own solution, and posted it as a tutorial on Reddit.

I'm currently updating my own game to v19.1 (yeah I'm super late) and looking for a solution for that exact same issue, the only result I found… was my own tutorial. So I decided to update it and put it here !

It's actually very simple. If the line numbers don't match please tell me ; most of my scripts are heavily modified.

1) In Overworld_BattleStarting, at def pbTrainerBattle (line 452-453),
add taunt=nil after outcomeVar=1.

2) In Overworld_BattleStarting, in def pbTrainerBattleCore (line 420),
add battle.taunt = taunt after battle.items = foeItems.

3) In Overworld_BattleStarting, still in def pbTrainerBattleCore (line 495 AND 500)
add ,taunt after BOTH trainerPartyID,endSpeech

4) In Overworld_BattleStarting, in def pbTrainerBattleCore (line 390)
add taunt = arg[3] ? arg[3] : nil after foeItems.push(trainer.items)


5) In PokeBattle_Battle (line 89),
add attr_accessor :taunt after attr_reader :struggle.

6) In PokeBattle_Battle, in def initialize (line 122),
add @taunt = [] after @items = nil.

7) In Battle_StartAndEnd, in def pbStartBattleCore, after pbStartBattleSendOut(sendOuts) (line 270),
add this code :
Ruby:
if $game_switches[64] && taunt[0]
    @scene.pbShowOpponent(0)
    pbDisplay(_INTL(taunt[0]))
    sleep(0.3)
    taunt[0] = nil
    @scene.pbHideOpponent(0)
end

8) In Battle_Action_Switching, in def pbReplace, after pbSendOut([[idxBattler,party[idxParty]]]) (line 300),
add this code :
Ruby:
if $game_switches[64] && taunt[idxParty]
    @scene.pbShowOpponent(0)
    pbDisplay(_INTL(taunt[idxParty]))
    sleep(0.3)
    taunt[idxParty] = nil
    @scene.pbHideOpponent(0)
end

And that's all ! Now if you want to use these "taunts" (don't worry, it doesn't conflict with the move effect Taunt), you'll have to setup a few things for your Trainer event onmap :
Ruby:
<> Control Switches [0064: Taunt] = ON
<> Condition : Script :
   taunt=["taunt 1", "taunt 2", nil, nil, "taunt 5"]
   pbTrainerBattle(:BUGCATCHER,"Bob",_I("Damn, I lost."),false,0,false,1,taunt)
<>
<> else
<>
<> end
<> Control Switches [0064: Taunt] = OFF

In this example, Bugcatcher Bob have six Pokémon, and will taunt you when sending out the first, second and fifth. You can leave the sixth slot empty, but you HAVE to put nil for the gap slots.

It is bound to Control Switch 64 for myself. You can change it, but don't forget to modify each instance of $game_switches[64]. The sole purpose of this switch is so that the code isn't uselessly read for non-scripted battles.

·

Indeed, even if there is more than one opposing trainers, it will only show the first one. It could be managed for Battle_Action_Switching, but I couldn't find a solution for Battle_StartAndEnd as idxParty isn't set yet. Actually, the step n°5 is only useful if you ever plan to taunt on first turn.

·

Next time, I'll add a way to show a taunt when the last opposing Pokémon has only 25% of its HP left, like we can see in B/W during gym leader battles (before this mf uses a Full Heal).
Credits
none required
Author
Zeidra Senester
Views
1,545
First release
Last update
Rating
0.00 star(s) 0 ratings
Back
Top