The PokéCommunity Forums Fan Games Game Development Pokémon Essentials
Essentials Question Game Crashes When Encountering Wild Pokemon

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    
Old 5 Days Ago (12:55 PM).
SpartaLazor's Avatar
SpartaLazor SpartaLazor is offline
A238
     
    Join Date: Sep 2015
    Location: North Carolina
    Gender: Male
    Posts: 210
    Hi all. Lately I've been having an issue where the game crashes upon starting a wild encounter. This is the error message:



    Based off of that, I think it means that there are a couple of sections of code that are calling the method "length" but that is missing. That's about as far as I can get, though. I really don't know how to rectify this. I've tried comparing several scripts to the default Essentials coding, but I've yet to find a discrepancy.

    This issue is kinda holding up all development, so any and all assistance would be appreciated.
    __________________

    Name: Voi
    Adopt one yourself! @Pokémon Orphanage
    Reply With Quote

    Relevant Advertising!

      #2    
    Old 4 Days Ago (6:42 PM).
    Becquerel Becquerel is offline
       
      Join Date: Aug 2018
      Posts: 17
      Could you post your script? Looking at mine, my script for generating a wild battle is. Another option would be booting up a clean slate of essentials and then copy-pasting those portions of script over to yours.

      Quote:
      ################################################################################
      # Main battle class.
      ################################################################################
      class PokeBattle_Battle
      attr_reader(:scene) # Scene object for this battle
      attr_accessor(:decision) # Decision: 0=undecided; 1=win; 2=loss; 3=escaped; 4=caught
      attr_accessor(:internalbattle) # Internal battle flag
      attr_accessor(:doublebattle) # Double battle flag
      attr_accessor(:cantescape) # True if player can't escape
      attr_accessor(:shiftStyle) # Shift/Set "battle style" option
      attr_accessor(:battlescene) # "Battle scene" option
      attr_accessor(:debug) # Debug flag
      attr_reader(:player) # Player trainer
      attr_reader(:opponent) # Opponent trainer
      attr_reader(:party1) # Player's Pokémon party
      attr_reader(:party2) # Foe's Pokémon party
      attr_reader(:party1order) # Order of Pokémon in the player's party
      attr_reader(:party2order) # Order of Pokémon in the opponent's party
      attr_accessor(:fullparty1) # True if player's party's max size is 6 instead of 3
      attr_accessor(:fullparty2) # True if opponent's party's max size is 6 instead of 3
      attr_reader(:battlers) # Currently active Pokémon
      attr_accessor(:items) # Items held by opponents
      attr_reader(:sides) # Effects common to each side of a battle
      attr_reader(:field) # Effects common to the whole of a battle
      attr_accessor(:environment) # Battle surroundings
      attr_accessor(:weather) # Current weather, custom methods should use pbWeather instead
      attr_accessor(:weatherduration) # Duration of current weather, or -1 if indefinite
      attr_reader(:switching) # True if during the switching phase of the round
      attr_reader(:futuresight) # True if Future Sight is hitting
      attr_reader(:struggle) # The Struggle move
      attr_accessor(:choices) # Choices made by each Pokémon this round
      attr_reader(:successStates) # Success states
      attr_accessor(:lastMoveUsed) # Last move used
      attr_accessor(:lastMoveUser) # Last move user
      attr_accessor(:megaEvolution) # Battle index of each trainer's Pokémon to Mega Evolve
      attr_accessor(:amuletcoin) # Whether Amulet Coin's effect applies
      attr_accessor(:extramoney) # Money gained in battle by using Pay Day
      attr_accessor(:doublemoney) # Whether Happy Hour's effect applies
      attr_accessor(:endspeech) # Speech by opponent when player wins
      attr_accessor(:endspeech2) # Speech by opponent when player wins
      attr_accessor(:endspeechwin) # Speech by opponent when opponent wins
      attr_accessor(:endspeechwin2) # Speech by opponent when opponent wins
      attr_accessor(:rules)
      attr_reader(:turncount)
      attr_accessor :controlPlayer
      include PokeBattle_BattleCommon

      MAXPARTYSIZE = 6

      class BattleAbortedException < Exception; end

      def pbAbort
      raise BattleAbortedException.new("Battle aborted")
      end

      def pbDebugUpdate
      end

      def pbRandom(x)
      return rand(x)
      end

      def pbAIRandom(x)
      return rand(x)
      end

      ################################################################################
      # Initialise battle class.
      ################################################################################
      def initialize(scene,p1,p2,player,opponent)
      if p1.length==0
      raise ArgumentError.new(_INTL("Party 1 has no Pokémon."))
      return
      end
      if p2.length==0
      raise ArgumentError.new(_INTL("Party 2 has no Pokémon."))
      return
      end
      if p2.length>2 && !opponent
      raise ArgumentError.new(_INTL("Wild battles with more than two Pokémon are not allowed."))
      return
      end
      @scene = scene
      @decision = 0
      @internalbattle = true
      @doublebattle = false
      @cantescape = false
      @shiftStyle = true
      @battlescene = true
      @debug = false
      @debugupdate = 0
      if opponent && player.is_a?(Array) && player.length==0
      player = player[0]
      end
      if opponent && opponent.is_a?(Array) && opponent.length==0
      opponent = opponent[0]
      end
      @player = player # PokeBattle_Trainer object
      @opponent = opponent # PokeBattle_Trainer object
      @party1 = p1
      @party2 = p2
      @party1order = []
      for i in 0...12; @party1order.push(i); end
      @party2order = []
      for i in 0...12; @party2order.push(i); end
      @fullparty1 = false
      @fullparty2 = false
      @battlers = []
      @items = nil
      @sides = [PokeBattle_ActiveSide.new, # Player's side
      PokeBattle_ActiveSide.new] # Foe's side
      @field = PokeBattle_ActiveField.new # Whole field (gravity/rooms)
      @environment = PBEnvironment::None # e.g. Tall grass, cave, still water
      @weather = 0
      @weatherduration = 0
      @switching = false
      @futuresight = false
      @choices = [ [0,0,nil,-1],[0,0,nil,-1],[0,0,nil,-1],[0,0,nil,-1] ]
      @successStates = []
      for i in 0...4
      @successStates.push(PokeBattle_SuccessState.new)
      end
      @lastMoveUsed = -1
      @lastMoveUser = -1
      @nextPickupUse = 0
      @megaEvolution = []
      if @player.is_a?(Array)
      @megaEvolution[0]=[-1]*@player.length
      else
      @megaEvolution[0]=[-1]
      end
      if @opponent.is_a?(Array)
      @megaEvolution[1]=[-1]*@opponent.length
      else
      @megaEvolution[1]=[-1]
      end
      @amuletcoin = false
      @extramoney = 0
      @doublemoney = false
      @endspeech = ""
      @endspeech2 = ""
      @endspeechwin = ""
      @endspeechwin2 = ""
      @rules = {}
      @turncount = 0
      @peer = PokeBattle_BattlePeer.create()
      @priority = []
      @usepriority = false
      @snaggedpokemon = []
      @runCommand = 0
      if hasConst?(PBMoves,:STRUGGLE)
      @struggle = PokeBattle_Move.pbFromPBMove(self,PBMove.new(getConst(PBMoves,:STRUGGLE)))
      else
      @struggle = PokeBattle_Struggle.new(self,nil)
      end
      @struggle.pp = -1
      for i in 0...4
      battlers[i] = PokeBattle_Battler.new(self,i)
      end
      for i in @party1
      next if !i
      i.itemRecycle = 0
      i.itemInitial = i.item
      i.belch = false
      end
      for i in @party2
      next if !i
      i.itemRecycle = 0
      i.itemInitial = i.item
      i.belch = false
      end
      end
      Reply With Quote
        #3    
      Old 4 Days Ago (9:29 PM).
      SpartaLazor's Avatar
      SpartaLazor SpartaLazor is offline
      A238
         
        Join Date: Sep 2015
        Location: North Carolina
        Gender: Male
        Posts: 210
        Quote:
        Originally Posted by Becquerel View Post
        Could you post your script? Looking at mine, my script for generating a wild battle is. Another option would be booting up a clean slate of essentials and then copy-pasting those portions of script over to yours.
        Actually it's been taken care of right now. It seems that I had completely screwed over that copy of Essentials, so I moved everything over to a fresh copy. So far, so good. I appreciate the response though.
        __________________

        Name: Voi
        Adopt one yourself! @Pokémon Orphanage
        Reply With Quote
          #4    
        Old 4 Days Ago (1:02 AM).
        Becquerel Becquerel is offline
           
          Join Date: Aug 2018
          Posts: 17
          No problem. If it happens again, you could always try restarting your computer as well. Don't know why but I had a problem where it crashed every time I fought a trainer. Restarting it fixed the problem. Weirdest thing I've seen so far.
          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 1:09 PM.