The PokéCommunity Forums  

Go Back   The PokéCommunity Forums > Creative Discussions > Game Development > Scripts & Tutorials
Sign Up Rules/FAQ Live Battle Blogs Mark Forums Read

Notices

Scripts & Tutorials This forum is for scripts and code, as well as all kinds of tutorials, software, tools and so forth. Remember to give credit!
The thread revival limit does not apply here.


Reply
Click here to go to the first staff post in this thread.  
Thread Tools
  #1    
Old May 8th, 2013, 04:06 PM
FL's Avatar
FL
Pokémon Island Creator
 
Join Date: Sep 2010
Gender: Male
Map, Phone and Jukebox aren't enough features for you? Let's add more!

In Pokégear script section, after line '@cmdJukebox=-1' add '@cmdSomething=-1', after line 'commands[@cmdJukebox=commands.length]=_INTL("Jukebox")' add 'commands[@cmdSomething=commands.length]=_INTL("Something")'. Before the last line 'return', add the scene call in a 'if' statement with the command index, something like:

Code:
      if @cmdSomething>=0 && @sprites["command_window"].index==@cmdSomething
        pbPlayDecisionSE()
        pbFadeOutIn(99999) {
           scene=SomethingScene.new
           screen=Something.new(scene)
           screen.pbStartScreen
        }
      end
Change all the "Something" for something (lol) like DayCareChecker (works with this script if you use 'screen.startScreen' instead of 'screen.pbStartScreen' in the scene call). You can put a icon if you match the name, like the pokégear icons in Graphics/Pictures folder.
__________________
Reply With Quote
  #2    
Old May 8th, 2013, 06:41 PM
Tayuya of the Sound Four's Avatar
Tayuya of the Sound Four
 
Join Date: Jan 2013
Gender: Female
Thanks n_n Say if I wanted to make a sort of, mail/email system, how would that work? I know how to make scenes, just not how to populate them
Reply With Quote
  #3    
Old May 11th, 2013, 02:54 PM
FL's Avatar
FL
Pokémon Island Creator
 
Join Date: Sep 2010
Gender: Male
Quote:
Originally Posted by Tayuya of the Sound Four View Post
Thanks n_n Say if I wanted to make a sort of, mail/email system, how would that work? I know how to make scenes, just not how to populate them
Use a selection for choosing the values in a list, I suggest something like Kernel.pbMessage("Choose something",["choice 1","choice 2","choice 3","Cancel",3)

For showing a text (you need to define the background IMAGEPATH):

Code:
 def pbStartScene
    @sprites={} 
    @viewport=Viewport.new(0,0,Graphics.width,Graphics.height)
    @viewport.z=99999
    @sprites["background"]=IconSprite.new(0,0,@viewport)
    @sprites["background"].setBitmap(IMAGEPATH)
    @sprites["background"].x=(Graphics.width-@sprites["background"].bitmap.width)/2
    @sprites["background"].y=(Graphics.height-@sprites["background"].bitmap.height)/2
    @sprites["overlay"]=BitmapSprite.new(Graphics.width,Graphics.height,@viewport)
    pbSetSystemFont(@sprites["overlay"].bitmap)
    overlay=@sprites["overlay"].bitmap
    overlay.clear 
    marginLeft=32
    marginRight=32
    baseColor=Color.new(72,72,72)
    shadowColor=Color.new(160,160,160)
    textPositions=["Title goes here",Graphics.width/2,0,2,baseColor,shadowColor]]
    pbDrawTextPositions(overlay,textPositions)
    text = "text text text text text text text text text text text text text text text"
    drawTextEx(overlay,marginLeft,64,Graphics.width-marginLeft-marginRight,8,
        text,baseColor,shadowColor)
    pbFadeInAndShow(@sprites) { update }
  end
Look at my diploma tutorial for a better example.
__________________
Reply With Quote
  #4    
Old August 16th, 2013, 02:42 AM
bartyboy6's Avatar
bartyboy6
 
Join Date: Sep 2010
Gender: Male
small question: I want the pokedex to be on the pokegear instead of in the menu screen along with a pokemon storage check (you can't move your pokemon from there but merely check their summary)
Reply With Quote
  #5    
Old August 18th, 2013, 08:07 AM
FL's Avatar
FL
Pokémon Island Creator
 
Join Date: Sep 2010
Gender: Male
Quote:
Originally Posted by bartyboy6 View Post
small question: I want the pokedex to be on the pokegear instead of in the menu screen along with a pokemon storage check (you can't move your pokemon from there but merely check their summary)
Simply do the tutorial and for the last part (of each one) do something like:

Code:
      if @cmdPokedex>=0 && @sprites["command_window"].index==@cmdPokedex # I copied for menu script
        pbPlayDecisionSE()
        if DEXDEPENDSONLOCATION
          pbFadeOutIn(99999) {
             scene=PokemonPokedexScene.new
             screen=PokemonPokedex.new(scene)
             screen.pbStartScreen
             @scene.pbRefresh
          }
        else
          if $PokemonGlobal.pokedexViable.length==1
            $PokemonGlobal.pokedexDex=$PokemonGlobal.pokedexViable[0]
            $PokemonGlobal.pokedexDex=-1 if $PokemonGlobal.pokedexDex==$PokemonGlobal.pokedexUnlocked.length-1
            pbFadeOutIn(99999) {
               scene=PokemonPokedexScene.new
               screen=PokemonPokedex.new(scene)
               screen.pbStartScreen
               @scene.pbRefresh
            }
          else
            $scene = Scene_PokedexMenu.new # Changed
          end
        end
      end
      if @cmdStorage>=0 && @sprites["command_window"].index==@cmdStorage
        pbFadeOutIn(99999){
          scene=PokemonStorageScene.new
          screen=PokemonStorageScreen.new(scene,$PokemonStorage,false) # 3 parameters
          screen.pbStartScreen(2)
        }
      end
In PokemonStorage, change the line 'def initialize(scene,storage)' to:

Code:
  def initialize(scene,storage,actionsEnabled=true)
    @actionsEnabled = actionsEnabled

Change the second 'command=pbShowCommands(helptext,commands)' to:

Code:
          actionsDisabled=[
             _INTL("Move"),
             _INTL("Store"),
             _INTL("Withdraw"),
             _INTL("Item"),
             _INTL("Release")
          ]
          actionsDisabledPositions=[]
          if !@actionsEnabled
            count = commands.size
            while(count>0) # Goes backward to memorize the positions
              count-=1
              if actionsDisabled.include?(commands[count])
                actionsDisabledPositions.push(count)
                commands.delete_at(count)
              end  
            end
            actionsDisabledPositions.sort!
          end
          command=pbShowCommands(helptext,commands)
          for position in actionsDisabledPositions
            command+=1 if command>=position
          end
To make the back button in pokédex returns to PokéGear: In PokemonPokedex change every 'Scene_Map.new' to 'Scene_Pokegear.new'
__________________
Reply With Quote
  #6    
Old August 23rd, 2013, 06:42 AM
linkthehero's Avatar
linkthehero
 
Join Date: Sep 2012
Gender: Male
thank you very much =) the day cary stuff works fine , but ice tried toput the voltorb flip in this event ,but i got this error ,when i end the voltorb flip scene

Quote:
---------------------------
Pokemon 1
---------------------------
Exception: NoMethodError

Message: undefined method `new' for nil:NilClass

PokemonPokegear:178:in `update_command'

PokemonPokegear:177:in `pbFadeOutIn'

PokemonPokegear:177:in `update_command'

PokemonPokegear:135:in `update'

PokemonPokegear:116:in `main'

PokemonPokegear:113:in `loop'

PokemonPokegear:120:in `main'

PokemonUtilities:991:in `pbLoadRpgxpScene'

PokemonPauseMenu:147:in `pbStartPokemonMenu'

PokemonPauseMenu:142:in `loop'



This exception was logged in

C:\Users\Salem\Saved Games/Pokemon 1/errorlog.txt.

Press Ctrl+C to copy this message to the clipboard.
---------------------------
OK
---------------------------
Reply With Quote
  #7    
Old August 27th, 2013, 09:04 AM
FL's Avatar
FL
Pokémon Island Creator
 
Join Date: Sep 2010
Gender: Male
Quote:
Originally Posted by linkthehero View Post
thank you very much =) the day cary stuff works fine , but ice tried toput the voltorb flip in this event ,but i got this error ,when i end the voltorb flip scene
I followed the instructions and manage it (I only used 'pbVoltorbFlip' after 'pbPlayDecisionSE()' in the last part). You probably done something wrong, try again.
__________________
Reply With Quote
  #8    
Old August 30th, 2013, 11:14 PM
linkthehero's Avatar
linkthehero
 
Join Date: Sep 2012
Gender: Male
sorry but i god some problems to fix it.please help me
Quote:
class PokegearButton < SpriteWrapper
attr_reader :index
attr_reader :name
attr_accessor :selected

def initialize(x,y,name="",index=0,viewport=nil)
super(viewport)
@index=index
@name=name
@selected=false
fembutton=pbResolveBitmap(sprintf("Graphics/Pictures/pokegearButtonf"))
if $Trainer.gender==1 && fembutton
@button=AnimatedBitmap.new("Graphics/Pictures/pokegearButtonf")
else
@button=AnimatedBitmap.new("Graphics/Pictures/pokegearButton")
end
@contents=BitmapWrapper.new(@button.width,@button.height)
self.bitmap=@contents
self.x=x
self.y=y
update
end

def dispose
@button.dispose
@contents.dispose
super
end

def refresh
self.bitmap.clear
self.bitmap.blt(0,0,@button.bitmap,Rect.new(0,0,@button.width,@button.height))
pbSetSystemFont(self.bitmap)
textpos=[ # Name is written on both unselected and selected buttons
[@name,self.bitmap.width/2,10,2,Color.new(248,248,248),Color.new(40,40,40)],
[@name,self.bitmap.width/2,62,2,Color.new(248,248,248),Color.new(40,40,40)]
]
pbDrawTextPositions(self.bitmap,textpos)
icon=sprintf("Graphics/Pictures/pokegear"+@name)
imagepos=[ # Icon is put on both unselected and selected buttons
[icon,18,10,0,0,-1,-1],
[icon,18,62,0,0,-1,-1]
]
pbDrawImagePositions(self.bitmap,imagepos)
end

def update
if self.selected
self.src_rect.set(0,self.bitmap.height/2,self.bitmap.width,self.bitmap.height/2)
else
self.src_rect.set(0,0,self.bitmap.width,self.bitmap.height/2)
end
refresh
super
end
end



#===============================================================================
# - Scene_Pokegear
#-------------------------------------------------------------------------------
# Modified By Harshboy
# Modified by Peter O.
# Also Modified By OblivionMew
# Overhauled by Maruno
#===============================================================================
class Scene_Pokegear
#-----------------------------------------------------------------------------
# initialize
#-----------------------------------------------------------------------------
def initialize(menu_index = 0)
@menu_index = menu_index
end
#-----------------------------------------------------------------------------
# main
#-----------------------------------------------------------------------------
def main
commands=[]
# OPTIONS - If you change these, you should also change update_command below.
@cmdMap=-1
@cmdPhone=-1
@cmdJukebox=-1
@cmdVoltorbFlip=-1
commands[@cmdMap=commands.length]=_INTL("Map")
commands[@cmdPhone=commands.length]=_INTL("Phone") if $PokemonGlobal.phoneNumbers &&
$PokemonGlobal.phoneNumbers.length>0
commands[@cmdJukebox=commands.length]=_INTL("Jukebox")
commands[@cmdPension=commands.length]=_INTL("Pensionschecker") if pbGet(102)
commands[@cmdVoltorbFlip=commands.length]=_INTL("VoltorbFlip")
@viewport=Viewport.new(0,0,Graphics.width,Graphics.height)
@viewport.z=99999
@button=AnimatedBitmap.new("Graphics/Pictures/pokegearButton")
@sprites={}
@sprites["background"] = IconSprite.new(0,0)
femback=pbResolveBitmap(sprintf("Graphics/Pictures/pokegearbgf"))
if $Trainer.gender==1 && femback
@sprites["background"].setBitmap("Graphics/Pictures/pokegearbgf")
else
@sprites["background"].setBitmap("Graphics/Pictures/pokegearbg")
end
@sprites["command_window"] = Window_CommandPokemon.new(commands,160)
@sprites["command_window"].index = @menu_index
@sprites["command_window"].x = Graphics.width
@sprites["command_window"].y = 0
for i in 0...commands.length
x=118
y=196 - (commands.length*24) + (i*48)
@sprites["button#{i}"]=PokegearButton.new(x,y,commands[i],i,@viewport)
@sprites["button#{i}"].selected=(i==@sprites["command_window"].index)
@sprites["button#{i}"].update
end
Graphics.transition
loop do
Graphics.update
Input.update
update
if $scene != self
break
end
end
Graphics.freeze
pbDisposeSpriteHash(@sprites)
end
#-----------------------------------------------------------------------------
# update the scene
#-----------------------------------------------------------------------------
def update
pbUpdateSpriteHash(@sprites)
for i in 0...@sprites["command_window"].commands.length
sprite=@sprites["button#{i}"]
sprite.selected=(i==@sprites["command_window"].index) ? true : false
end
#update command window and the info if it's active
if @sprites["command_window"].active
update_command
return
end
end
#-----------------------------------------------------------------------------
# update the command window
#-----------------------------------------------------------------------------
def update_command
if Input.trigger?(Input::B)
pbPlayCancelSE()
$scene = Scene_Map.new
return
end
if Input.trigger?(Input::C)
if @cmdMap>=0 && @sprites["command_window"].index==@cmdMap
pbPlayDecisionSE()
pbFadeOutIn(99999) {
scene=PokemonRegionMapScene.new
screen=PokemonRegionMap.new(scene)
screen.pbStartScreen
}
end
if @cmdPhone>=0 && @sprites["command_window"].index==@cmdPhone
pbPlayDecisionSE()
pbFadeOutIn(99999) {
PokemonPhoneScene.new.start
}
end
if @cmdJukebox>=0 && @sprites["command_window"].index==@cmdJukebox
pbPlayDecisionSE()
$scene = Scene_Jukebox.new
end
if @cmdPension>=0 && @sprites["command_window"].index==@cmdPension
pbPlayDecisionSE()
pbFadeOutIn(99999) {
scene=DayCareCheckerScene.new
screen=DayCareChecker.new(scene)
screen.startScreen
}
end
if @cmdPension>=0 && @sprites["command_window"].index==@cmdVoltorbFlip
pbPlayDecisionSE()
pbFadeOutIn(99999) {
scene=pbVoltorbFlip.new
screen=pbVoltorbFlip.new(scene)
screen.pbStartScreen
}
end
return
end
end
end

Last edited by linkthehero; August 30th, 2013 at 11:21 PM.
Reply With Quote
  #9    
Old September 1st, 2013, 09:51 AM
FL's Avatar
FL
Pokémon Island Creator
 
Join Date: Sep 2010
Gender: Male
Quote:
Originally Posted by linkthehero View Post
sorry but i god some problems to fix it.please help me
Like I said: You done something wrong. 'if @cmdPension>=0 && @sprites["command_window"].index==@cmdVoltorbFlip' line should be 'if @cmdVoltorbFlip>=0 && @sprites["command_window"].index==@cmdVoltorbFlip'. Change
Code:
pbFadeOutIn(99999) { 
  scene=pbVoltorbFlip.new
  screen=pbVoltorbFlip.new(scene)
  screen.pbStartScreen
}
to 'pbVoltorbFlip'
__________________
Reply With Quote
  #10    
Old September 1st, 2013, 11:37 AM
Maruno's Avatar
Maruno
Lead Dev of Pokémon Essentials
 
Join Date: Jan 2008
Location: England
You'll also need the line @cmdPension=-1 in there somewhere. You could also try saying what your problems actually are.
__________________
Reply With Quote
  #11    
Old September 2nd, 2013, 06:51 AM
linkthehero's Avatar
linkthehero
 
Join Date: Sep 2012
Gender: Male
thank you so much for the help
it works perfect =)
Reply With Quote
  #12    
Old December 28th, 2013, 08:36 AM
linkthehero's Avatar
linkthehero
 
Join Date: Sep 2012
Gender: Male
how is it posibal to put the bike in
could someone help me please
Reply With Quote
  #13    
Old January 1st, 2014, 12:15 PM
FL's Avatar
FL
Pokémon Island Creator
 
Join Date: Sep 2010
Gender: Male
Quote:
Originally Posted by linkthehero View Post
how is it posibal to put the bike in
could someone help me please
The last part is:

Code:
      if @cmdBicycle>=0 && @sprites["command_window"].index==@cmdBicycle #gearmod
        if pbBikeCheck
          if $PokemonGlobal.bicycle
            Kernel.pbDismountBike
          else
            Kernel.pbMountBike 
          end
          $scene = Scene_Map.new
        end
      end
To close the menu, I suggest you to create a new flag at PokemonTemp. At pause menu script, when this variable is true, just closes the menu (break the loop). At this script, set this variable to true after line '$scene = Scene_Map.new'.
__________________
Reply With Quote
  #14    
Old January 1st, 2014, 03:00 PM
linkthehero's Avatar
linkthehero
 
Join Date: Sep 2012
Gender: Male
ok thank you but the stuff with the pause menu is not needed i use another menu =)
thank you =)
Reply With Quote
  #15    
Old January 27th, 2014, 06:50 AM
TheMarkCrafter's Avatar
TheMarkCrafter
Magma.
 
Join Date: Jan 2011
Location: Kalos
Gender: Male
Nature: Serious
Drawing app?

How do I add a drawing app?
__________________

omega.
No information yet.
Reply With Quote
  #16    
Old January 27th, 2014, 08:44 AM
Maruno's Avatar
Maruno
Lead Dev of Pokémon Essentials
 
Join Date: Jan 2008
Location: England
The first post explains how to call your drawing app scripts from the Pokégear.

Describing how to make a whole new screen is not a part of this tutorial.
__________________
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
Minimum Characters Per Post: 25



All times are UTC -8. The time now is 05:26 AM.


Style by Nymphadora, artwork by Sa-Dui.
Like our Facebook Page Follow us on Twitter © 2002 - 2014 The PokéCommunity™, pokecommunity.com.
Pokémon characters and images belong to The Pokémon Company International and Nintendo. This website is in no way affiliated with or endorsed by Nintendo, Creatures, GAMEFREAK, The Pokémon Company or The Pokémon Company International. We just love Pokémon.
All forum styles, their images (unless noted otherwise) and site designs are © 2002 - 2014 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 generated content remains the property of its creator.