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.

TrollandToad.com
Reply
 
Thread Tools
  #1    
Old February 2nd, 2011 (12:39 PM).
zingzags's Avatar
zingzags zingzags is offline
PokemonGDX creator
     
    Join Date: Jan 2009
    Location: Boston
    Age: 23
    Nature: Adamant
    Posts: 562
    Well sense today is my birthday, I decided to share my first script for my pokemon game, Enjoy and give credits.

    Code:
    ################################################################################
    # CREATED BY ZINGZAGS OF POKECOMMUNITY AND PLANETDEV
    # Starter Pokemon Option Screen
    # THIS IS TO MAKE A CUSTOM STARTER CHOOSING SCENE LIKE IN ACUTAL POKEMON GAMES
    # VERSION TWO OF THE SCRIPT (FINAL)
    ################################################################################
    
    
    class SceneTable
      
      def pbUpdate
       pbUpdateSpriteHash(@sprites)
      end
     
      def pbEndScene
       pbDisposeSpriteHash(@sprites)
       @viewport.dispose
      end
      
      
      def pbStartScene
        @sprites={}
        @viewport=Viewport.new(0,0,$Graphics_widthx2, $Graphics_heightx2)
        @viewport.z=99999
        
        @sprites["bg"]=Sprite.new(@viewport)
        @sprites["bg"].bitmap = BitmapCache.load_bitmap("Graphics/Pictures/bottombger")
        @sprites["bg"].x=0
        @sprites["bg"].y=400
        @sprites["bg"].z=0
        
        @sprites["bgt"]=Sprite.new(@viewport)
        @sprites["bgt"].bitmap = BitmapCache.load_bitmap("Graphics/Pictures/touch up.png")
        @sprites["bgt"].x=0
        @sprites["bgt"].y=289
        @sprites["bgt"].z=0    
        
        @sprites["1"]=Sprite.new(@viewport)
        @sprites["1"].bitmap = BitmapCache.load_bitmap("Graphics/Pictures/pokeballC")
        @sprites["1"].x=124
        @sprites["1"].y=500
        @sprites["1"].z=1
        
        @sprites["2"]=Sprite.new(@viewport)
        @sprites["2"].bitmap = BitmapCache.load_bitmap("Graphics/Pictures/pokeballC")
        @sprites["2"].x=198
        @sprites["2"].y=500
        @sprites["2"].z=1
        
        @sprites["2"]=Sprite.new(@viewport)
        @sprites["2"].bitmap = BitmapCache.load_bitmap("Graphics/Pictures/pokeballC")
        @sprites["2"].x=272
        @sprites["2"].y=500
        @sprites["2"].z=1
        
        
       
        @sprites["overlay"]=BitmapSprite.new($Graphics_widthx2,784,@viewport)
        @sprites["overlay"].z=1
        [email protected]["overlay"].bitmap
        overlay.clear
        baseColor=Color.new(12*8,12*8,12*8)#(255,255,240)
        shadowColor=Color.new(255,255,240)#(12*8,12*8,12*8)
        pbSetSystemFont(@sprites["overlay"].bitmap)
        textPositions=[
         ["Please click on one of the pokeballs       ",420,306,true,baseColor,shadowColor],
       #   ["POKEBALL's                      ",423,146,true,baseColor,shadowColor],
         ["to choose your starting pokemon.            ",428,333,true,baseColor,shadowColor],
         ]
        pbDrawTextPositions(overlay,textPositions)
      end 
      
      def pbScene
      loop do
        Graphics.update
        Input.update
        pbUpdate
        
       #  Kernel.pbMessage(_INTL("There are three pokemon here, each one of these red ball, or PokeBall contains one Pokemon."))
        # Kernel.pbMessage(_INTL("Please choose your starting pokemon that you will journey out with."))
        
          if pbMouseInAreaLeft?(124, 500, 74, 74)
          
          pbPlayDecisionSE()
            Kernel.pbMessage(_INTL("The pokemon that is inside this pokeball is TURTWIG")) 
          if !Kernel.pbConfirmMessageSerious(
             _INTL("Are you sure you want to have TURTWIG as your starter pokemon?"))
             Kernel.pbMessage(_INTL("Please make a decision before you act next time."))
             else
              Kernel.pbAddPokemon(PBSpecies::TURTWIG,05)
              break
          
          end
        end
        
         
      if pbMouseInAreaLeft?(198, 500, 74, 74)
           
          pbPlayDecisionSE()
            Kernel.pbMessage(_INTL("The pokemon that is inside this pokeball is CHARMANDER")) 
          if !Kernel.pbConfirmMessageSerious(
             _INTL("Are you sure you want to have CHARMANDER as your starter pokemon?"))
             Kernel.pbMessage(_INTL("Please make a decision before you act next time."))
             else
              Kernel.pbAddPokemon(PBSpecies::CHARMANDER,05)
              break
      
          end
        end
        
           if pbMouseInAreaLeft?(272, 500, 74, 74)
           
          pbPlayDecisionSE()
            Kernel.pbMessage(_INTL("The pokemon that is inside this pokeball is PIPLUP")) 
          if !Kernel.pbConfirmMessageSerious(
             _INTL("Are you sure you want to have PIPLUP as your starter pokemon?"))
             Kernel.pbMessage(_INTL("Please make a decision before you act next time."))
             else
              Kernel.pbAddPokemon(PBSpecies::PIPLUP,05)
              break
        
          end
        end
      end
    end
      end
    
    class TableScreen
     def initialize(scene)
      @scene = scene
     end
     def pbStartScreen
      @scene.pbStartScene
      @scene.pbScene
      @scene.pbEndScene
     end
    end
    #
    #
    #  Here is how a script would initialize SceneMine:
    #  
    #  pbFadeOutIn(99999){
    #    scene=SceneTable.new
    #    screen=TableScreen.new(scene)
    #    screen.pbStartScreen
    #  }
    
    
    # def pbEndScene
       
      # pbFadeOutAndHide(@sprites) { pbUpdate }
       #pbDisposeSpriteHash(@sprites)
       #@viewport.dispose
     # end
    
    # Kernel.pbAddPokemon(PBSpecies::MEW,20)
    __________________
    Check out the Pokemon Game Engine I am working on:
    https://github.com/sjosegarcia/Pokemon
    Reply With Quote

    Relevant Advertising!

      #2    
    Old February 2nd, 2011 (6:54 PM).
    thepsynergist's Avatar
    thepsynergist thepsynergist is offline
    A Gym Leader, Kyushu Region
       
      Join Date: Mar 2009
      Location: California, USA
      Age: 27
      Gender: Male
      Nature: Adamant
      Posts: 758
      Nice job. It works out great. Though I evented mine, and it doesn't look as snazzy.

      EDIT: Just hit 500 posts. :D
      __________________




      Pokemon Pyrite is now complete, check out the trailer/download link here: https://www.youtube.com/watch?v=X6g5pXPXyV4
      Reply With Quote
        #3    
      Old May 13th, 2015 (9:47 AM).
      Sharazel's Avatar
      Sharazel Sharazel is offline
         
        Join Date: May 2015
        Gender: Male
        Posts: 68
        How do you call the script?
        Reply With Quote
          #4    
        Old May 14th, 2015 (3:03 AM).
        shiney570 shiney570 is offline
           
          Join Date: Aug 2014
          Location: Germany
          Gender: Male
          Posts: 95
          Did you renamed Luka's mouse methods? it is called $mouseInAreaLeft? and not pbMouseInAreaLeft.
          i addition to that, are you sure that
          Code:
          @sprites["bgt"].bitmap = BitmapCache.load_bitmap("Graphics/Pictures/touch up.png")
          won't give you an error?
          and what about
          Code:
          $Graphics_widthx2
          ?
          this variable doesn't exists in Essentials.
          what you probably mean is
          Code:
          Graphics.width*2
          ?
          I am sure using your script would've give an instant error.
          and btw, what is wrong with my Starter Selection?

          and where are the Graphics for the Script?
          Reply With Quote
            #5    
          Old May 14th, 2015 (4:34 AM).
          Super Dedenne's Avatar
          Super Dedenne Super Dedenne is offline
             
            Join Date: Apr 2014
            Gender: Other
            Posts: 32
            Quote:
            Originally Posted by shiney570 View Post
            and btw, what is wrong with my Starter Selection?
            This thread is four years old... The methods are four years old... Your Starter Selection script didn't even exist yet.
            Please be wary of the dates.
            __________________
            Public Additions/Snippets:
            Trainer Outfit: Acro/MachBike Fix
            (Needs 15.1 update) Pokemon Summary Add-On: Improved Ribbons + Scroll!
            I might release some of my private plug-n'-play scripts in the future.
            Reply With Quote
            Reply

            Quick Reply

            Join the conversation!

            Create an account to post a reply in this thread, participate in other discussions, and more!

            Create a PokéCommunity Account

            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 GMT -8. The time now is 3:53 PM.