PDA

View Full Version : [Essentials script] Trainer Gender Select for Essentials


venom12
December 22nd, 2012, 06:26 AM
So here is my public scripts :) Gender Selection, on intro just call script "pbCallGenderSelect"

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

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

yakoo
December 22nd, 2012, 07:52 AM
you are a really genius (: definitive im going to use this! Thanks venom C:

carmaniac
December 22nd, 2012, 08:34 AM
you are a really genius (: definitive im going to use this! Thanks venom C:

It takes half a brain to make a script like this XD. Useful script though for those who don't know how to code. I guess.

WinterKirby
December 22nd, 2012, 09:18 AM
It takes half a brain to make a script like this XD. Useful script though for those who don't know how to code. I guess.

Well, I don't know how to code yet. (I'll learn it when I need to use it.)
However, I don't really see any point in which I'd need to use this at the moment.

tylerab01
December 22nd, 2012, 02:34 PM
This was the first thing @Carmaniac taught me how to script almost 3 years ago XD