• Just a reminder that providing specifics on, sharing links to, or naming websites where ROMs can be accessed is against the rules. If your post has any of this information it will be removed.
  • 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.

Pokémon Essentials Diamond and Pearl Moves & Abilities Project

I don't know if some of you already noticed that the bump sound repeats very fast if you run into something (and I don't know if that's already included in the project) But just replace Game_Player_ with:
Code:
#==============================================================================
# ** Game_Player
#------------------------------------------------------------------------------
#  This class handles the player. Its functions include event starting
#  determinants and map scrolling. Refer to "$game_player" for the one
#  instance of this class.
#==============================================================================
 
def pbAddDependency(event)
  $PokemonTemp.dependentEvents.addEvent(event)
end
def pbRemoveDependency(event)
  $PokemonTemp.dependentEvents.removeEvent(event)
end
 
def pbAddDependency2(eventID, eventName, commonEvent)
  $PokemonTemp.dependentEvents.addEvent($game_map.events[eventID],eventName,commonEvent)
end
def pbRemoveDependency2(eventName)
  $PokemonTemp.dependentEvents.removeEventByName(eventName)
end
 
class Game_Player < Game_Character
  def map
    @map=nil
    return $game_map
  end
  #--------------------------------------------------------------------------
  # * Invariables
  #--------------------------------------------------------------------------
  def initialize(*arg)
    super(*arg)
    @lastdir=0
    @lastdirframe=0
  end
  def pbHasDependentEvents?
    return $PokemonGlobal.dependentEvents.length>0  
  end
  def move_down(turn_enabled = true)
    if turn_enabled
     turn_down
    end
    pbBridgeCheck(2)
    if passable?(@x, @y, 2)
      return if pbLedge(0,1)
      return if pbEndSurf(0,1)
      turn_down
      @y += 1
      $PokemonTemp.dependentEvents.pbMoveDependentEvents
      increase_steps
    else
      if !check_event_trigger_touch(@x, @y+1)
        bump_sound(2)
      end
    end
  end
  def move_left(turn_enabled = true)
    if turn_enabled
      turn_left
    end
    pbBridgeCheck(4)
    if passable?(@x, @y, 4)
      return if pbLedge(-1,0)
      return if pbEndSurf(-1,0)
      turn_left
      @x -= 1
      $PokemonTemp.dependentEvents.pbMoveDependentEvents
      increase_steps
    else
      if !check_event_trigger_touch(@x-1, @y)
        bump_sound(4)
      end
    end
  end
  def move_right(turn_enabled = true)
    if turn_enabled
      turn_right
    end
    pbBridgeCheck(6)
    if passable?(@x, @y, 6)
      return if pbLedge(1,0)
      return if pbEndSurf(1,0)
      turn_right
      @x += 1
      $PokemonTemp.dependentEvents.pbMoveDependentEvents
      increase_steps
    else
      if !check_event_trigger_touch(@x+1, @y)
        bump_sound(6)
      end
    end
  end
  def move_up(turn_enabled = true)
    if turn_enabled
      turn_up
    end
    pbBridgeCheck(8)
    if passable?(@x, @y, 8)
      return if pbLedge(0,-1)
      return if pbEndSurf(0,-1)
      turn_up
      @y -= 1
      $PokemonTemp.dependentEvents.pbMoveDependentEvents
      increase_steps
    else
      if !check_event_trigger_touch(@x, @y-1)
        bump_sound(8)
      end
    end
  end
  def pbTriggeredTrainerEvents(triggers,checkIfRunning=true)
    result = []
    # If event is running
    if checkIfRunning && $game_system.map_interpreter.running?
      return result
    end
    # All event loops
    for event in $game_map.events.values
      next if !event.name[/^Trainer\((\d+)\)$/]
      distance=$~[1].to_i
      # If event coordinates and triggers are consistent
      if pbEventCanReachPlayer?(event,self,distance) and triggers.include?(event.trigger)
          # If starting determinant is front event (other than jumping)
        if not event.jumping? and not event.over_trigger?
          result.push(event)
        end
      end
    end
    return result
  end
  def pbTriggeredCounterEvents(triggers,checkIfRunning=true)
    result = []
    # If event is running
    if checkIfRunning && $game_system.map_interpreter.running?
      return result
    end
    # All event loops
    for event in $game_map.events.values
      next if !event.name[/^Counter\((\d+)\)$/]
      distance=$~[1].to_i
      # If event coordinates and triggers are consistent
      if pbEventFacesPlayer?(event,self,distance) and triggers.include?(event.trigger)
          # If starting determinant is front event (other than jumping)
        if not event.jumping? and not event.over_trigger?
          result.push(event)
        end
      end
    end
    return result
  end
  def pbCheckEventTriggerAfterTurning
  end
  def pbCheckEventTriggerFromDistance(triggers)
    ret=pbTriggeredTrainerEvents(triggers)
    ret.concat(pbTriggeredCounterEvents(triggers))
    return false if ret.length==0
    for event in ret
      event.start
    end
    return true
  end
  def pbFacingEvent
   if $game_system.map_interpreter.running?
    return nil
   end
   new_x = @x + (@direction == 6 ? 1 : @direction == 4 ? -1 : 0)
   new_y = @y + (@direction == 2 ? 1 : @direction == 8 ? -1 : 0)
   for event in $game_map.events.values
    if event.x == new_x and event.y == new_y
     if not event.jumping? and not event.over_trigger?
      return event
     end
    end
   end
   if $game_map.counter?(new_x, new_y)
     new_x += (@direction == 6 ? 1 : @direction == 4 ? -1 : 0)
     new_y += (@direction == 2 ? 1 : @direction == 8 ? -1 : 0)
     for event in $game_map.events.values
      if event.x == new_x and event.y == new_y
       if not event.jumping? and not event.over_trigger?
        return event
       end
      end
     end
   end
   return nil
  end
  #--------------------------------------------------------------------------
  # * Passable Determinants
  #     x : x-coordinate
  #     y : y-coordinate
  #     d : direction (0,2,4,6,8)
  #         * 0 = Determines if all directions are impassable (for jumping)
  #--------------------------------------------------------------------------
  def passable?(x, y, d)
    # Get new coordinates
    new_x = x + (d == 6 ? 1 : d == 4 ? -1 : 0)
    new_y = y + (d == 2 ? 1 : d == 8 ? -1 : 0)
    # If coordinates are outside of map
    unless $game_map.validLax?(new_x, new_y)
      # Impassable
      return false
    end
    if !$game_map.valid?(new_x, new_y)
      return false if !$MapFactory
      return $MapFactory.isPassableFromEdge?(new_x, new_y)
    end
    # If debug mode is ON and ctrl key was pressed
    if $DEBUG and Input.press?(Input::CTRL)
      # Passable
      return true
    end
    super
  end
  #--------------------------------------------------------------------------
  # * Set Map Display Position to Center of Screen
  #--------------------------------------------------------------------------
  def center(x, y)
    center_x = (Graphics.width/2 - 16) * 4   # Center screen x-coordinate * 4
    center_y = (Graphics.height/2 - 16) * 4   # Center screen y-coordinate * 4
    max_x = ($game_map.width - Graphics.width/32.0) * 128
    max_y = ($game_map.height - Graphics.height/32.0) * 128
    $game_map.display_x = [0, [x * 128 - center_x, max_x].min].max
    $game_map.display_y = [0, [y * 128 - center_y, max_y].min].max
  end
  #--------------------------------------------------------------------------
  # * Move to Designated Position
  #     x : x-coordinate
  #     y : y-coordinate
  #--------------------------------------------------------------------------
  def moveto(x, y)
    super
    # Centering
    center(x, y)
    # Make encounter count
    make_encounter_count
  end
  #--------------------------------------------------------------------------
  # * Increase Steps
  #--------------------------------------------------------------------------
  def increase_steps
    super
  end
  #--------------------------------------------------------------------------
  # * Get Encounter Count
  #--------------------------------------------------------------------------
  def encounter_count
    return @encounter_count
  end
  #--------------------------------------------------------------------------
  # * Make Encounter Count
  #--------------------------------------------------------------------------
  def make_encounter_count
    # Image of two dice rolling
    if $game_map.map_id != 0
      n = $game_map.encounter_step
      @encounter_count = rand(n) + rand(n) + 1
    end
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    @opacity = 255
    @blend_type = 0
  end
  #--------------------------------------------------------------------------
  # * Same Position Starting Determinant
  #--------------------------------------------------------------------------
  def check_event_trigger_here(triggers,keypress=false)
    result = false
    # If event is running
    if $game_system.map_interpreter.running?
      return result
    end
    # All event loops
    for event in $game_map.events.values
      # If event coordinates and triggers are consistent
      if event.x == @x and event.y == @y and triggers.include?(event.trigger)
        # If starting determinant is same position event (other than jumping)
        if not event.jumping? and event.over_trigger?
          event.start(keypress)
          result = true
        end
      end
    end
    return result
  end
  #--------------------------------------------------------------------------
  # * Front Envent Starting Determinant
  #--------------------------------------------------------------------------
  def check_event_trigger_there(triggers,keypress=false)
    result = false
    # If event is running
    if $game_system.map_interpreter.running?
      return result
    end
    # Calculate front event coordinates
    new_x = @x + (@direction == 6 ? 1 : @direction == 4 ? -1 : 0)
    new_y = @y + (@direction == 2 ? 1 : @direction == 8 ? -1 : 0)
    # All event loops
    for event in $game_map.events.values
      # If event coordinates and triggers are consistent
      if event.x == new_x and event.y == new_y and
         triggers.include?(event.trigger)
        # If starting determinant is front event (other than jumping)
        if not event.jumping? and (keypress || !event.over_trigger?)
          event.start(keypress)
          result = true
        end
      end
    end
    # If fitting event is not found
    if result == false
      # If front tile is a counter
      if $game_map.counter?(new_x, new_y)
        # Calculate 1 tile inside coordinates
        new_x += (@direction == 6 ? 1 : @direction == 4 ? -1 : 0)
        new_y += (@direction == 2 ? 1 : @direction == 8 ? -1 : 0)
        # All event loops
        for event in $game_map.events.values
          # If event coordinates and triggers are consistent
          if event.x == new_x and event.y == new_y and
             triggers.include?(event.trigger)
            # If starting determinant is front event (other than jumping)
            if not event.jumping? and (keypress || !event.over_trigger?)
              event.start
              result = true
            end
          end
        end
      end
    end
    return result
  end
  #--------------------------------------------------------------------------
  # * Touch Event Starting Determinant
  #--------------------------------------------------------------------------
  def check_event_trigger_touch(x, y)
    result = false
    # If event is running
    if $game_system.map_interpreter.running?
      return result
    end
    # All event loops
    for event in $game_map.events.values
      if event.name[/^Trainer\((\d+)\)$/]
        distance=$~[1].to_i
        next if !pbEventCanReachPlayer?(event,self,distance)
      end
      if event.name[/^Counter\((\d+)\)$/]
        distance=$~[1].to_i
        next if !pbEventFacesPlayer?(event,self,distance)
      end
      # If event coordinates and triggers are consistent
      if event.x == x and event.y == y and [1,2].include?(event.trigger)
        # If starting determinant is front event (other than jumping)
        if not event.jumping? and not event.over_trigger?
          event.start
          result = true
        end
      end
    end
    return result
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    # Remember whether or not moving in local variables
    last_moving = moving?
    # If moving, event running, move route forcing, and message window
    # display are all not occurring
    dir=Input.dir4
    unless moving? or $game_system.map_interpreter.running? or
           @move_route_forcing or $game_temp.message_window_showing or
           $PokemonTemp.miniupdate
      # Move player in the direction the directional button is being pressed
      if [EMAIL="dir==@lastdir"]dir==@lastdir[/EMAIL] && [EMAIL="Graphics.frame_count-@lastdirframe>2"]Graphics.frame_count-@lastdirframe>2[/EMAIL]
       case dir
       when 2
         move_down
       when 4
         move_left
       when 6
         move_right
       when 8
         move_up
       end
      elsif [EMAIL="dir!=@lastdir"]dir!=@lastdir[/EMAIL]
       case dir
       when 2
         turn_down
       when 4
         turn_left
       when 6
         turn_right
       when 8
         turn_up
       end
      end
    end
    $PokemonTemp.dependentEvents.updateDependentEvents
    if [EMAIL="dir!=@lastdir"]dir!=@lastdir[/EMAIL]
     @lastdirframe=Graphics.frame_count
    end
    @lastdir=dir
    # Remember coordinates in local variables
    last_real_x = @real_x
    last_real_y = @real_y
    super
    center_x = (Graphics.width/2 - 16) * 4   # Center screen x-coordinate * 4
    center_y = (Graphics.height/2 - 16) * 4   # Center screen y-coordinate * 4
    # If character moves down and is positioned lower than the center
    # of the screen
    if @real_y > last_real_y and @real_y - $game_map.display_y > center_y
      # Scroll map down
      $game_map.scroll_down(@real_y - last_real_y)
    end
    # If character moves left and is positioned more let on-screen than
    # center
    if @real_x < last_real_x and @real_x - $game_map.display_x < center_x
      # Scroll map left
      $game_map.scroll_left(last_real_x - @real_x)
    end
    # If character moves right and is positioned more right on-screen than
    # center
    if @real_x > last_real_x and @real_x - $game_map.display_x > center_x
      # Scroll map right
      $game_map.scroll_right(@real_x - last_real_x)
    end
    # If character moves up and is positioned higher than the center
    # of the screen
    if @real_y < last_real_y and @real_y - $game_map.display_y < center_y
      # Scroll map up
      $game_map.scroll_up(last_real_y - @real_y)
    end
    # If not moving
    unless moving?
      # If player was moving last time
      if last_moving
        $PokemonTemp.dependentEvents.pbTurnDependentEvents
        result = pbCheckEventTriggerFromDistance([2])
        # Event determinant is via touch of same position event
        result |= check_event_trigger_here([1,2])
        # If event which started does not exist
        Kernel.pbOnStepTaken(result) # *Added function call
        if result == false
        end
      end
      # If C button was pressed
      if Input.trigger?(Input::C) && !$PokemonTemp.miniupdate
        # Same position and front event determinant
        check_event_trigger_here([0],true)
        check_event_trigger_there([0,2],true) # *Modified to prevent unnecessary triggers
      end
    end
  end
  # This number is the interval between bump sounds
  BUMP_INTERVAL = 18
  
  def bump_sound(dir)
    if dir != @last_bump or @bump_timer == 0
      @bump_timer = BUMP_INTERVAL
      Audio.se_play("Audio/SE/bump.wav")
    end
    @last_bump = dir
  end
  
  alias bwd_bump_gmplyr_update :update
  def update(*args)
    bwd_bump_gmplyr_update(*args)
    if @bump_timer == nil
     @bump_timer = 0
     @last_bump = 0
    end
    @bump_timer -= 1 if @bump_timer > 0
  end
end
 
First, thank you a lot for the great Pedap Kit!
Then I have two questions for the system:

1. When Gastrodon used Waterpulse, it will show this error Message:

Exception: NameError
Message: undefined local variable or method `targets' for #<PokeBattle_Move_4C:0x8e37b28>
PokeBattle_Move:335:in `pbCalcBaseDamage'
PokeBattle_Move:634:in `pbCalcDamage'
PokeBattle_Move:819:in `pbEffect'
PokeBattle_Battler:1416:in `pbProcessNonMultiHitMove'
PokeBattle_Battler:1655:in `pbUseMove'
PokeBattle_Battler:1632:in `loop'
PokeBattle_Battler:1658:in `pbUseMove'
PokeBattle_Battler:1932:in `pbProcessTurn'
PokeBattle_Battler:1931:in `logonerr'
PokeBattle_Battler:1931:in `pbProcessTurn'

What's here the problem?

2. When I go with Eeeve to the special place for his evolution, I can give him Rarecandy, but it's dont's evolution. Must I defined the Switches numbers 101 and 102 for his special Evolution in the script? And when yes, where I can do it?
 
Ok folks. Sorry for the lengthy absence, I've had fun times with a virus and have had to reinstall my OS. I'm getting everything back up and running so any questions will be answered just as soon as the computer is back to 'normal'.
 
There's a bug on the Basic version. A Fighting-type Judgment is "not very effective" against a Geodude, and Tackle can hit directly Ghost-type Pokemon.
 
Firstly, I would like to say that you've done an excellent job with this, the amount of effort that you and Wichu have put in to create this for the community is exceptional.
And I have a little request for anyone who ca be bothered too do it. If someone wouldn't mind, could they please upload it onto a place like Sendspace or Rapidshare?
My internet won't process the script on Mediafire.
Anyway, thank you so much for taking time out to make this great resource for the community.

Edit: Don't worry about uploading it, I used another browser.
 
Last edited:
Ok guys. Looking back at my code, I realise I got sloppy at some point. There will be an update soon that will fix the Eevee evolution code (I had it in there and it disappeared!!!). Fix the Water move problem (It isn't just Storm Drain), include the Game_Player script included by Blazing Charizard, have generally better notes and comments and investigate a few other things. Just bear with me folks!
 
Hey mad.array, I can't wait to use your kit! When is it going to be released?

BTW: I downloaded the beta/alpha/test/whatever and it's cool, really cool but, i copy-pasted the scripts(i thinks the correct ones) and the PBS folder but I can't see the moves when either i use the debug option or write down which pokémon learn a move and... they just don't learn it.
So, how can I transfer/move the moves and abilities to have them on my game? or what should I do?


Ah, and the final thing: I finally made the complete screen resolution change!!!! *celestial chorus* and the battle looks awesome!!!!! *celestial chorus...again* check it out later, I will add comments for everyone to understand.
 
@Fraot: Dude, it's out. The link on the first page is the first version. Ok so it's beta quality, but with the lack of reliable testers out there *shakes fist* I decided to let the end users point out any problems. If you read the first post then you should get all the info you need. Though it might be worth waiting for the update as I'm going to be COMMENTING (Yeah, you heard it right!!). As for copying the scripts et al accross, the information is in the PBS files and providing you've copied the scripts accross properly, should work without a hitch.

Hey, kudos on the resolution change! I'll bet the gen iv sprites look way better now!!!!

@kitsukitty: Thanks for the gesture, but Brave Bird is already in. Unless it's jumped out of the code in the same way that the Eevee evolutions did!
 
Cool! ^^
Well I believe I've generated the right code for Brave Bird. Am I allowed to share it here?

@kitsukitty: Thanks for the gesture, but Brave Bird is already in. Unless it's jumped out of the code in the same way that the Eevee evolutions did!
Don't let that put you off, though. Feel free to share anything you want to.
 
@Shaggy Typhlosion: The Normal moves hitting ghost types has been fixed and will be included with the update. As for the Judgment issue, there is a txt file in the basic folder which tells you what is missing from the Basic version, Judgment is one of the things that isn't included.
 
When will the update be around? I'm waiting on moving my entire project over to this soon.

Also, how come Transform doesn't actually turn ditto into the opposing pokemon? If this could be fixed it'd be a treat.
 
I don't get something. If I import any of the new terrain types (e.g. Puddle) into my game, the terrain condition doesn't work. So i have puddles without reflection. I thought i was importing it wrong so i just copied all the scripts you have in, and still doesn't work. :S
 
I don't get something. If I import any of the new terrain types (e.g. Puddle) into my game, the terrain condition doesn't work. So i have puddles without reflection. I thought i was importing it wrong so i just copied all the scripts you have in, and still doesn't work. :S
As I recall, "puddle" comes with the original Essentials kit. Look it up in the notes, if you haven't already. You want terrain tag 6.

It's not a scripts thing, it's a "define tileset tiles" thing.
 
As I recall, "puddle" comes with the original Essentials kit. Look it up in the notes, if you haven't already. You want terrain tag 6.

It's not a scripts thing, it's a "define tileset tiles" thing.

I know that and I've read the notes like a gazillion times. And the terrain tag is for lakes which show the reflection and you can surf on them. mad.array made a terrain tag for puddle (i think it's 14) that shows the reflection but disables surf. What I'm saying is that none of his scripts work with my game for some odd reason.
 
I know that and I've read the notes like a gazillion times. And the terrain tag is for lakes which show the reflection and you can surf on them. mad.array made a terrain tag for puddle (i think it's 14) that shows the reflection but disables surf. What I'm saying is that none of his scripts work with my game for some odd reason.

He might have another script point to the terrain tag.
 
I thought i was importing it wrong so i just copied all the scripts you have in, and still doesn't work. :S

I don't think that I missed out on any unknown scripts. I'm just quoting myself for emphasis. Ahhh...never mind. I'll just make my own one that hopefully will be compatible.
 
As I recall, "puddle" comes with the original Essentials kit. Look it up in the notes, if you haven't already. You want terrain tag 6.

It's not a scripts thing, it's a "define tileset tiles" thing.

That's not puddle :S that's shallow water that you can surf on.

Anyway uh, I think all the scripts with a * by them need to be copied.

UPDATED POST:

Yeah, I've done 140 edits to the items.txt, including fixing tons of typos and out-dated descriptions for items. I've missed a few prices but should otherwise be fine. I added Old Gateau, Skull Fossil, all the DP mail types etc.

eugh, I can't post URLs. Lemme make 10 posts and I'll get back to you.

(I've done some changes to the game script for the items, and also coded around the bumping sound to make it not so fast, and resized the window to DP size. :3 I'll upload it once I'm done with the items.)
 
Last edited:
Sorry if this is considered a double post, but I still can't add URL's to a previous post so:

202 edits to items.txt
https://pokemon.hashpixel.com/items.txt

Hope you like. I'll finish all 629 items soon.

EDIT: Alright, I've done 320 edits now. Takes a while. I'm only editing the prices and descriptions, I can't code any.
 
Last edited:
Back
Top