• 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.

BW Gender Selection Screen

Nickalooose

--------------------
1,309
Posts
16
Years
  • Seen Dec 28, 2023
BW Gender Selection Screen *V2*

Hello, this is my first public Script that I have created and not helped or given advice on, made from scratch.

It is a basic version of a gender selection screen based on BW and BW2.
Quick to implement, no messing around.
Easy to manage.
Make your game look more professional.

How to add:
Simple, just throw this code into an empty script section above Main and name it GenderSelect.
Place all pictures into the Graphics/Pictures, folder.
Remove the Gender selection event within Prof. Oaks Intro (the "Are you a boy or a girl" part), and instead place this script:
Code:
[COLOR="Blue"]scene=GenderPickScene.new
screen=GenderPick.new(scene)
screen.pbStartScreen[/COLOR]

All pictures should be named:
Male = Select_A
Female = Select_B
Male Base = Select_ABase
Female Base = Select_BBase
.

All pictures can be edited of course and modifications to the script should be made.

Screenshots:
Spoiler:


Code:
Code:
#==============================================================================#
# V2 Created by Nickalooose
# Please Credit If used.
#==============================================================================#
# FIXES: Save issue.
#==============================================================================#
# How To Use:
# To use, remove the player gender event.
# The "Are you a boy or a girl", event.
# And add:
#         scene=GenderPickScene.new
#         screen=GenderPick.new(scene)
#         screen.pbStartScreen
# as a single script event.
#
# Sprites included, are at recommended size for a 512x384 standard
# Essentials game.
# Should work in any Essentials.
#==============================================================================#
class GenderPickScene
  
  def pbUpdate
    pbUpdateSpriteHash(@sprites)
  end
  
  def selectPlayer
    @select=0
    @sprites={}
    @viewport=Viewport.new(0,0,Graphics.width,Graphics.height)
    @viewport.z=99998
    @sprites["overlay"]=BitmapSprite.new(Graphics.width, Graphics.height)
    @sprites["overlay"].z = 99999
    @overlay=@sprites["overlay"].bitmap
    @overlay.clear
    # x is across
    # y is down
    # base a
    @sprites["playerabase"]=Sprite.new
    @sprites["playerabase"].z = 99998
    @sprites["playerabase"].x = -200#0
    @sprites["playerabase"].y = 102
    @sprites["playerabase"].bitmap= BitmapCache.load_bitmap("Graphics/Pictures/Select_ABase")
    # base b
    @sprites["playerbbase"]=Sprite.new
    @sprites["playerbbase"].z = 99998
    @sprites["playerbbase"].x = 456#256
    @sprites["playerbbase"].y = 102
    @sprites["playerbbase"].bitmap= BitmapCache.load_bitmap("Graphics/Pictures/Select_BBase")
    20.times do
      @sprites["playerabase"].x+=10
      @sprites["playerbbase"].x-=10
      Graphics.update
      Input.update
      pbUpdate    
    end
    # male
    @sprites["playera"]=Sprite.new
    @sprites["playera"].z = 99998
    @sprites["playera"].x = 50
    @sprites["playera"].y = 102
    @sprites["playera"].bitmap= BitmapCache.load_bitmap("Graphics/Pictures/Select_A")
    # female
    @sprites["playerb"]=Sprite.new
    @sprites["playerb"].z = 99998
    @sprites["playerb"].x = 380
    @sprites["playerb"].y = 102
    @sprites["playerb"].bitmap= BitmapCache.load_bitmap("Graphics/Pictures/Select_B")
    Kernel.pbMessage("Are you male or female?")
    loop do
      Graphics.update
      Input.update
      pbUpdate      
    if Input.trigger?(Input::C) && @select==0
      Kernel.pbMessage("You must be male or female.")
      Kernel.pbMessage("So, are you male or female?")
    end
    if Input.trigger?(Input::LEFT)
      if @select==1
        pbSEPlay("Choose")
        @select=2
        @sprites["playera"].color = Color.new(0, 0, 0, 200)#faded
        @sprites["playerabase"].color = Color.new(0, 0, 0, 200)#faded
        @sprites["playerb"].color = Color.new(0, 0, 0, 0)
        @sprites["playerbbase"].color = Color.new(0, 0, 0, 0)
      else
        pbSEPlay("Choose")
        @select=1
        @sprites["playerb"].color = Color.new(0, 0, 0, 200)
        @sprites["playerbbase"].color = Color.new(0, 0, 0, 200)
        @sprites["playera"].color = Color.new(0, 0, 0, 0)#faded
        @sprites["playerabase"].color = Color.new(0, 0, 0, 0)#faded
      end
    elsif Input.trigger?(Input::RIGHT)
      if @select==2
        pbSEPlay("Choose")
        @select=1
        @sprites["playerb"].color = Color.new(0, 0, 0, 200)
        @sprites["playerbbase"].color = Color.new(0, 0, 0, 200)
        @sprites["playera"].color = Color.new(0, 0, 0, 0)#faded
        @sprites["playerabase"].color = Color.new(0, 0, 0, 0)#faded
      else
        pbSEPlay("Choose")
        @select=2
        @sprites["playera"].color = Color.new(0, 0, 0, 200)#faded
        @sprites["playerabase"].color = Color.new(0, 0, 0, 200)#faded
        @sprites["playerb"].color = Color.new(0, 0, 0, 0)
        @sprites["playerbbase"].color = Color.new(0, 0, 0, 0)
      end
    elsif Input.trigger?(Input::UP)
      if @select==1
        pbSEPlay("Choose")
        @select=2
        @sprites["playera"].color = Color.new(0, 0, 0, 200)#faded
        @sprites["playerabase"].color = Color.new(0, 0, 0, 200)#faded
        @sprites["playerb"].color = Color.new(0, 0, 0, 0)
        @sprites["playerbbase"].color = Color.new(0, 0, 0, 0)
      else
        pbSEPlay("Choose")
        @select=1
        @sprites["playerb"].color = Color.new(0, 0, 0, 200)
        @sprites["playerbbase"].color = Color.new(0, 0, 0, 200)
        @sprites["playera"].color = Color.new(0, 0, 0, 0)#faded
        @sprites["playerabase"].color = Color.new(0, 0, 0, 0)#faded
      end
    elsif Input.trigger?(Input::DOWN)
      if @select==2
        pbSEPlay("Choose")
        @select=1
        @sprites["playerb"].color = Color.new(0, 0, 0, 200)
        @sprites["playerbbase"].color = Color.new(0, 0, 0, 200)
        @sprites["playera"].color = Color.new(0, 0, 0, 0)#faded
        @sprites["playerabase"].color = Color.new(0, 0, 0, 0)#faded
      else
        pbSEPlay("Choose")
        @select=2
        @sprites["playera"].color = Color.new(0, 0, 0, 200)#faded
        @sprites["playerabase"].color = Color.new(0, 0, 0, 200)#faded
        @sprites["playerb"].color = Color.new(0, 0, 0, 0)
        @sprites["playerbbase"].color = Color.new(0, 0, 0, 0)
      end
    end
    if Input.trigger?(Input::C) && @select==1
      pbSEPlay("Choose")
      19.times do
        @sprites["playera"].x+=9#192
        @sprites["playerabase"].x-=10
        @sprites["playerbbase"].x+=10
        @sprites["playerb"].x+=10#192
        Graphics.update
        Input.update
        pbUpdate
      end
      @sprites["playerabase"].opacity=0
      @sprites["playerb"].opacity=0
      @sprites["playerbbase"].opacity=0
      pbWait(20)
      if Kernel.pbConfirmMessage("So, you are male?")
        pbChangePlayer(0)
        pbEndScene
        return true
      else
        @sprites["playerabase"].opacity=255
        @sprites["playerb"].opacity=255
        @sprites["playerbbase"].opacity=255
        19.times do
          @sprites["playera"].x-=9#192
          @sprites["playerabase"].x+=10
          @sprites["playerbbase"].x-=10
          @sprites["playerb"].x-=10#192
          Graphics.update
          Input.update
          pbUpdate
        end
      end
    elsif Input.trigger?(Input::C) && @select==2
      pbSEPlay("Choose")
      19.times do
        @sprites["playerb"].x-=8#150
        @sprites["playerabase"].x-=10
        @sprites["playerbbase"].x+=10
        @sprites["playera"].x-=9#192
        Graphics.update
        Input.update
        pbUpdate
      end
      @sprites["playerabase"].opacity=0
      @sprites["playera"].opacity=0
      @sprites["playerbbase"].opacity=0
      pbWait(20)
      if Kernel.pbConfirmMessage("So, you are female?")
        pbChangePlayer(1)
        pbEndScene
        return true
      else
        @sprites["playerabase"].opacity=255
        @sprites["playera"].opacity=255
        @sprites["playerbbase"].opacity=255
        19.times do
          @sprites["playerb"].x+=8#50
          @sprites["playerabase"].x+=10
          @sprites["playerbbase"].x-=10
          @sprites["playera"].x+=9#192
          Graphics.update
          Input.update
          pbUpdate
        end
      end
    end
  end
end
  
  def pbEndScene
    pbFadeOutAndHide(@sprites){pbUpdate}
    pbDisposeSpriteHash(@sprites)
    @viewport.dispose
  end
end

class GenderPick
  def initialize(scene)
    @scene=scene
  end

  def pbStartScreen
    @scene.selectPlayer
    @scene.pbEndScene
  end
end

Credit me if used and if modifications are used.
Enjoy.

V2 FIXES:
Spoiler:
 
Last edited:

Harvey_Create

Pokemon Apex Team Member
187
Posts
11
Years
  • Age 27
  • Iowa
  • Seen Jul 12, 2015
And to think i was going to make this myself. :L Thanks Man

And this works on Essentials 9 as well!
 
Last edited:

Derxwna Kapsyla

Derxwna "The Badman" Kapsyla
437
Posts
12
Years
How would you go about tweaking the script so that, when you select a character, it activates a certain switch.
For example, if you picked the Male Character, it sets a switch named "Male Character Selected" to ON, and the same for Female, except it sets "Female Character Selected" to ON.
Have a screenshot for visual aid
b97b61b8fd09d9a465eaf06033962ab2.png
 

Nickalooose

--------------------
1,309
Posts
16
Years
  • Seen Dec 28, 2023
Go into the script and add:
$game_switches[x]=true.
Underneath lines 152 and 185, where x is the number of your switch.
 

Maruno

Lead Dev of Pokémon Essentials
5,285
Posts
16
Years
I would've gone for checking the player's gender afterwards and fiddling with switches based on that.
 

Nickalooose

--------------------
1,309
Posts
16
Years
  • Seen Dec 28, 2023
You're right, and I did write that out, but most people don't understand conditional branches let alone explanations of them, it was easier to just add that for him and others that haven't learnt rmxp yet, have a solution before the question "my switch always returns female, why?" lol
 

Dylanrockin

That guy
276
Posts
12
Years
  • Age 28
  • Seen Jun 9, 2016
I have one question, it relates to the above questioned by Derxwna Kapsyla. I was wondering if you can have separate starting points. Because with the default intro in Pokemon Essentials you can easily add specific starting points based on the gender the character chose. And since it is a script I was wondering a way that I can make it so that if someone chose the female character they would start somewhere completely different from where the male character starts.
 

Maruno

Lead Dev of Pokémon Essentials
5,285
Posts
16
Years
I have one question, it relates to the above questioned by Derxwna Kapsyla. I was wondering if you can have separate starting points. Because with the default intro in Pokemon Essentials you can easily add specific starting points based on the gender the character chose. And since it is a script I was wondering a way that I can make it so that if someone chose the female character they would start somewhere completely different from where the male character starts.
That's beyond the scope of this tutorial. It's also a basic RMXP skill and involves, yes, a conditional branch. Have a look at the intro event, figure out which line transfers the player to a new map (there is only one line for this), and stick a conditional branch around it.
 

Nickalooose

--------------------
1,309
Posts
16
Years
  • Seen Dec 28, 2023
Like Maruno said, this script is to allow a visual, better looking way to pick Genders only... For things like switches and variables, other pictures or speeches, you will need to add them, before or after the selectPlayer script... This script will do nothing more than pick whether you are a boy or girl (as is intended).
 

Nickalooose

--------------------
1,309
Posts
16
Years
  • Seen Dec 28, 2023
Anyone using this script will need to update to the new one, the older one is acting like a little 5 year old and stops you from saving, but the problem is fixed nonetheless. Sorry for the inconveniences caused. Let me know if any new problems pop up.

For the fix and how to work, change selectPlayer within your event (if you already put this in your game), to:
scene=GenderPickScene.new
screen=GenderPick.new(scene)
screen.pbStartScreen
 
29
Posts
10
Years
  • Seen Sep 9, 2013
help me

Exception: RuntimeError
Message: Script error within event 1, map 1 (Intro):
Exception: SyntaxError
Message: (eval):3:in `pbExecuteScript'compile error
(eval):3: syntax error
***Full script:
scene=GenderPickScene.new
screen=GenderPick.new(scene)
screen.pbStartScreen.


Interpreter:276:in `pbExecuteScript'
Interpreter:1600: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'
 

Nickalooose

--------------------
1,309
Posts
16
Years
  • Seen Dec 28, 2023
Remove the final full stop, it shouldn't be there.
 
Last edited:

Rayquaza.

Lead Dev in Pokémon Order and Chaos
702
Posts
12
Years
In my opinion this script seems a bit needless because it is perfectly easy to make the same thing using events and switches (with zero scripting knowledge) and I should know; I have this sort of thing in my game.
 

Nickalooose

--------------------
1,309
Posts
16
Years
  • Seen Dec 28, 2023
In my opinion this script seems a bit needless because it is perfectly easy to make the same thing using events and switches (with zero scripting knowledge) and I should know; I have this sort of thing in my game.

True, but why bother spending valuable minutes eventing something like this, when you can add it in 10 seconds, using this.
 

Chrisario

Friend code :0018 2912 2366 let me know
108
Posts
10
Years
I need help with this where in the script should I put

here is something that a tried but this looks not right
Spoiler:
 
Last edited:

TheKenny

The only real Kenny!
41
Posts
12
Years
Would it be possible to reattach the files even though the thread is a bit older? Thanks in advance! :)
 
66
Posts
11
Years
  • Seen Feb 9, 2017
Would it be possible to reattach the files even though the thread is a bit older? Thanks in advance! :)
I'm not sure if you still need the Images and I've been told by Nickalooose (the creator of this script) actually has the script in my game and the images (which I didn't know), but I have the images if you're still interested.
I can't edit the main post so I'll have to add them here sorry.
Select_BBase_zpsesax0duo.png
Select_ABase_zpsgxcer11q.png

Select_B_zpsqtrj7zre.png
Select_A_zpso3svxbbw.png

I guess all you need to do is save the images and put them in to the graphics folder, just make sure they are named correctly like in the first post.
 
5
Posts
5
Years
  • Age 25
  • Seen Aug 24, 2023
Spoiler:


I'm trying to fix this so it is more central, starting at the edges of the screen and maybe scaling them to be bigger if I can. Where in the code should I mess with those values? I think it's at the top, but I'm new to Ruby and wanted to make sure.
 
Last edited:
1,805
Posts
7
Years
  • Age 30
  • USA
  • Seen Jan 15, 2024
Spoiler:


I'm trying to fix this so it is more central, starting at the edges of the screen and maybe scaling them to be bigger if I can. Where in the code should I mess with those values? I think it's at the top, but I'm new to Ruby and wanted to make sure.



The code was written in 2013 so it's likely 1 of two options

1) double the relevant img sizes
2) it isn't supported any more
 
Back
Top