• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

Pokémon Starter Selection [ADVANCED VERSION]

95
Posts
9
Years
bbenne6f.png


What does the script do?
The Script will create a cool cutscene where the player is able to choose his Pokémon.

Getting started:
- Download the Sprites from https://www.mediafire.com/?a9bxepawiuvtcrq and put them into your game.
- Copy the Script below into a new script section above Main, and call it "Pokemon Starter Selection"

Code:
#===============================================================================
# * Advanced Starter Selection Script for Pokémon Essentials by shiney570.
#
# Current Version: V1.0
# 
# 
# * If you have any questions or found a bug let me know.
# * Contact: Skype: imatrix.wt ;  DeviantArt: shiney570
#===============================================================================
class PokemonStarterSelection
 
 
 STARTERLEVEL = 5 # Feel free to change the value for the Level of your Starters.

 # Whether you are using the Elite Battle System or not.
 USING_ELITE_BATTLE = true
 
 def initialize(pkmn1,pkmn2,pkmn3)
  
  @pkmn1=pkmn1; @pkmn2=pkmn2; @pkmn3=pkmn3
  
  @select=1
 
  @viewport=Viewport.new(0,0,Graphics.width,Graphics.height)
  @viewport.z=99999
  @sprites={}
  
  @sprites["black"]=IconSprite.new(0,0,@viewport)    
  @sprites["black"].setBitmap("Graphics/Pictures/black")
  @sprites["black"].opacity=0
  
  @sprites["bg"]=IconSprite.new(0,0,@viewport)    
  @sprites["bg"].setBitmap("Graphics/Pictures/bg")
  @sprites["bg"].opacity=0
  
  @sprites["ball_1"]=IconSprite.new(0,0,@viewport)
  @sprites["ball_1"].setBitmap("Graphics/Pictures/ball1")
  @sprites["ball_1"].x=90
  @sprites["ball_1"].y=154
  @sprites["ball_1"].opacity=0
  
  @sprites["ball_2"]=IconSprite.new(0,0,@viewport)
  @sprites["ball_2"].setBitmap("Graphics/Pictures/ball2")
  @sprites["ball_2"].x=206
  @sprites["ball_2"].y=147
  @sprites["ball_2"].opacity=0
      
  @sprites["ball_3"]=IconSprite.new(0,0,@viewport)
  @sprites["ball_3"].setBitmap("Graphics/Pictures/ball3")
  @sprites["ball_3"].x=330
  @sprites["ball_3"].y=151
  @sprites["ball_3"].opacity=0
  
  @sprites["select"]=IconSprite.new(0,0,@viewport)
  @sprites["select"].setBitmap("Graphics/Pictures/select")
  @sprites["select"].opacity=0
  @sprites["select"].x=5000
  
  @sprites["pkmn_1"]=IconSprite.new(0,0,@viewport)
  @sprites["pkmn_1"].setBitmap(sprintf("Graphics/Battlers/%03d",@pkmn1))
  @sprites["pkmn_1"].bitmap=AnimatedBitmapWrapper.new(sprintf("Graphics/Battlers/%03d",@pkmn1)).bitmap if USING_ELITE_BATTLE
  @sprites["pkmn_1"].x=340
  @sprites["pkmn_1"].y=120
  @sprites["pkmn_1"].opacity=0
  @sprites["pkmn_1"].ox = 104/2
  @sprites["pkmn_1"].oy =  96/2
  @sprites["pkmn_1"].zoom_x=1.5
  @sprites["pkmn_1"].zoom_y=1.5

  @sprites["pkmn_2"]=IconSprite.new(0,0,@viewport)
  @sprites["pkmn_2"].setBitmap(sprintf("Graphics/Battlers/%03d",@pkmn2))
  @sprites["pkmn_2"].bitmap=AnimatedBitmapWrapper.new(sprintf("Graphics/Battlers/%03d",@pkmn2)).bitmap if USING_ELITE_BATTLE
  @sprites["pkmn_2"].x=410
  @sprites["pkmn_2"].y=120
  @sprites["pkmn_2"].opacity=0
  @sprites["pkmn_2"].ox = 108/2
  @sprites["pkmn_2"].oy = 100/2
  @sprites["pkmn_2"].zoom_x=1.5
  @sprites["pkmn_2"].zoom_y=1.5
  
  @sprites["pkmn_3"]=IconSprite.new(0,0,@viewport)
  @sprites["pkmn_3"].setBitmap(sprintf("Graphics/Battlers/%03d",@pkmn3))
  @sprites["pkmn_3"].bitmap=AnimatedBitmapWrapper.new(sprintf("Graphics/Battlers/%03d",@pkmn3)).bitmap if USING_ELITE_BATTLE
  @sprites["pkmn_3"].x=170
  @sprites["pkmn_3"].y=120-10
  @sprites["pkmn_3"].opacity=0
  @sprites["pkmn_3"].ox = 105/2
  @sprites["pkmn_3"].oy =  95/2
  @sprites["pkmn_3"].zoom_x=1.5
  @sprites["pkmn_3"].zoom_y=1.5
  
  @sprites["overlay"]=BitmapSprite.new(Graphics.width, Graphics.height, @viewport)
  @sprites["overlay"].opacity=0
  
  @data={}
  @data["pkmn_1"]=PokeBattle_Pokemon.new(@pkmn1,STARTERLEVEL)
  @data["pkmn_2"]=PokeBattle_Pokemon.new(@pkmn2,STARTERLEVEL)
  @data["pkmn_3"]=PokeBattle_Pokemon.new(@pkmn3,STARTERLEVEL)
  @pokemon=@data["pkmn_#{@select}"]    
  self.openscene
 end
 
 def openscene
  25.times do
    @sprites["black"].opacity+=10.2
    @sprites["bg"].opacity+=10.2
    @sprites["ball_1"].opacity+=10.2
    @sprites["ball_2"].opacity+=10.2
    @sprites["ball_3"].opacity+=10.2
    @sprites["select"].opacity+=10.2
    pbWait(1)
  end
  self.gettinginput
  self.input_action
 end
 
 def closescene
  25.times do
    @sprites["black"].opacity-=10.2
    @sprites["bg"].opacity-=10.2
    @sprites["ball_1"].opacity-=10.2
    @sprites["ball_2"].opacity-=10.2
    @sprites["ball_3"].opacity-=10.2
    @sprites["select"].opacity-=10.2
    @sprites["pkmn_1"].opacity-=10.2
    @sprites["pkmn_2"].opacity-=10.2
    @sprites["pkmn_3"].opacity-=10.2
    @sprite.opacity-=10.2
    @sprites["pkmn_#{@select}"].opacity-=10.2
    @sprites["overlay"].opacity-=10.2
    pbWait(1)
    end      
  end
 
 def gettinginput
  if Input.trigger?(Input::RIGHT)  && @select <3
    @select+=1
  end
  if Input.trigger?(Input::LEFT) && @select >1
    @select-=1
  end
  pokemon=[@pkmn1,@pkmn2,@pkmn3]
  @pkmn_array=pokemon
  if defined?($mouse)
    for i in 1...4
      if $mouse.over?(@sprites["ball_#{i}"]) && !$mouse.isStatic?
        @select=i
      end
    end
    if $mouse.leftClick?(@sprites["ball_#{@select}"])
      pressBall
    end
  end
  if Input.trigger?(Input::C) 
    pressBall
  end
 end
 
 def pressBall
  @sprites["select"].visible=false
  20.times do
    @sprites["pkmn_#{@select}"].opacity+=255/20
    @sprite.opacity+=255/20; @sprites["overlay"].opacity+=255/20
    @sprites["ball_#{@select}"].x-=4; @sprites["ball_#{@select}"].y-=4
    @sprites["ball_#{@select}"].zoom_x+=0.05; @sprites["ball_#{@select}"].zoom_y+=0.05
    for j in 1...4
      @sprites["ball_#{j}"].opacity-=10 if !(j==@select)
      if @select==2#
      @sprites["ball_1"].x-=1
      else#
      @sprites["ball_#{j}"].x-=2 if !(j==@select) && @select>1
    end#
  end      
  @sprites["bg"].opacity-=10
  pbWait(1)
  end
  @sprites["pkmn_#{@select}"].visible=true
  @sprite.visible=true
  pbSEPlay(sprintf("%03dCry",@pkmn_array[@select-1]))
  pbWait(20)
  if Kernel.pbConfirmMessage("Do you want #{@pokemon.name}?")
    pbAddPokemon(@pkmn_array[@select-1],STARTERLEVEL)
    $game_variables[7]=@select
    self.closescene
  else
    20.times do
      @sprites["pkmn_#{@select}"].opacity-=255/20
      @sprite.opacity-=255/20; @sprites["overlay"].opacity-=255/20
      @sprites["ball_#{@select}"].x+=4; @sprites["ball_#{@select}"].y+=4
      @sprites["ball_#{@select}"].zoom_x-=0.05; @sprites["ball_#{@select}"].zoom_y-=0.05
      for j in 1...4
        @sprites["ball_#{j}"].opacity+=10 if !(j==@select)
          if @select==2
          @sprites["ball_1"].x+=1
          else
          @sprites["ball_#{j}"].x+=2 if !(j==@select) && @select>1
        end
      end  
      @sprites["bg"].opacity+=10
      pbWait(1)
    end
      @sprites["pkmn_#{@select}"].visible=false
      @sprite.visible=false
      @sprites["select"].visible=true
    end
  end
    
 def input_action
  x=[5000,109,229,353]
  y=[5000,54 ,45 ,51 ]
  while $game_variables[7]==0
    Graphics.update
    Input.update
    @pokemon=@data["pkmn_#{@select}"]
    self.gettinginput
    @sprites["select"].x=x[@select]
    @sprites["select"].y=y[@select]
    self.text; self.typebitmap
  end
 end

 def text
  overlay= @sprites["overlay"].bitmap
  overlay.clear
  baseColor=Color.new(255, 255, 255)
  shadowColor=Color.new(0,0,0)
  pbSetSystemFont(@sprites["overlay"].bitmap)
  name_x=[5000,273,343,103] # -70
  textos=[]
  textos.push([_INTL("{1}", @pokemon.name),name_x[@select],10,false,baseColor,shadowColor])
  pbDrawTextPositions(overlay,textos)
 end

 def typebitmap
  
  @sprite=Sprite.new(@viewport)
  @sprite.bitmap=Bitmap.new(194,28)
  @sprite.y=171
  
  @sprite.opacity=0
  @bitmap=BitmapCache.load_bitmap("Graphics/Pictures/types")
  
  @type1rect=Rect.new(0,@pokemon.type1*28,64,28)
  @type2rect=Rect.new(0,@pokemon.type2*28,64,28)
  
  typex=[5000,-120,-50,-285]
  
  if @[email protected]
    @sprite.x=402+typex[@select]
    @sprite.bitmap.blt(0,0,@bitmap,@type1rect)
  else
    @sprite.x=370+typex[@select]
    @sprite.bitmap.blt(0,0,@bitmap,@type1rect)
    @sprite.bitmap.blt(66,0,@bitmap,@type2rect)
  end
 end
end

If you are using the Elite Battle 2015 System then set USING_ELITE_BATTLE (in line 16) to true!

You can change the Level of the Starter Pokémon by editing the line (In this case, the Level for the Starters is 5.) :
Code:
STARTERLEVEL = 5

To Call the Script use:
PokemonStarterSelection.new(
1,4,7)

To change the Pokémon in the Starter Selection, change the three values to the number of the Pokémon in the pokemon.txt file.
so it's build like that: PokemonStarterSelection.new(PokémonNumber1,PokémonNumber2,PokémonNumber3)

Example:
PokemonStarterSelection.new(
1,155,258)

to choose between bulbasaur(1),cyndaquil(155) and mudkip(258).

NOTE: This script does also include mouse inputs which means that it's compatible with Luka S.J's mouse module. If you are not using it you won't get any errors either.

If you found bug or need support feel free to contact me!
 
Last edited:
4
Posts
9
Years
  • Age 30
  • Seen Jun 22, 2016
what do i do wrong?
---------------------------
Pokemon Light Speed Rescue
---------------------------
Exception: RuntimeError

Message: Script error within event 31, map 22 (Route 1):

Exception: NoMethodError

Message: Section150:71:in `initialize'undefined method `bitmap' for (0, 0, 160, 160):Rect

***Full script:

PokemonStarterSelection.new(
1,4,7)


Interpreter:243:in `pbExecuteScript'

(eval):1:in `new'

(eval):1:in `pbExecuteScript'

Interpreter:1606:in `eval'

Interpreter:243:in `pbExecuteScript'

Interpreter:1606:in `command_355'

Interpreter:494:in `execute_command'

Interpreter:193:in `update'

Interpreter:106:in `loop'

Interpreter:198:in `update'



Interpreter:276:in `pbExecuteScript'

Interpreter:1606:in `command_355'

Interpreter:494:in `execute_command'

Interpreter:193:in `update'

Interpreter:106:in `loop'

Interpreter:198:in `update'

Scene_Map:103:in `update'

Scene_Map:101:in `loop'

Scene_Map:114:in `update'

Scene_Map:68:in `main'



This exception was logged in

C:\Users\Asus X550D\Saved Games/Pokemon Light Speed Rescue/errorlog.txt.

Press Ctrl+C to copy this message to the clipboard.
---------------------------
OK
---------------------------
 
95
Posts
9
Years
For zeak it works pretty well...
A possible reason for this is, that you used the BitmapWrapper line's, if you haven't got Pokémon Elite battle 2015.
Personally i tested the script often, and never encountered that bug.
 
95
Posts
9
Years
Of course you only should use the Bitmap Wrapper lines, if you use the Elite battle 2015 system/script.
otherwise it's fully understandable, that you get the error, because the method wasn't definied in the Stock Essentials.
 
220
Posts
9
Years
Hi, i love your script. What change i must do for this script to work in pokemon essentials without elite battle 2015 and without mouse module?
 

Zeak6464

Zeak #3205 - Discord
1,101
Posts
11
Years
  • Age 31
  • USA
  • Seen Oct 9, 2023
Hi, i love your script. What change i must do for this script to work in pokemon essentials without elite battle 2015 and without mouse module?

please read.....

Spoiler:
 
119
Posts
10
Years
i have also the same error, and yes i have read it fully. is this tested with v15.1 or in v14? because this error is with v15.1

Spoiler:
 
220
Posts
9
Years
Hmm... I think if i erase this part of code maybe it will works? I'm not sure. :/

def typebitmap

@sprite=Sprite.new(@viewport)
@sprite.bitmap=Bitmap.new(194,28)
@sprite.y=171

@sprite.opacity=0
@bitmap=BitmapCache.load_bitmap("Graphics/Pictures/types")

@type1rect=Rect.new(0,@pokemon.type1*28,64,28)
@type2rect=Rect.new(0,@pokemon.type2*28,64,28)

typex=[5000,-120,-50,-285]

if @[email protected]
@sprite.x=402+typex[@select]
@sprite.bitmap.blt(0,0,@bitmap,@type1rect)
else
@sprite.x=370+typex[@select]
@sprite.bitmap.blt(0,0,@bitmap,@type1rect)
@sprite.bitmap.blt(66,0,@bitmap,@type2rect)
end
end
end
 
95
Posts
9
Years
Guys, i'll fix this on saturday hope you can wait 5 days :/ i dont know if the script is compatible with version 15.1, but 15 and lower should work. Just watch this thread on saturday again, if it won't work for you ;)
 
119
Posts
10
Years
Guys, i'll fix this on saturday hope you can wait 5 days :/ i dont know if the script is compatible with version 15.1, but 15 and lower should work. Just watch this thread on saturday again, if it won't work for you ;)

alright thanks :) ill be waiting haha

EDIT : so for some reason it seems to work fine with the Elite Battle script, and changing the lines to the animated bitmap wrappers. but if you dont have the elite battle script and just copy and paste the normal Starter Selection script thats what doesnt work.
 
Last edited:
4
Posts
9
Years
  • Age 30
  • Seen Jun 22, 2016
the error that i get(remove space) : h ttp://fc01.deviantart.net/fs71/f/2015/058/7/0/error_by_wachahaikkdishart-d8jrg4i.png
what changes should i make?
 
39
Posts
9
Years
  • Age 26
  • Seen Mar 21, 2016
Its amazing bro, With the elite 2015 it works perfect, One thing that would be cool is that the pokeballs were animated...Like they are in some pokemon games (y)
 
95
Posts
9
Years
already thought about it, but i don't have the graphics for this, if you want to make them, let me know.
thanks for your feedback bro ;)
 
220
Posts
9
Years
I have a question, i'm using only this starter selection script without elite battle and mouse module scripts, so i'm using only the pokemon essentials v15 and i get this result: when the player activates the script the game freezes and nothing happens, so my question is: this script uses a variable? What name i must put in the variable to make it work?
 
95
Posts
9
Years
you mean the scene starts and ends after a second?
the reason for this is, that the script only works, when the game variable 7 "Starter choice" is 0 or undefinied. set the variable to 0,before you start the scene, if the scence ends after you started it.
 
220
Posts
9
Years
I found what is causing me trouble, i put the graphics in Graphics\Pictures location and not in Graphics\Pictures\StarterSelection and now it works perfectly but the pokemon, poke names and types are not well positioned, so i must rearrange the pictures.
 
Back
Top