• Ever thought it'd be cool to have your art, writing, or challenge runs featured on PokéCommunity? Click here for info - we'd love to spotlight your work!
  • 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.

PokeGear/ PokeNav Creation Thread - RMXP

Matt12345678

The Famous N00b
  • 187
    Posts
    20
    Years
    Does anyone remember the old RM2K3 thread with the Battle System Making project? I thought it would be a good idea to do the same thing, exept for RMXP, and with a PokeGear or PokeNav. Unfortunately, I have no idea where to begin...

    Here is a list of everyone who is currently working on the project:
    Matt12345678
    OverTheBelow

    Special Thanks to:
    Blizzy

    Goal:
    To make a PokeGear and a PokeNav, each one identical to the ones in Crystal and Emerald

    If you want to help with the project, that would be much appreciated.

    To the Mods:
    If this kind of thread is not allowed, feel free to close it. :nervous:
     
    Last edited:
    OverTheBelow said:
    Sounds good, problem is, I don't know hardly anything about RGSS, but I want to help. I can do good images...
    ok. i added you to the first post...
     
    OverTheBelow said:
    What should I do?

    Images?

    Add me to msn: [email protected]

    sorry, i don't have MSN :\ ... my computer is wierd like that...

    if you could get images for the PokeNav that would be great :D
     
    this isnt too hard to do,
    in fact, i already started writing the gear.

    here is a piece of code, which works well so far
    you only need 2 pictures called 'background' and 'arrow_1'.
    (see attachement)

    here is the code so far, it's not perfect so far (only map with cursor works now)
    Code:
    class Window_Command < Window_Selectable
      attr_reader    :commands
    end
    
    # define a Scene
    class Scene_PokeGear
      #--------------------------------------------------------------------------
      # * Main Processing
      #--------------------------------------------------------------------------
      def main
        # here comes the code to initialize the objects
        
        # for example the command_window, help_window, background and the cursor
        # create the commands
        s1 = "Time"
        s2 = "Map"
        s3 = "Radio"
        s4 = "Phone"
        s5 = "Exit"
        commands = [s1,s2,s3,s4,s5]
        # create a command window (vertical)
        @command_window = Window_Command.new(132, commands)
        @command_window.z = 3
        
        # create a help window to display text
        @help_window = Window_Help.new
        # set the width and height
        @help_window.width = 156
        @help_window.height = 64
        # set the x, y and z values
        @help_window.x = $width - @help_window.width
        @help_window.y = $height - @help_window.height
        @help_window.z = 3
        # set no text
        @help_window.set_text("")
        
        # create a sprite
        @background = Sprite.new
        # create a bitmap
        @background.bitmap = RPG::Cache.picture("background")
        # give the bitmap a position by the x and y value
        @background.x, @background.y = 0, 0
        # make the background double size
        @background.zoom_x, @background.zoom_y = 2,2
        # give the bitmap a layer
        @background.z = 0
        
        # now we do the same for the cursor
        # this cursor is for the region-map
        @cursor = Sprite.new
        @cursor.bitmap = RPG::Cache.picture("arrow_1")
        @cursor.x, @cursor.y = 100, 100
        # make the cursor double size
        @cursor.zoom_x, @cursor.zoom_y = 2,2
        @cursor.visible = false
        # make the layer 1 so it's above the background
        @cursor.z = 9
        
        # Window for the cursor display
        @window = Window_Base.new(100, 100, 128, 128)
        @window.z = 8
        @window.visible = false
        
        # Transition run
        Graphics.transition
        # Main loop
        loop do
          # Update game screen
          Graphics.update
          # Update input information
          Input.update
          # Frame update
          update
          # Abort loop if screen is changed
          if $scene != self
            break
          end
        end
        # Prepare for transition
        Graphics.freeze
        # dispose content
        @command_window.dispose
        @help_window.dispose
        @background.dispose
        @cursor.dispose
        @window.dispose
      end
      #--------------------------------------------------------------------------
      # * Frame Update
      #--------------------------------------------------------------------------
      def update
        # update content
        @command_window.update
        @help_window.update
        @background.update
        @cursor.update
        @window.update
        
        # call update_command when command_window is active
        if @command_window.active
          update_command
          return
        end
        
        # check if the cursor is on the map
        # and check if the command_window is not active
        # then call the method update_cursor
        if @command_window.index == 1 && !@command_window.active
          update_cursor
          update_text
          return
        end
      end
      #--------------------------------------------------------------------------
      # * Update Command
      #--------------------------------------------------------------------------
      def update_command
        if Input.trigger?(Input::B)
          $scene = Scene_Map.new
          return
        end
        
        if Input.trigger?(Input::C)
          case @command_window.commands[@command_window.index]
          when "Time"
          
          when "Map"
            update_cursor
          when "Radio"
          
          when "Phone"
            
          when "Exit"
            $scene = Scene_Map.new
            
          end
          return
        end
      end
      #--------------------------------------------------------------------------
      # * Update Map(Region) Cursor
      #--------------------------------------------------------------------------
      def update_cursor
        @cursor.visible = true
        @window.visible = true
        @command_window.active = false
        # define variables for min/max position of the cursor,
        # so it can't leave the screen.
        min_x = 100
        max_x = 200
        min_y = 100
        max_y = 200
        
        # return to the command_window if press cancel button
        if Input.trigger?(Input::B)
          @command_window.active = true
          @cursor.visible = false
          @window.visible = false
        end
        
        # press Shift key to check x and y spots
        if Input.trigger?(Input::SHIFT)
          print "X: #{@cursor.x} , Y: #{@cursor.y}"
        end
        
        # if press right and the cursor x is smaller then max_x,
        # move the cursor right
        if Input.press?(Input::RIGHT) and @cursor.x < max_x
          @cursor.x += 2
        end
        # if press left and the cursor x is bigger then min_x,
        # move the cursor left
        if Input.press?(Input::LEFT) and @cursor.x > min_x
          @cursor.x -= 2
        end
        # if press down and the cursor y is smaller then max_y,
        # move the cursor down
        if Input.press?(Input::DOWN) and @cursor.y < max_y
          @cursor.y += 2
        end
        # if press up and the cursor y is bigger then min_y,
        # move the cursor up
        if Input.press?(Input::UP) and @cursor.y > min_y
          @cursor.y -= 2
        end
      end
      #--------------------------------------------------------------------------
      # * Update Text
      #--------------------------------------------------------------------------
      def update_text
        # if the cursor is between the values, display the text
        if @cursor.x.between?(100, 120) && @cursor.y.between?(100, 120)
          @help_window.set_text("Left-Up")
        elsif @cursor.x.between?(190, 200) && @cursor.y.between?(100, 120)
          @help_window.set_text("Right-Up")
        elsif @cursor.x.between?(100, 120) && @cursor.y.between?(190, 200)
          @help_window.set_text("Left-Down")
        elsif @cursor.x.between?(190, 200) && @cursor.y.between?(190, 200)
          @help_window.set_text("Right-Down")
        elsif @cursor.x.between?(140, 160) && @cursor.y.between?(140, 160)
          @help_window.set_text("Middle")
        elsif @cursor.x.between?(190, 200) && @cursor.y.between?(110, 190)
          @help_window.set_text("Right")
        elsif @cursor.x.between?(100, 110) && @cursor.y.between?(110, 190)
          @help_window.set_text("Left")
        elsif @cursor.x.between?(110, 190) && @cursor.y.between?(100, 110)
          @help_window.set_text("Up")
        elsif @cursor.x.between?(110, 190) && @cursor.y.between?(190, 200)
          @help_window.set_text("Down")
        else
          @help_window.set_text("")
        end
      end
    end
    while moving with the cursor, press shift key to keep track of the x and y values
    have fun toying with it :)
     
    Last edited:
    Blizzy said:
    this isnt too hard to do,
    in fact, i already started writing the gear.

    here is a piece of code, which works well so far
    you only need 2 pictures called 'background' and 'arrow_1'.
    (see attachement)

    here is the code so far, it's not perfect so far (only map with cursor works now)

    while moving with the cursor, press shift key to keep track of the x and y values
    have fun toying with it :)
    thanks! i added you to the first post....
     
    you don't have to help, but you deserve credit. :P
     
    Hey! This looks great! Can't wait till its done. :P Happy coding!
     
    Back
    Top