FANDOM


Last sent out pokemon BGM
This tutorial was written by Elyssia (a.k.a. R3zonance), with the script by Venom12

Updated for additional options by The Red Mage. Please give credit.

Click here for more tutorials!


This tiny tutorial shows you how to add a script that check for sent out Opponent Pokémon and his/her's last in team.

If True on Last Pokémon available, the Battle Music should be able to change whenever the Switch is also set to on.

In this case as an example we will use Switch '112'.

And a MP3 file with the name 'GymLastPKMN.mp3' (adding .mp3 isn't needed, it will automatically scans for the file extension, just add 'GymLastPKMN' shown below)

What we will do:

  1. Making slight changes to PokeBattle_Battle script and Adding a Add-On script that checks for last sent out pokémon, made by venom12.
  2. How to use the script.

Making slight changes to PokeBattle_Battle script.

First of all you need to open your Project.

After opening the 'Script Editor'(quicker opened with the F11 hotkey) find around line 2232:

 def pbSendOut(index,pokemon)
   pbSetSeen(pokemon)
   @peer.pbOnEnteringBattle(self,pokemon)
   if pbIsOpposing?(index)
     @scene.pbTrainerSendOut(index,pokemon)

Add after:

     if $game_switches[112] and pbPokemonCount(@party2)==1
       pbBGMPlay("GymLastPKMN",100,100)
     end

For more options, such as having the trainer come out to speak, you can alternatively do this:

     if $game_switches[112] and pbPokemonCount(@party2)==1 #GymLeader1
       @scene.pbShowOpponent(0)
       pbBGMPlay("GymLastPKMN",100,100)
       pbDisplayPaused(_INTL("Insert Text Here!"))
       @scene.pbHideOpponent
     end

The downside, of course, is that you will need a separate switch for each specific message/opponent. But this can give you customization for each trainer and rival battle to give your game that much more.

Definition of pbBGMPlay("filename",volume_here,pitch_here) Only add the name + extension is only need if there are files with the same name! For those who doesn't know what an Extension is: .mp3 .exe .docx etc are Extensions

How to use the script

To use the script, you need to add the Switch '112'.

After, you need to let the script know when to function after Switch[122] has been enabled.

To make a new Switch, go to Event Mode(F8) and make a new Event by double clicking on the spot where you want the Event to be.

After, the editing windows should pop up.

Right click in the 'List of Event Commands', and select 'Insert Event'.

Then go to Page 1 Tab and select 'Control Switches'.

And add the Switch in there which you want to use, also don't forget to give it a name, just for the heads up!

First of all, you need the Event Mode(F8).

Place an event as example a Gym Leader...

The script should look like this: (This is an edited event on example map 026: Gym Example!)

Exampleforlastpkmn

Last Pokemon Script example

This is what it should look like! >>>

Now test the game and the script should be working just fine while the last Pokémon has been called in!

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.