The PokéCommunity Forums  

Go Back   The PokéCommunity Forums > Creative Discussions > Game Development > Pokémon Essentials
Register New Account FAQ/Rules Chat Blogs Mark Forums Read

Notices

Pokémon Essentials All questions and discussion about Pokémon Essentials, the Pokémon game kit for RPG Maker XP, go in here. Also contains links to the latest downloads and the Essentials Wiki.



Reply
Thread Tools
  #1  
Unread September 12th, 2012, 08:00 AM
jim42's Avatar
jim42
Mime Jr.
 
Join Date: Jul 2009
Gender: Male
Hey guys,
I've been working on a starter selection screen for my game, and for the most part I have it working, with all the accompanying graphics and whatnot. Granted it's not the fanciest looking thing, but it does its job well enough. I just have a few things I need to address in order to continue working on it.

First up: at present, I've been hardcoding the starter Pokemon and their respective data, images etc into the script. I know I should really be using the @pokemon thing, and getting the names, types and number out of that, but I don't understand how it works, and I couldn't find like a def thing that describes how it operates or how to set it to a particular Pokemon. Oh, and at the completion of the screen, it should add the selected Pokemon to the party. Would someone please elaborate upon this function?

Secondly, I have some questions about message and choice windows. I was wondering if it was possible to display a smaller window, one line high, at the bottom of the screen, and containing text defined in the script. In addition, this window should have attached a choice window thingy with the yes and no thing, ensuring it aligns with the newer sized window. I've included an attachment to illustrate what I mean.

In addition, I've also included my current code. It's a bit messy, unfinished, and will be cleaned up in due time. Here it is:
Spoiler:
Code:
#==============================================================================#
# This is a script to display and handle a starter selection scene. It         #
# displays three Pokeballs, their corresponding Pokemon, and their basic data. #
# The player may use the arrow keys to select a Pokemon, and the C input to    #
# confirm their selection.                                                     #
#==============================================================================#
# Copyright Aaron J Richards, not to be used with the exception of testing for 
answers to my questions                     #
#==============================================================================#



class PokemonStarterSelectionScene
  def update
    pbUpdateSpriteHash(@sprites)
  end
  
  def pbStartScene
    @sprites={}
    @viewport=Viewport.new(0,0,Graphics.width,Graphics.height)
    @viewport.z=99999
    addBackgroundPlane(@sprites,"bg","starterbg",@viewport)
    @sprites["overlay"]=BitmapSprite.new(Graphics.width,Graphics.height,@viewport)
    pbSetSystemFont(@sprites["overlay"].bitmap)
    pbDrawStarterSelection
    pbFadeInAndShow(@sprites) { update }
  end
  
  def pbDrawStarterSelection
    overlay=@sprites["overlay"].bitmap
    overlay.clear
    shadowColor=Color.new(72,72,72)
    baseColor=Color.new(185,185,185)
    textPositions=[]
    textPositions.push([_INTL("Which Pokémon would you like?"),108,330,0,
                       baseColor,shadowColor])
    textPositions.push([_INTL("WWWWWWWWWW"),35,240,0,
                       baseColor,shadowColor])
    textPositions.push([_INTL("Electric"),477,204,1,
                       baseColor,shadowColor])
    textPositions.push([_INTL("Fighting"),477,240,1,
                       baseColor,shadowColor])
    textPositions.push([_INTL("Type"),477,276,1,
                       baseColor,shadowColor])
    #textPositions.push([pokename,35,220,0,
    #                   baseColor,shadowColor])
    #textPositions.push([_INTL("{1} Type",@pokemon.type1),477,220,1,
    #                   baseColor,shadowColor])
    pbDrawTextPositions(overlay,textPositions)
    
    imagePositions=[]
    imagePositions.push(["Graphics/Pictures/StarterBallShadow",9,105,0,0,-1,-1])
    imagePositions.push(["Graphics/Pictures/StarterBall",25,25,0,0,-1,-1])
    imagePositions.push(["Graphics/Pictures/StarterBallShadow",178,105,0,0,-1,-1])
    imagePositions.push(["Graphics/Pictures/StarterBall",194,25,0,0,-1,-1])
    imagePositions.push(["Graphics/Pictures/StarterBallShadow",347,105,0,0,-1,-1])
    imagePositions.push(["Graphics/Pictures/StarterBall",363,25,0,0,-1,-1])
    if $game_variables[26]==1
      imagePositions.push(["Graphics/Pictures/StarterSelector",25,25,0,0,-1,-1])
      imagePositions.push(["Graphics/Battlers/252",176,165,0,0,-1,-1])
    elsif $game_variables[26]==2
      imagePositions.push(["Graphics/Pictures/StarterSelector",194,25,0,0,-1,-1])
      imagePositions.push(["Graphics/Battlers/255",176,165,0,0,-1,-1])
    elsif $game_variables[26]==3
      imagePositions.push(["Graphics/Pictures/StarterSelector",363,25,0,0,-1,-1])
      imagePositions.push(["Graphics/Battlers/258",176,165,0,0,-1,-1])
    end
    pbDrawImagePositions(overlay,imagePositions)
  end
  
  def pbStarterSelection
    loop do
      Graphics.update
      Input.update
      self.update
      if Input.trigger?(Input::LEFT)
        $game_variables[26]-=1
        if $game_variables[26]<1
          $game_variables[26]+=3
        end            
        pbPlayCursorSE()
        pbDrawStarterSelection
      elsif Input.trigger?(Input::RIGHT) 
        $game_variables[26]+=1
        if $game_variables[26]>3
          $game_variables[26]-=3
        end
        pbPlayCursorSE()
        pbDrawStarterSelection
      elsif Input.trigger?(Input::C)
        if $game_variables[26]==1
          #Sure?
          break
        elsif $game_variables[26]==2
          #Sure?
          break
        elsif $game_variables[26]==3
          #Sure?
          break
        end
      end       
    end 
  end
  
  def pbEndScene
    pbFadeOutAndHide(@sprites) { update }
    pbDisposeSpriteHash(@sprites)
    @viewport.dispose
  end
end

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

  def pbStartScreen
    @scene.pbStartScene
    @scene.pbStarterSelection
    @scene.pbEndScene
  end
end
  
def pbShowStarterSelection
  pbFadeOutIn(99999) {
     scene=PokemonStarterSelectionScene.new
     screen=PokemonStarterSelection.new(scene)
     screen.pbStartScreen
  }
end

I also intend on somehow adding parameters to the script call such that the user can define their own starters without having to modify the code, but I'll get to that one I have to regular script working. Thanks in advance for any help, guys.
Cheers, Jim
Attached Thumbnails
demonstration.png‎  
Reply With Quote
  #2  
Unread September 13th, 2012, 08:59 PM
IceGod64's Avatar
IceGod64
My imagination.
 
Join Date: Oct 2008
Location: Castelia City
Age: 25
Gender: Male
Nature: Naive
Quote:
Originally Posted by jim42 View Post
Hey guys,
I've been working on a starter selection screen for my game, and for the most part I have it working, with all the accompanying graphics and whatnot. Granted it's not the fanciest looking thing, but it does its job well enough. I just have a few things I need to address in order to continue working on it.

First up: at present, I've been hardcoding the starter Pokemon and their respective data, images etc into the script. I know I should really be using the @pokemon thing, and getting the names, types and number out of that, but I don't understand how it works, and I couldn't find like a def thing that describes how it operates or how to set it to a particular Pokemon. Oh, and at the completion of the screen, it should add the selected Pokemon to the party. Would someone please elaborate upon this function?

Secondly, I have some questions about message and choice windows. I was wondering if it was possible to display a smaller window, one line high, at the bottom of the screen, and containing text defined in the script. In addition, this window should have attached a choice window thingy with the yes and no thing, ensuring it aligns with the newer sized window. I've included an attachment to illustrate what I mean.

In addition, I've also included my current code. It's a bit messy, unfinished, and will be cleaned up in due time. Here it is:
Spoiler:
Code:
#==============================================================================#
# This is a script to display and handle a starter selection scene. It         #
# displays three Pokeballs, their corresponding Pokemon, and their basic data. #
# The player may use the arrow keys to select a Pokemon, and the C input to    #
# confirm their selection.                                                     #
#==============================================================================#
# Copyright Aaron J Richards, not to be used with the exception of testing for 
answers to my questions                     #
#==============================================================================#



class PokemonStarterSelectionScene
  def update
    pbUpdateSpriteHash(@sprites)
  end
  
  def pbStartScene
    @sprites={}
    @viewport=Viewport.new(0,0,Graphics.width,Graphics.height)
    @viewport.z=99999
    addBackgroundPlane(@sprites,"bg","starterbg",@viewport)
    @sprites["overlay"]=BitmapSprite.new(Graphics.width,Graphics.height,@viewport)
    pbSetSystemFont(@sprites["overlay"].bitmap)
    pbDrawStarterSelection
    pbFadeInAndShow(@sprites) { update }
  end
  
  def pbDrawStarterSelection
    overlay=@sprites["overlay"].bitmap
    overlay.clear
    shadowColor=Color.new(72,72,72)
    baseColor=Color.new(185,185,185)
    textPositions=[]
    textPositions.push([_INTL("Which Pokémon would you like?"),108,330,0,
                       baseColor,shadowColor])
    textPositions.push([_INTL("WWWWWWWWWW"),35,240,0,
                       baseColor,shadowColor])
    textPositions.push([_INTL("Electric"),477,204,1,
                       baseColor,shadowColor])
    textPositions.push([_INTL("Fighting"),477,240,1,
                       baseColor,shadowColor])
    textPositions.push([_INTL("Type"),477,276,1,
                       baseColor,shadowColor])
    #textPositions.push([pokename,35,220,0,
    #                   baseColor,shadowColor])
    #textPositions.push([_INTL("{1} Type",@pokemon.type1),477,220,1,
    #                   baseColor,shadowColor])
    pbDrawTextPositions(overlay,textPositions)
    
    imagePositions=[]
    imagePositions.push(["Graphics/Pictures/StarterBallShadow",9,105,0,0,-1,-1])
    imagePositions.push(["Graphics/Pictures/StarterBall",25,25,0,0,-1,-1])
    imagePositions.push(["Graphics/Pictures/StarterBallShadow",178,105,0,0,-1,-1])
    imagePositions.push(["Graphics/Pictures/StarterBall",194,25,0,0,-1,-1])
    imagePositions.push(["Graphics/Pictures/StarterBallShadow",347,105,0,0,-1,-1])
    imagePositions.push(["Graphics/Pictures/StarterBall",363,25,0,0,-1,-1])
    if $game_variables[26]==1
      imagePositions.push(["Graphics/Pictures/StarterSelector",25,25,0,0,-1,-1])
      imagePositions.push(["Graphics/Battlers/252",176,165,0,0,-1,-1])
    elsif $game_variables[26]==2
      imagePositions.push(["Graphics/Pictures/StarterSelector",194,25,0,0,-1,-1])
      imagePositions.push(["Graphics/Battlers/255",176,165,0,0,-1,-1])
    elsif $game_variables[26]==3
      imagePositions.push(["Graphics/Pictures/StarterSelector",363,25,0,0,-1,-1])
      imagePositions.push(["Graphics/Battlers/258",176,165,0,0,-1,-1])
    end
    pbDrawImagePositions(overlay,imagePositions)
  end
  
  def pbStarterSelection
    loop do
      Graphics.update
      Input.update
      self.update
      if Input.trigger?(Input::LEFT)
        $game_variables[26]-=1
        if $game_variables[26]<1
          $game_variables[26]+=3
        end            
        pbPlayCursorSE()
        pbDrawStarterSelection
      elsif Input.trigger?(Input::RIGHT) 
        $game_variables[26]+=1
        if $game_variables[26]>3
          $game_variables[26]-=3
        end
        pbPlayCursorSE()
        pbDrawStarterSelection
      elsif Input.trigger?(Input::C)
        if $game_variables[26]==1
          #Sure?
          break
        elsif $game_variables[26]==2
          #Sure?
          break
        elsif $game_variables[26]==3
          #Sure?
          break
        end
      end       
    end 
  end
  
  def pbEndScene
    pbFadeOutAndHide(@sprites) { update }
    pbDisposeSpriteHash(@sprites)
    @viewport.dispose
  end
end

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

  def pbStartScreen
    @scene.pbStartScene
    @scene.pbStarterSelection
    @scene.pbEndScene
  end
end
  
def pbShowStarterSelection
  pbFadeOutIn(99999) {
     scene=PokemonStarterSelectionScene.new
     screen=PokemonStarterSelection.new(scene)
     screen.pbStartScreen
  }
end

I also intend on somehow adding parameters to the script call such that the user can define their own starters without having to modify the code, but I'll get to that one I have to regular script working. Thanks in advance for any help, guys.
Cheers, Jim
Here's an example of properly creating a Pokemon with a script:

Code:
def pbCreatePoke
  poke=PokeBattle_Pokemon.new(PBSpecies::EEVEE,25,$Trainer)
  poke.abilityflag = 2
  poke.happiness=160
  poke.item = PBItems::ORANBERRY
  poke.obtainLevel = 5
  poke.natureflag =  12
  pbAddToParty(poke)
end
This is in the general ballpark of what kind of stuff you might want to do in terms of actually giving the Pokémon.

As for double checking is that's what the player wants, try something like:

Code:
if pbDisplayConfirm(_INTL("is this the Pokémon you want?"))
 pbCreatePoke
 $scene = Scene_Map.new
 return
else
 end
You might need to copy the def pbDisplayConfirm from another script (I think it's in PokemonSave)but that should do what you want.
__________________

Reply With Quote
  #3  
Unread September 14th, 2012, 01:16 PM
jim42's Avatar
jim42
Mime Jr.
 
Join Date: Jul 2009
Gender: Male
Thanks for the assistance, IceGod. I modified the add Pokemon script a bit and added it in the Input::C section, where it belongs, along with the confirmation message. Speaking of which, I didn't have to copy any scripts, I just had to use "Kernel.ConfirmMessage(blahblahblah)".

However, what you suggested only half answers my questions. I still have to hardcode the Pokemon data, and I still need to know how to display a smaller message window (assuming you can. I suspect one would). Thanks for what you did contribute, at least. Now the script actually adds Pokemon. :D
Cheers, Jim.
Reply With Quote
  #4  
Unread September 16th, 2012, 05:55 PM
FL .'s Avatar
FL .
Pokémon Island Creator
 
Join Date: Sep 2010
Gender: Male
To displays the message use:

Code:
    @sprites["msgwindow"]=Kernel.pbCreateMessageWindow(@viewport)
    Kernel.pbMessageDisplay(@sprites["msgwindow"],
        _INTL("Insert the text here"))
I suggest you to use '@starterchoice' rather than '$game_variables[26]'. Just put '@starterchoice=0' when the scene is starting. Also, take a look in http://pokemonessentials.wikia.com/w...es_introdution
__________________
Reply With Quote
Reply
Quick Reply

Sponsored Links


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are UTC. The time now is 08:38 AM.


Style by Perdition Haze, artwork by Sa-Dui.
Like our Facebook Page Follow us on TwitterMessage Board Statistics | © 2002 - 2013 The PokéCommunity™, pokecommunity.com.
Pokémon characters and images belong to Pokémon USA, Inc. and Nintendo. This website is in no way affiliated with or endorsed by Nintendo, Creatures, GAMEFREAK, The Pokémon Company, Pokémon USA, Inc., The Pokémon Company International, or Wizards of the Coast. We just love Pokémon.
All forum styles, their images (unless noted otherwise) and site designs are © 2002 - 2013 The PokéCommunity / PokéCommunity.com.
PokéCommunity™ is a trademark of The PokéCommunity. All rights reserved. Sponsor advertisements do not imply our endorsement of that product or service. User posts belong to the user.