Thread: [Essentials script] Trainer Gender Select for Essentials
View Single Post
  #1    
Old December 22nd, 2012, 06:26 AM
venom12's Avatar
venom12
Pokemon Crystal Rain Relased
 
Join Date: Sep 2006
Age: 23
Gender: Male
Nature: Adamant
Send a message via Windows Live Messenger to venom12
So here is my public scripts Gender Selection, on intro just call script "pbCallGenderSelect"

http://dl.dropbox.com/u/4212314/gender.rar

Code:
class PokemonGenderSelectScene

def update
 pbUpdateSpriteHash(@sprites)
end

def pbStartScene

 @sprites={}
 @select=0
 @viewport=Viewport.new(0,0,Graphics.width,Graphics.height)
 @viewport.z=99999
 @sprites["card"]=IconSprite.new(0,0,@viewport)
 @sprites["card"].setBitmap("Graphics/Pictures/charaselectbg")
 
 @sprites["boy"]=IconSprite.new(0,0,@viewport)
 @sprites["boy"].setBitmap("Graphics/Pictures/charaselect_boy")
 @sprites["boy"].opacity=180
 
 @sprites["girl"]=IconSprite.new(0,0,@viewport)
 @sprites["girl"].setBitmap("Graphics/Pictures/charaselect_girl")
 @sprites["girl"].opacity=180
 
 pbFadeInAndShow(@sprites) { update }
end

def pbEndScene
  pbFadeOutAndHide(@sprites) { update }
  pbDisposeSpriteHash(@sprites)
  @viewport.dispose
end

  
    
def pbGenderSelect
 loop do
  Graphics.update
  Input.update
  self.update
  
  case @select
  when 0
    @sprites["boy"].opacity=255
    @sprites["girl"].opacity=180
  when 1
   @sprites["boy"].opacity=180
   @sprites["girl"].opacity=255
 end
 
if Input.trigger?(Input::RIGHT) and @select==0
 @select=1
end

if Input.trigger?(Input::LEFT) and @select==1
@select=0
end

if Input.trigger?(Input::C)
case @select
  when 0
  pbChangePlayer(0)
   #$game_variables[51]=0 #This is just if you want to activate a switch when you have other things for story
   $game_switches[320]=true #This is just if you want to activate a switch when you have other things for story
   break
  when 1
 pbChangePlayer(1)
  #$game_variables[51]=1 #This is just if you want to activate a switch when you have other things for story
   $game_switches[321]=true #This is just if you want to activate a switch when you have other things for story
   break
 end
end
 end 
end

end

class PokemonGenderSelect

def initialize(scene)
 @scene=scene
end

def pbStartScreen
 @scene.pbStartScene
 @scene.pbGenderSelect
 @scene.pbEndScene
end

end

def pbCallGenderSelect
    scene=PokemonGenderSelectScene.new
    screen=PokemonGenderSelect.new(scene)
    screen.pbStartScreen
end
__________________



Reply With Quote