The PokéCommunity Forums Fan Games Game Development Scripts, Tutorials & Tools
Essentials Script Plug-and-play Delta Pokemon/Alolan Forms script

Scripts, Tutorials & Tools 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
 
Thread Tools
  #26    
Old August 24th, 2016 (3:48 PM).
BlackOutG5's Avatar
BlackOutG5 BlackOutG5 is offline
     
    Join Date: Jul 2015
    Gender: Male
    Nature: Bold
    Posts: 77
    Fixed it again by changing the directory from "Graphics/Battlers/%03d%s%s%s%s%s%s" to "Graphics/Battlers#{folder}%03d%s%s%s%s%s%s" for bw essentials
    Reply With Quote
      #27    
    Old August 24th, 2016 (10:59 PM). Edited August 24th, 2016 by Rot8er_ConeX.
    Rot8er_ConeX's Avatar
    Rot8er_ConeX Rot8er_ConeX is offline
       
      Join Date: May 2015
      Location: The Dissa Region
      Gender: Male
      Posts: 822
      Spoiler:
      Code:
      #########################################################################
      # Delta Pokemon/Alolan Form code
      # This is compatible with Essentials v16.2
      # Also compatible with Luka's Elite Battle System (EBS),
      #     Klien's BW Essentials kit,
      #     and mej's Following Pokemon script
      # Note that this code adds the Alolan forms as code within the game
      # It does not automatically create the Alolan forms as possible
      #     encounters.
      # You as the game developer need to decide how you want players to
      #     encounter the Alolan Pokemon.
      #########################################################################
      # To use
      # 1.) place in a new script section below "PSystem_Utilities" but
      #     above "Main"
      #  - if using the EBS or Following Pokemon scripts, place below those
      #      scripts as well as "PSystem_Utilities"
      # 2.) Decide how you want the player to encounter Delta/Alolan Pokemon
      #  - see the bottom of this script for an example that makes Alolan
      #      Exeggutor appear on a certain map
      #########################################################################
      
      # Battlers
      
      class PokeBattle_Battler
        def isDelta?
          return (@pokemon) ? @pokemon.isDelta? : false
        end
        
        def isAlolan?
          return (@pokemon) ? @pokemon.isDelta? : false
        end
        
        def isAlolaForm?
          return (@pokemon) ? @pokemon.isDelta? : false
        end
      end
      
      class PokeBattle_FakeBattler
        def isDelta?; return @pokemon.isDelta?; end
        def isAlolan?; return @pokemon.isDelta?; end
        def isAlolaForm?; return @pokemon.isDelta?; end
      end
      
      # Pokemon
      
      class PokeBattle_Pokemon
        attr_accessor(:deltaflag)   # Forces the deltaness (true/false)
        
        def isDelta?
          return @deltaflag if @deltaflag != nil
        end
        
        def isAlolan?
          return @deltaflag if @deltaflag != nil
        end
        
        def isAlolaForm?
          return @deltaflag if @deltaflag != nil
        end
      end
      
      ##############################################################
      # Appearance change
      ##############################################################
      class PokemonSprite < SpriteWrapper
        def setSpeciesBitmap(species,female=false,form=0,shiny=false,shadow=false,back=false,egg=false,delta=false)
          @_iconbitmap.dispose if @_iconbitmap
          @_iconbitmap=species>0 ? pbLoadSpeciesBitmap(species,female,form,shiny,shadow,back,egg,delta) : nil
          [email protected]_iconbitmap ? @_iconbitmap.bitmap : nil
        end
      end
      
      class PokemonEggHatchScene
        def pbStartScene(pokemon)
          @sprites={}
          @pokemon=pokemon
          @nicknamed=false
          @viewport=Viewport.new(0,0,Graphics.width,Graphics.height)
          @viewport.z=99999
          addBackgroundOrColoredPlane(@sprites,"background","hatchbg",
             Color.new(248,248,248),@viewport)
          @sprites["pokemon"]=PokemonSprite.new(@viewport)
          @sprites["pokemon"].setSpeciesBitmap(@pokemon.species,@pokemon.isFemale?,
                                               (@pokemon.form rescue 0),@pokemon.isShiny?,
                                               false,false,true,(@pokemon.isDelta? rescue false)) # Egg sprite
          @sprites["pokemon"].x=Graphics.width/[email protected]["pokemon"].bitmap.width/2
          @sprites["pokemon"].y=48+([email protected]["pokemon"].bitmap.height)/2
          @sprites["hatch"]=BitmapSprite.new(Graphics.width,Graphics.height,@viewport)
          @sprites["overlay"]=BitmapSprite.new(Graphics.width,Graphics.height,@viewport)
          @sprites["overlay"].z=200
          @sprites["overlay"].bitmap=Bitmap.new(Graphics.width,Graphics.height)
          @sprites["overlay"].bitmap.fill_rect(0,0,Graphics.width,Graphics.height,
              Color.new(255,255,255))
          @sprites["overlay"].opacity=0
          pbFadeInAndShow(@sprites)
        end
      end
      
      def pbLoadPokemonBitmap(pokemon, back=false, scale=nil)
        return pbLoadPokemonBitmapSpecies(pokemon,pokemon.species,back,scale)
      end
      
      # Note: Returns an AnimatedBitmap, not a Bitmap
      def pbLoadPokemonBitmapSpecies(pokemon, species, back=false, scale=nil)
        ret=nil
        if scale==nil
          scale=1
          scale=POKEMONSPRITESCALE if POKEMONSPRITESCALE != nil
        end
        if pokemon.isEgg?
          bitmapFileName=sprintf("Graphics/Battlers/%segg",getConstantName(PBSpecies,species)) rescue nil
          if !pbResolveBitmap(bitmapFileName)
            bitmapFileName=sprintf("Graphics/Battlers/%03degg",species)
            if !pbResolveBitmap(bitmapFileName)
              bitmapFileName=sprintf("Graphics/Battlers/egg")
            end
          end
          bitmapFileName=pbResolveBitmap(bitmapFileName)
        else
          bitmapFileName=pbCheckPokemonBitmapFiles([species,back,
                                                    (pokemon.isFemale?),
                                                    pokemon.isShiny?,
                                                    (pokemon.form rescue 0),
                                                    (pokemon.isShadow? rescue false),
                                                    (pokemon.isDelta? rescue false)])
          # Alter bitmap if supported
          alterBitmap=(MultipleForms.getFunction(species,"alterBitmap") rescue nil)
        end
        if bitmapFileName && alterBitmap
          animatedBitmap=AnimatedBitmap.new(bitmapFileName)
          copiedBitmap=animatedBitmap.copy
          animatedBitmap.dispose
          copiedBitmap.each {|bitmap|
             alterBitmap.call(pokemon,bitmap)
          }
          ret=copiedBitmap
          if defined?(DynamicPokemonSprite) # if EBS code exists
            animatedBitmap=AnimatedBitmapWrapper.new(bitmapFileName,scale)
            animatedBitmap.prepareStrip
            for i in 0...animatedBitmap.totalFrames
              alterBitmap.call(pokemon,animatedBitmap.alterBitmap(i))
            end
            animatedBitmap.compileStrip
            ret=animatedBitmap
          end
        elsif bitmapFileName
          ret=AnimatedBitmap.new(bitmapFileName)
          ret=AnimatedBitmapWrapper.new(bitmapFileName,scale) if defined?(DynamicPokemonSprite) # if EBS code exists
        end
        return ret
      end
      
      # Note: Returns an AnimatedBitmap, not a Bitmap
      def pbLoadSpeciesBitmap(species,female=false,form=0,shiny=false,shadow=false,back=false,egg=false,delta=false)
        ret=nil
        if egg
          bitmapFileName=sprintf("Graphics/Battlers/%segg",getConstantName(PBSpecies,species)) rescue nil
          if !pbResolveBitmap(bitmapFileName)
            bitmapFileName=sprintf("Graphics/Battlers/%03degg",species)
            if !pbResolveBitmap(bitmapFileName)
              bitmapFileName=sprintf("Graphics/Battlers/egg")
            end
          end
          bitmapFileName=pbResolveBitmap(bitmapFileName)
        else
          bitmapFileName=pbCheckPokemonBitmapFiles([species,back,female,shiny,form,shadow,delta])
        end
        if bitmapFileName
          ret=AnimatedBitmap.new(bitmapFileName)
        end
        return ret
      end
      
      def pbCheckPokemonBitmapFiles(params)
        species=params[0]
        back=params[1]
        factors=[]
        factors.push([5,params[5],false]) if params[5] && params[5]!=false     # shadow
        factors.push([2,params[2],false]) if params[2] && params[2]!=false     # gender
        factors.push([3,params[3],false]) if params[3] && params[3]!=false     # shiny
        factors.push([4,params[4].to_s,""]) if params[4] && params[4].to_s!="" &&
                                                            params[4].to_s!="0" # form
        factors.push([6,params[6],false]) if params[6] && params[6]!=false     # shiny
        tshadow=false
        tgender=false
        tshiny=false
        tdelta=false
        tform=""
        for i in 0...2**factors.length
          for j in 0...factors.length
            case factors[j][0]
            when 2   # gender
              tgender=((i/(2**j))%2==0) ? factors[j][1] : factors[j][2]
            when 3   # shiny
              tshiny=((i/(2**j))%2==0) ? factors[j][1] : factors[j][2]
            when 4   # form
              tform=((i/(2**j))%2==0) ? factors[j][1] : factors[j][2]
            when 5   # shadow
              tshadow=((i/(2**j))%2==0) ? factors[j][1] : factors[j][2]
            when 6   # delta
              tdelta=((i/(2**j))%2==0) ? factors[j][1] : factors[j][2]
            end
          end
          folder=""
          if defined?(GetKeyItemScene) # if BW data exists
            folder="Front/"  
            folder="Back/" if back
            folder="FrontShiny/" if tshiny
            folder="BackShiny/" if back && tshiny    
            folder+="Female/" if tgender
          end
          bitmapFileName=sprintf("Graphics/Battlers/%s%s%s%s%s%s%s%s",
             folder,
             getConstantName(PBSpecies,species),
             tgender ? "f" : "",
             tshiny ? "s" : "",
             tdelta ? "d" : "",
             back ? "b" : "",
             (tform!="" ? "_"+tform : ""),
             tshadow ? "_shadow" : "") rescue nil
          ret=pbResolveBitmap(bitmapFileName)
          return ret if ret
          bitmapFileName=sprintf("Graphics/Battlers/%s%03d%s%s%s%s%s%s",
             folder, species,
             tgender ? "f" : "",
             tshiny ? "s" : "",
             tdelta ? "d" : "",
             back ? "b" : "",
             (tform!="" ? "_"+tform : ""),
             tshadow ? "_shadow" : "")
          ret=pbResolveBitmap(bitmapFileName)
          return ret if ret
        end
        return nil
      end
      
      def pbPokemonIconFile(pokemon)
        bitmapFileName=nil
        bitmapFileName=pbCheckPokemonIconFiles([pokemon.species,
                                                (pokemon.isFemale?),
                                                pokemon.isShiny?,
                                                (pokemon.form rescue 0),
                                                (pokemon.isShadow? rescue false),
                                                pokemon.isDelta?],
                                                pokemon.isEgg?)
        return bitmapFileName
      end
      
      def pbCheckPokemonIconFiles(params,egg=false)
        species=params[0]
        if egg
          bitmapFileName=sprintf("Graphics/Icons/icon%segg",getConstantName(PBSpecies,species)) rescue nil
          if !pbResolveBitmap(bitmapFileName)
            bitmapFileName=sprintf("Graphics/Icons/icon%03degg",species) 
            if !pbResolveBitmap(bitmapFileName)
              bitmapFileName=sprintf("Graphics/Icons/iconEgg")
            end
          end
          return pbResolveBitmap(bitmapFileName)
        else
          factors=[]
          factors.push([4,params[4],false]) if params[4] && params[4]!=false     # shadow
          factors.push([1,params[1],false]) if params[1] && params[1]!=false     # gender
          factors.push([2,params[2],false]) if params[2] && params[2]!=false     # shiny
          factors.push([5,params[5],false]) if params[5] && params[5]!=false     # delta
          factors.push([3,params[3].to_s,""]) if params[3] && params[3].to_s!="" &&
                                                              params[3].to_s!="0" # form
          tshadow=false
          tgender=false
          tshiny=false
          tdelta=false
          tform=""
          for i in 0...2**factors.length
            for j in 0...factors.length
              case factors[j][0]
              when 1   # gender
                tgender=((i/(2**j))%2==0) ? factors[j][1] : factors[j][2]
              when 2   # shiny
                tshiny=((i/(2**j))%2==0) ? factors[j][1] : factors[j][2]
              when 3   # form
                tform=((i/(2**j))%2==0) ? factors[j][1] : factors[j][2]
              when 4   # shadow
                tshadow=((i/(2**j))%2==0) ? factors[j][1] : factors[j][2]
              when 5   # delta
                tdelta=((i/(2**j))%2==0) ? factors[j][1] : factors[j][2]
              end
            end
            bitmapFileName=sprintf("Graphics/Icons/icon%s%s%s%s%s%s",
               getConstantName(PBSpecies,species),
               tgender ? "f" : "",
               tshiny ? "s" : "",
               tdelta ? "d" : "",
               (tform!="" ? "_"+tform : ""),
               tshadow ? "_shadow" : "") rescue nil
            ret=pbResolveBitmap(bitmapFileName)
            return ret if ret
            bitmapFileName=sprintf("Graphics/Icons/icon%03d%s%s%s%s%s",
               species,
               tgender ? "f" : "",
               tshiny ? "s" : "",
               tdelta ? "d" : "",
               (tform!="" ? "_"+tform : ""),
               tshadow ? "_shadow" : "")
            ret=pbResolveBitmap(bitmapFileName)
            return ret if ret
          end
        end
        return nil
      end
      
      #########################################################################
      # Following Pokemon compatibility
      #########################################################################
      class DependentEvents
        def change_sprite(id, shiny=nil, animation=nil, form=nil, gender=nil, shadow=false, delta=nil)
          events=$PokemonGlobal.dependentEvents
          for i in 0...events.length
            if events[i] && events[i][8]=="Dependent"
              file=FOLLOWER_FILE_DIR+pbCheckPokemonFollowerFiles([id,gender,shiny,delta,form,shadow])
              events[i][6]=file
              @realEvents[i].character_name=file
              if animation
                $scene.spriteset.addUserAnimation(Animation_Come_Out,@realEvents[i].x,@realEvents[i].y)
              end
              $game_variables[Walking_Time_Variable]=0
            end
          end
        end
        
        def refresh_sprite(animation=true)
          if $game_variables[Current_Following_Variable]!=0
            return unless $game_switches[Toggle_Following_Switch]
            return if $PokemonGlobal.bicycle
            if $Trainer.party[0].isShiny?
              shiny=true
            else
              shiny=false
            end
            if defined?($Trainer.party[0].isDelta?)
              delta = $Trainer.party[0].isDelta?
            else
              delta = false
            end
            if $Trainer.party[0].form>0
              form=$Trainer.party[0].form
            else
              form=nil
            end
            if defined?($Trainer.party[0].isShadow?)
              shadow = $Trainer.party[0].isShadow?
            else
              shadow = false
            end
            if $PokemonGlobal.surfing
              if $Trainer.party[0].hp>0 && !$Trainer.party[0].isEgg? && $Trainer.party[0].hasType?(:WATER) 
                events=$PokemonGlobal.dependentEvents
                if animation
                  for i in 0...events.length
                    $scene.spriteset.addUserAnimation(Animation_Come_Out,@realEvents[i].x,@realEvents[i].y)
                    pbWait(10)
                  end
                end
                change_sprite($Trainer.party[0].species, shiny, false, form, $Trainer.party[0].gender, shadow, delta)
              elsif ALWAYS_ANIMATED_CAN_SURF && ($Trainer.party[0].hasType?(:FLYING) || 
                isConst?($Trainer.party[0].ability,PBAbilities,:LEVITATE) ||
                ALWAYS_ANIMATED_FOLLOWERS.include?($Trainer.party[0].species)) &&
                !(ALWAYS_ANIMATED_EXCEPTION.include?($Trainer.party[0].species)) &&
                $Trainer.party[0].hp>0 && !$Trainer.party[0].isEgg? 
                events=$PokemonGlobal.dependentEvents
                if animation
                  for i in 0...events.length
                    $scene.spriteset.addUserAnimation(Animation_Come_Out,@realEvents[i].x,@realEvents[i].y)
                    pbWait(10)
                  end
                end
                change_sprite($Trainer.party[0].species, shiny, false, form, $Trainer.party[0].gender, shadow, delta)
              else
                remove_sprite(false)
              end  
            elsif $PokemonGlobal.diving
              if $Trainer.party[0].hp>0 && !$Trainer.party[0].isEgg? && $Trainer.party[0].hasType?(:WATER) && WATERPOKEMONCANDIVE
                events=$PokemonGlobal.dependentEvents
                if animation
                  for i in 0...events.length
                    $scene.spriteset.addUserAnimation(Animation_Come_Out,@realEvents[i].x,@realEvents[i].y)
                    pbWait(10)
                  end
                end
                change_sprite($Trainer.party[0].species, shiny, false, form, $Trainer.party[0].gender, shadow, delta)
              else
                remove_sprite(false)
              end  
            else
              if $Trainer.party[0].hp>0 && !$Trainer.party[0].isEgg? && $scene.is_a?(Scene_Map)
                events=$PokemonGlobal.dependentEvents
                if animation
                  for i in 0...events.length
                    $scene.spriteset.addUserAnimation(Animation_Come_Out,@realEvents[i].x,@realEvents[i].y)
                    pbWait(10)
                  end
                end
                change_sprite($Trainer.party[0].species, shiny, false, form, $Trainer.party[0].gender, shadow, delta)
              elsif $Trainer.party[0].hp<=0 || $Trainer.party[0].isEgg?
                remove_sprite(animation)
              end
            end
          else
            check_faint
          end
        end
        
        def Come_back(shiny=nil, animation=nil, delta=nil)
          return if !$game_variables[Following_Activated_Switch]
          return if $Trainer.party.length==0
          $PokemonTemp.dependentEvents.pbMoveDependentEvents
          events=$PokemonGlobal.dependentEvents
          if $game_variables[Current_Following_Variable]==$Trainer.party[0]
            remove_sprite(false)
            if $scene.is_a?(Scene_Map)
              for i in 0...events.length 
                $scene.spriteset.addUserAnimation(Animation_Come_Out,@realEvents[i].x,@realEvents[i].y)
              end
            end
          end
          if $Trainer.party[0].hp>0 && !$Trainer.party[0].isEgg?
            $game_variables[Current_Following_Variable]=$Trainer.party[0]
            refresh_sprite(animation)
          end
          for i in 0...events.length 
            if events[i] && events[i][8]=="Dependent"
              file=FOLLOWER_FILE_DIR+pbCheckPokemonFollowerFiles([id,gender,shiny,delta,form,shadow])
              events[i][6]=file
              @realEvents[i].character_name=file
              if animation
                $scene.spriteset.addUserAnimation(Animation_Come_Out,@realEvents[i].x,@realEvents[i].y)
              end
            end 
          end 
        end
      end
      
      # this is an entirely new function, not found in the official release of Following Pokemon
      # it searches for Follower sprites the same way base Essentials searches for battlers and icons
      # rather than a series of "if-than" events
      def pbCheckPokemonFollowerFiles(params)
        species=params[0]
        factors=[]
        factors.push([1,params[1],false]) if params[1] && params[1]!=false     # gender
        factors.push([2,params[2],false]) if params[2] && params[2]!=false     # shiny
        factors.push([3,params[3],false]) if params[3] && params[3]!=false     # delta
        factors.push([4,params[4].to_s,""]) if params[4] && params[4].to_s!="" # form
        factors.push([5,params[5],false]) if params[5] && params[5]!=false     # shadow
        tshadow=false
        tgender=false
        tshiny=false
        tdelta=false
        tform=""
        for i in 0...2**factors.length
          for j in 0...factors.length
            case factors[j][0]
            when 1   # gender
              tgender=((i/(2**j))%2==0) ? factors[j][1] : factors[j][2]
            when 2   # shiny
              tshiny=((i/(2**j))%2==0) ? factors[j][1] : factors[j][2]
            when 3   # delta
              tdelta=((i/(2**j))%2==0) ? factors[j][1] : factors[j][2]
            when 4   # form
              tform=((i/(2**j))%2==0) ? factors[j][1] : factors[j][2]
            when 5   # shadow
              tshadow=((i/(2**j))%2==0) ? factors[j][1] : factors[j][2]
            end
          end
          bitmapFileName=sprintf("%s%s%s%s%s%s",
             getConstantName(PBSpecies,species),
             tgender ? "f" : "",
             tshiny ? "s" : "",
             tdelta ? "d" : "",
             (tform!="" ? "_"+tform : ""),
             tshadow ? "_shadow" : "") rescue nil
          ret=pbResolveBitmap(sprintf("%s%s%s",FOLLOWER_FILE_PATH,FOLLOWER_FILE_DIR,bitmapFileName))
          return bitmapFileName if ret
          bitmapFileName=sprintf("%03d%s%s%s%s%s",
             species,
             tgender ? "f" : "",
             tshiny ? "s" : "",
             tdelta ? "d" : "",
             (tform!="" ? "_"+tform : ""),
             tshadow ? "_shadow" : "")
          ret=pbResolveBitmap(sprintf("%s%s%s",FOLLOWER_FILE_PATH,FOLLOWER_FILE_DIR,bitmapFileName))
          return bitmapFileName if ret
        end
      end
      
      ##############################################################
      # Hybrid AnimatedBitmapWrapper class to encompass both the
      #     EBS version's inputs and the BW version's ones
      ##############################################################
      class AnimatedBitmapWrapper
        attr_reader :width
        attr_reader :height
        attr_reader :totalFrames
        attr_reader :animationFrames
        attr_reader :currentIndex
        attr_accessor :scale
        
        def initialize(file,twoframe_scale=2)
          raise "filename is nil" if file==nil
          if scale.is_a?(Numeric) # EBS version
            @scale = twoframe_scale
            @twoframe = false
          elsif !!scale == scale # BW version
            @scale = 2
            @twoframe = twoframe_scale
          end
          @width = 0
          @height = 0
          @frame = 0
          @frames = 2
          @direction = +1
          @animationFinish = false
          @totalFrames = 0
          @currentIndex = 0
          @speed = 1
            # 0 - not moving at all
            # 1 - normal speed
            # 2 - medium speed
            # 3 - slow speed
          bmp = BitmapCache.load_bitmap(file)
          #bmp = Bitmap.new(file)
          @bitmapFile=Bitmap.new(bmp.width,bmp.height); @bitmapFile.blt(0,0,bmp,Rect.new(0,0,bmp.width,bmp.height))
          # initializes full Pokemon bitmap
          @bitmap=Bitmap.new(@bitmapFile.width,@bitmapFile.height)
          @bitmap.blt(0,0,@bitmapFile,Rect.new(0,0,@bitmapFile.width,@bitmapFile.height))
          @[email protected]*@scale
          @[email protected]*@scale
          
          @[email protected]/@bitmap.height
          @[email protected]*@frames
          # calculates total number of frames
          @loop_points=[0,@totalFrames]
          # first value is start, second is end
          
          @actualBitmap=Bitmap.new(@width,@height)
          @actualBitmap.clear
          @actualBitmap.stretch_blt(Rect.new(0,0,@width,@height),@bitmap,Rect.new(@currentIndex*(@width/@scale),0,@width/@scale,@height/@scale))
        end
        alias initialize_elite initialize
          
        def length; @totalFrames; end
        def disposed?; @actualBitmap.disposed?; end
        def dispose; @actualBitmap.dispose; end
        def copy; @actualBitmap.clone; end
        def bitmap; @actualBitmap; end
        def bitmap=(val); @actualBitmap=val; end
        def each; end
        def alterBitmap(index); return @strip[index]; end
          
        def prepareStrip
          @strip=[]
          for i in [email protected]
            bitmap=Bitmap.new(@width,@height)
            bitmap.stretch_blt(Rect.new(0,0,@width,@height),@bitmapFile,Rect.new((@width/@scale)*i,0,@width/@scale,@height/@scale))
            @strip.push(bitmap)
          end
        end
        def compileStrip
          @bitmap.clear
          for i in [email protected]
            @bitmap.stretch_blt(Rect.new((@width/@scale)*i,0,@width/@scale,@height/@scale),@strip[i],Rect.new(0,0,@width,@height))
          end
        end
        
        def reverse
          if @direction  >  0
            @direction=-1
          elsif @direction < 0
            @direction=+1
          end
        end
        
        def setLoop(start, finish)
          @loop_points=[start,finish]
        end
        
        def setSpeed(value)
          @speed=value
        end
        
        def toFrame(frame)
          if frame.is_a?(String)
            if frame=="last"
              [email protected]
            else
              frame=0
            end
          end
          [email protected] if frame > @totalFrames
          frame=0 if frame < 0
          @currentIndex=frame
          @actualBitmap.clear
          @actualBitmap.stretch_blt(Rect.new(0,0,@width,@height),@bitmap,Rect.new(@currentIndex*(@width/@scale),0,@width/@scale,@height/@scale))
        end
        
        def play
          return if @currentIndex >= @loop_points[1]-1
          self.update
        end
        
        def finished?
          return (@[email protected])
        end
        
        def update
          return false if @actualBitmap.disposed?
          return false if @speed < 1
          case @speed
          # frame skip
          when 1
            @frames=2
          when 2
            @frames=4
          when 3
            @frames=5
          end
          @frame+=1
          
          if @frame >[email protected]
            # processes animation speed
            @[email protected]
            @[email protected]_points[0] if @currentIndex >[email protected]_points[1]
            @[email protected]_points[1]-1 if @currentIndex < @loop_points[0]
            @frame=0
          end
          @actualBitmap.clear
          @actualBitmap.stretch_blt(Rect.new(0,0,@width,@height),@bitmap,Rect.new(@currentIndex*(@width/@scale),0,@width/@scale,@height/@scale))
          # updates the actual bitmap
        end
        alias update_elite update
          
        # returns bitmap to original state
        def deanimate
          @frame=0
          @currentIndex=0
          @actualBitmap.clear
          @actualBitmap.stretch_blt(Rect.new(0,0,@width,@height),@bitmap,Rect.new(@currentIndex*(@width/@scale),0,@width/@scale,@height/@scale))
        end
      end
      
      ##############################################################
      # Alolan Form differences
      ##############################################################
      
      MultipleForms.register(:RAICHU,{
      "getFormName"=>proc{|pokemon|
         next _INTL("Alola Form") if pokemon.isDelta?
         next
      },
      "type2"=>proc{|pokemon|
         next getID(PBTypes,:PSYCHIC) if pokemon.isDelta?
         next
      },
      "height"=>proc{|pokemon|
         next 0.7 if pokemon.isDelta?
         next
      },
      "weight"=>proc{|pokemon|
         next 21.0 if pokemon.isDelta?
         next
      },
      "getAbilityList"=>proc{|pokemon|
         if pokemon.isDelta?
           next [[getID(PBAbilities,:SURGESURFER),0],
      	         [getID(PBAbilities,:SURGESURFER),2]]
         end
         next
      },
      "onSetForm"=>proc{|pokemon,form|
         pbSeenForm(pokemon)
      }
      })
      
      MultipleForms.register(:MEOWTH,{
      "getFormName"=>proc{|pokemon|
         next _INTL("Alola Form") if pokemon.isDelta?
         next
      },
      "type1"=>proc{|pokemon|
         next getID(PBTypes,:DARK) if pokemon.isDelta?
         next
      },
      "type2"=>proc{|pokemon|
         next getID(PBTypes,:DARK) if pokemon.isDelta?
         next
      },
      "onSetForm"=>proc{|pokemon,form|
         pbSeenForm(pokemon)
      }
      })
      
      MultipleForms.register(:MAROWAK,{
      "getFormName"=>proc{|pokemon|
         next _INTL("Alola Form") if pokemon.isDelta?
         next
      },
      "type1"=>proc{|pokemon|
         next getID(PBTypes,:FIRE) if pokemon.isDelta?
         next
      },
      "type2"=>proc{|pokemon|
         next getID(PBTypes,:GHOST) if pokemon.isDelta?
         next
      },
      "weight"=>proc{|pokemon|
         next 34.0 if pokemon.isDelta?
         next
      },
      "getAbilityList"=>proc{|pokemon|
         if pokemon.isDelta?
           next [[getID(PBAbilities,:CURSEDBODY),0],
      	         [getID(PBAbilities,:LIGHTNINGROD),1]]
         end
         next
      },
      "onSetForm"=>proc{|pokemon,form|
         pbSeenForm(pokemon)
      }
      })
      
      MultipleForms.register(:VULPIX,{
      "getFormName"=>proc{|pokemon|
         next _INTL("Alola Form") if pokemon.isDelta?
         next
      },
      "type1"=>proc{|pokemon|
         next getID(PBTypes,:ICE) if pokemon.isDelta?
         next
      },
      "type2"=>proc{|pokemon|
         next getID(PBTypes,:ICE) if pokemon.isDelta?
         next
      },
      "getMoveList"=>proc{|pokemon|
         next if !pokemon.isDelta?
         movelist=[]
         if pokemon.isDelta?
           movelist=[[1,:POWDERSNOW],[4,:TAILWHIP],[7,:ROAR],[9,:BABYDOLLEYES],
      	           [10,:QUICKATTACK],[12,:CONFUSERAY],[15,:BLIZZARD],
      			   [18,:PAYBACK],[20,:ICEPUNCH],[23,:FEINTATTACK],[26,:HEX],
      			   [28,:ICEBEAM],[31,:EXTRASENSORY],[34,:SAFEGUARD],
      			   [36,:FROSTBREATH],[39,:IMPRISON],[44,:GRUDGE],[47,:CAPTIVATE]]
         end
         for i in movelist
           i[1]=getConst(PBMoves,i[1])
         end
         next movelist
      },
      "getAbilityList"=>proc{|pokemon|
         if pokemon.isDelta?
           next [[getID(PBAbilities,:SNOWCLOAK),0],
      	       [getID(PBAbilities,:SNOWCLOAK),2]]
         end
         next
      },
      "onSetForm"=>proc{|pokemon,form|
         pbSeenForm(pokemon)
      }
      })
      
      MultipleForms.register(:NINETAILS,{
      "getFormName"=>proc{|pokemon|
         next _INTL("Alola Form") if pokemon.isDelta?
         next
      },
      "type1"=>proc{|pokemon|
         next getID(PBTypes,:ICE) if pokemon.isDelta?
         next
      },
      "type2"=>proc{|pokemon|
         next getID(PBTypes,:FAIRY) if pokemon.isDelta?
         next
      },
      "getMoveList"=>proc{|pokemon|
         next if pokemon.form==0
         movelist=[]
         if pokemon.isDelta?
           movelist=[[1,:IMPRISON],[1,:NASTYPLOT],[1,:ICEBEAM],[1,:QUICKATTACK],
      	           [1,:CONFUSERAY],[1,:SAFEGUARD]]
         end
         for i in movelist
           i[1]=getConst(PBMoves,i[1])
         end
         next movelist
      },
      "getAbilityList"=>proc{|pokemon|
         if pokemon.isDelta?
           next [[getID(PBAbilities,:SNOWCLOAK),0],
      	       [getID(PBAbilities,:SNOWCLOAK),2]]
         end
         next
      },
      "onSetForm"=>proc{|pokemon,form|
         pbSeenForm(pokemon)
      }
      })
      
      MultipleForms.register(:SANDSHREW,{
      "getFormName"=>proc{|pokemon|
         next _INTL("Alola Form") if pokemon.isDelta?
         next
      },
      "type1"=>proc{|pokemon|
         next getID(PBTypes,:ICE) if pokemon.isDelta?
         next
      },
      "type2"=>proc{|pokemon|
         next getID(PBTypes,:STEEL) if pokemon.isDelta?
         next
      },
      "height"=>proc{|pokemon|
         next 0.6 if pokemon.isDelta?
         next
      },
      "weight"=>proc{|pokemon|
         next 40.0 if pokemon.isDelta?
         next
      },
      "getMoveList"=>proc{|pokemon|
         next if pokemon.form==0
         movelist=[]
         if pokemon.isDelta?
           movelist=[[1,:SCRATCH],[1,:DEFENSECURL],[3,:HAIL],[5,:ICEPUNCH],
      	           [7,:ROLLOUT],[9,:RAPIDSPIN],[11,:CUT],[14,:SHEERCOLD],
      			   [17,:SWIFT],[20,:FURYSWIPES],[23,:HAIL],[26,:SLASH],
      			   [30,:DIG],[34,:GYROBALL],[38,:SWORDSDANCE],[42,:HAIL],]
         end
         for i in movelist
           i[1]=getConst(PBMoves,i[1])
         end
         next movelist
      },
      "getAbilityList"=>proc{|pokemon|
         if pokemon.isDelta?
           next [[getID(PBAbilities,:SNOWCLOAK),0],
      	       [getID(PBAbilities,:SNOWCLOAK),2]]
         end
         next
      },
      "onSetForm"=>proc{|pokemon,form|
         pbSeenForm(pokemon)
      }
      })
      
      MultipleForms.register(:SANDSLASH,{
      "getFormName"=>proc{|pokemon|
         next _INTL("Alola Form") if pokemon.isDelta?
         next
      },
      "type1"=>proc{|pokemon|
         next getID(PBTypes,:ICE) if pokemon.isDelta?
         next
      },
      "type2"=>proc{|pokemon|
         next getID(PBTypes,:STEEL) if pokemon.isDelta?
         next
      },
      "height"=>proc{|pokemon|
         next 1.2 if pokemon.isDelta?
         next
      },
      "weight"=>proc{|pokemon|
         next 55.0 if pokemon.isDelta?
         next
      },
      "getMoveList"=>proc{|pokemon|
         next if pokemon.form==0
         movelist=[]
         if pokemon.isDelta?
           movelist=[[1,:SCRATCH],[1,:DEFENSECURL],[3,:HAIL],[5,:ICEPUNCH],
      	           [7,:ROLLOUT],[9,:RAPIDSPIN],[11,:CUT],[14,:SHEERCOLD],
      			   [17,:SWIFT],[20,:FURYSWIPES],[23,:HAIL],[26,:SLASH],
      			   [30,:DIG],[34,:GYROBALL],[38,:SWORDSDANCE],[42,:HAIL],]
         end
         for i in movelist
           i[1]=getConst(PBMoves,i[1])
         end
         next movelist
      },
      "getAbilityList"=>proc{|pokemon|
         if pokemon.isDelta?
           next [[getID(PBAbilities,:SNOWCLOAK),0],
      	       [getID(PBAbilities,:SNOWCLOAK),2]]
         end
         next
      },
      "onSetForm"=>proc{|pokemon,form|
         pbSeenForm(pokemon)
      }
      })
      
      MultipleForms.register(:EXEGGUTOR,{
      "getFormName"=>proc{|pokemon|
         next _INTL("Alola Form") if pokemon.isDelta?
         next
      },
      "type2"=>proc{|pokemon|
         next getID(PBTypes,:DRAGON) if pokemon.isDelta?
         next
      },
      "height"=>proc{|pokemon|
         next 10.9 if pokemon.isDelta?
         next
      },
      "weight"=>proc{|pokemon|
         next 415.6 if pokemon.isDelta?
         next
      },
      "getAbilityList"=>proc{|pokemon|
         if pokemon.isDelta?
           next [[getID(PBAbilities,:FRISK),0],
      	       [getID(PBAbilities,:FRISK),2]]
         end
         next
      },
      "getMoveList"=>proc{|pokemon|
         next if pokemon.form==0
         movelist=[]
         if pokemon.isDelta?
           movelist=[[1,:SEEDBOMB],[1,:BARRAGE],[1,:HYPNOSIS],[1,:CONFUSION],
      	           [1,:STOMP],[17,:PSYSHOCK],[27,:EGGBOMB],[37,:WOODHAMMER],
      			   [47,:LEAFSTORM]]
         end
         for i in movelist
           i[1]=getConst(PBMoves,i[1])
         end
         next movelist
      },
      "onSetForm"=>proc{|pokemon,form|
         pbSeenForm(pokemon)
      }
      })
      
      ###################################################################
      # EXAMPLE ENCOUNTER MODIFIER
      # "pokemon.deltaflag=true" is how to make the Pokemon a Delta/Alolan
      ###################################################################
      # Events.onWildPokemonCreate+=proc {|sender,e|
      #    pokemon=e[0]
      #    if $game_map.map_id==51 && isConst?(pokemon.species,PBSpecies,:EXEGGUTOR)
      #      pokemon.deltaflag=true
      #    end
      # }
      __________________
      Features of Pokemon Entropy

      The black circular "doodles" in the lower right corner of my avatar are actually my username written in Gallifreyan. Yes I'm a Whovian.
      Reply With Quote
        #28    
      Old August 25th, 2016 (7:47 AM).
      Zeak6464's Avatar
      Zeak6464 Zeak6464 is offline
      Zeak #3205 - Discord
         
        Join Date: Mar 2013
        Location: USA
        Age: 25
        Gender: Male
        Nature: Calm
        Posts: 557
        Quote:
        Originally Posted by Rot8er_ConeX View Post
        This script allows players to make Delta Pokemon (as fans have called them for a while) or Alolan Forms (as they are now officially known) without making them unique species or numbered forms.

        To use, put this code in a script section above Main, but below PSystem_Utilities. If using the EBS and/or Following Pokemon, place it below those scripts but above Main. If using KleinStudio's BW Essentials kit, paste it in a script section directly above Main.

        Code:
        #########################################################################
        # Delta Pokemon/Alolan Form code
        # This is compatible with Essentials v16.2
        # Also compatible with Luka's Elite Battle System (EBS),
        #     Klien's BW Essentials kit,
        #     and mej's Following Pokemon script
        # Note that this code adds the Alolan forms as code within the game
        # It does not automatically create the Alolan forms as possible
        #     encounters.
        # You as the game developer need to decide how you want players to
        #     encounter the Alolan Pokemon.
        #########################################################################
        # To use
        # 1.) place in a new script section below "PSystem_Utilities" but
        #     above "Main"
        #  - if using the EBS or Following Pokemon scripts, place below those
        #      scripts as well as "PSystem_Utilities"
        #  - if using the BW Essentials kit, paste directly above "Main"
        # 2.) Decide how you want the player to encounter Delta/Alolan Pokemon
        #  - see the bottom of this script for an example that makes Alolan
        #      Exeggutor appear on a certain map
        #########################################################################
        
        # Battlers
        
        class PokeBattle_Battler
          def isDelta?
            return (@pokemon) ? @pokemon.isDelta? : false
          end
          
          def isAlolan?
            return (@pokemon) ? @pokemon.isDelta? : false
          end
          
          def isAlolaForm?
            return (@pokemon) ? @pokemon.isDelta? : false
          end
        end
        
        class PokeBattle_FakeBattler
          def isDelta?; return @pokemon.isDelta?; end
          def isAlolan?; return @pokemon.isDelta?; end
          def isAlolaForm?; return @pokemon.isDelta?; end
        end
        
        # Pokemon
        
        class PokeBattle_Pokemon
          attr_accessor(:deltaflag)   # Forces the deltaness (true/false)
          
          def isDelta?
            return @deltaflag if @deltaflag != nil
          end
          
          def isAlolan?
            return @deltaflag if @deltaflag != nil
          end
          
          def isAlolaForm?
            return @deltaflag if @deltaflag != nil
          end
        end
        
        ##############################################################
        # Appearance change
        ##############################################################
        class PokemonSprite < SpriteWrapper
          def setSpeciesBitmap(species,female=false,form=0,shiny=false,shadow=false,back=false,egg=false,delta=false)
            @_iconbitmap.dispose if @_iconbitmap
            @_iconbitmap=species>0 ? pbLoadSpeciesBitmap(species,female,form,shiny,shadow,back,egg,delta) : nil
            [email protected]_iconbitmap ? @_iconbitmap.bitmap : nil
          end
        end
        
        class PokemonEggHatchScene
          def pbStartScene(pokemon)
            @sprites={}
            @pokemon=pokemon
            @nicknamed=false
            @viewport=Viewport.new(0,0,Graphics.width,Graphics.height)
            @viewport.z=99999
            addBackgroundOrColoredPlane(@sprites,"background","hatchbg",
               Color.new(248,248,248),@viewport)
            @sprites["pokemon"]=PokemonSprite.new(@viewport)
            @sprites["pokemon"].setSpeciesBitmap(@pokemon.species,@pokemon.isFemale?,
                                                 (@pokemon.form rescue 0),@pokemon.isShiny?,
                                                 false,false,true,(@pokemon.isDelta? rescue false)) # Egg sprite
            @sprites["pokemon"].x=Graphics.width/[email protected]["pokemon"].bitmap.width/2
            @sprites["pokemon"].y=48+([email protected]["pokemon"].bitmap.height)/2
            @sprites["hatch"]=BitmapSprite.new(Graphics.width,Graphics.height,@viewport)
            @sprites["overlay"]=BitmapSprite.new(Graphics.width,Graphics.height,@viewport)
            @sprites["overlay"].z=200
            @sprites["overlay"].bitmap=Bitmap.new(Graphics.width,Graphics.height)
            @sprites["overlay"].bitmap.fill_rect(0,0,Graphics.width,Graphics.height,
                Color.new(255,255,255))
            @sprites["overlay"].opacity=0
            pbFadeInAndShow(@sprites)
          end
        end
        
        def pbLoadPokemonBitmap(pokemon, back=false, scale=nil)
          return pbLoadPokemonBitmapSpecies(pokemon,pokemon.species,back,scale)
        end
        
        # Note: Returns an AnimatedBitmap, not a Bitmap
        def pbLoadPokemonBitmapSpecies(pokemon, species, back=false, scale=nil)
          ret=nil
          if scale==nil
            scale=1
            scale=POKEMONSPRITESCALE if POKEMONSPRITESCALE != nil
          end
          if pokemon.isEgg?
            bitmapFileName=sprintf("Graphics/Battlers/%segg",getConstantName(PBSpecies,species)) rescue nil
            if !pbResolveBitmap(bitmapFileName)
              bitmapFileName=sprintf("Graphics/Battlers/%03degg",species)
              if !pbResolveBitmap(bitmapFileName)
                bitmapFileName=sprintf("Graphics/Battlers/egg")
              end
            end
            bitmapFileName=pbResolveBitmap(bitmapFileName)
          else
            bitmapFileName=pbCheckPokemonBitmapFiles([species,back,
                                                      (pokemon.isFemale?),
                                                      pokemon.isShiny?,
                                                      (pokemon.form rescue 0),
                                                      (pokemon.isShadow? rescue false),
                                                      (pokemon.isDelta? rescue false)])
            # Alter bitmap if supported
            alterBitmap=(MultipleForms.getFunction(species,"alterBitmap") rescue nil)
          end
          if bitmapFileName && alterBitmap
            animatedBitmap=AnimatedBitmap.new(bitmapFileName)
            copiedBitmap=animatedBitmap.copy
            animatedBitmap.dispose
            copiedBitmap.each {|bitmap|
               alterBitmap.call(pokemon,bitmap)
            }
            ret=copiedBitmap
            if defined?(DynamicPokemonSprite) # if EBS code exists
              animatedBitmap=AnimatedBitmapWrapper.new(bitmapFileName,scale)
              animatedBitmap.prepareStrip
              for i in 0...animatedBitmap.totalFrames
                alterBitmap.call(pokemon,animatedBitmap.alterBitmap(i))
              end
              animatedBitmap.compileStrip
              ret=animatedBitmap
            end
          elsif bitmapFileName
            ret=AnimatedBitmap.new(bitmapFileName)
            ret=AnimatedBitmapWrapper.new(bitmapFileName,scale) if defined?(DynamicPokemonSprite) # if EBS code exists
          end
          return ret
        end
        
        # Note: Returns an AnimatedBitmap, not a Bitmap
        def pbLoadSpeciesBitmap(species,female=false,form=0,shiny=false,shadow=false,back=false,egg=false,delta=false)
          ret=nil
          if egg
            bitmapFileName=sprintf("Graphics/Battlers/%segg",getConstantName(PBSpecies,species)) rescue nil
            if !pbResolveBitmap(bitmapFileName)
              bitmapFileName=sprintf("Graphics/Battlers/%03degg",species)
              if !pbResolveBitmap(bitmapFileName)
                bitmapFileName=sprintf("Graphics/Battlers/egg")
              end
            end
            bitmapFileName=pbResolveBitmap(bitmapFileName)
          else
            bitmapFileName=pbCheckPokemonBitmapFiles([species,back,female,shiny,form,shadow,delta])
          end
          if bitmapFileName
            ret=AnimatedBitmap.new(bitmapFileName)
          end
          return ret
        end
        
        def pbCheckPokemonBitmapFiles(params)
          species=params[0]
          back=params[1]
          factors=[]
          factors.push([5,params[5],false]) if params[5] && params[5]!=false     # shadow
          factors.push([2,params[2],false]) if params[2] && params[2]!=false     # gender
          factors.push([3,params[3],false]) if params[3] && params[3]!=false     # shiny
          factors.push([4,params[4].to_s,""]) if params[4] && params[4].to_s!="" &&
                                                              params[4].to_s!="0" # form
          factors.push([6,params[6],false]) if params[6] && params[6]!=false     # shiny
          tshadow=false
          tgender=false
          tshiny=false
          tdelta=false
          tform=""
          for i in 0...2**factors.length
            for j in 0...factors.length
              case factors[j][0]
              when 2   # gender
                tgender=((i/(2**j))%2==0) ? factors[j][1] : factors[j][2]
              when 3   # shiny
                tshiny=((i/(2**j))%2==0) ? factors[j][1] : factors[j][2]
              when 4   # form
                tform=((i/(2**j))%2==0) ? factors[j][1] : factors[j][2]
              when 5   # shadow
                tshadow=((i/(2**j))%2==0) ? factors[j][1] : factors[j][2]
              when 6   # delta
                tdelta=((i/(2**j))%2==0) ? factors[j][1] : factors[j][2]
              end
            end
            folder=""
            if defined?(GetKeyItemScene) # if BW data exists
              folder="Front/"  
              folder="Back/" if back
              folder="FrontShiny/" if tshiny
              folder="BackShiny/" if back && tshiny    
              folder+="Female/" if tgender
            end
            bitmapFileName=sprintf("Graphics/Battlers/%s%s%s%s%s%s%s%s",
               folder,
               getConstantName(PBSpecies,species),
               tgender ? "f" : "",
               tshiny ? "s" : "",
               tdelta ? "d" : "",
               back ? "b" : "",
               (tform!="" ? "_"+tform : ""),
               tshadow ? "_shadow" : "") rescue nil
            ret=pbResolveBitmap(bitmapFileName)
            return ret if ret
            bitmapFileName=sprintf("Graphics/Battlers/%s%03d%s%s%s%s%s%s",
               folder, species,
               tgender ? "f" : "",
               tshiny ? "s" : "",
               tdelta ? "d" : "",
               back ? "b" : "",
               (tform!="" ? "_"+tform : ""),
               tshadow ? "_shadow" : "")
            ret=pbResolveBitmap(bitmapFileName)
            return ret if ret
          end
          return nil
        end
        
        def pbPokemonIconFile(pokemon)
          bitmapFileName=nil
          bitmapFileName=pbCheckPokemonIconFiles([pokemon.species,
                                                  (pokemon.isFemale?),
                                                  pokemon.isShiny?,
                                                  (pokemon.form rescue 0),
                                                  (pokemon.isShadow? rescue false),
                                                  pokemon.isDelta?],
                                                  pokemon.isEgg?)
          return bitmapFileName
        end
        
        def pbCheckPokemonIconFiles(params,egg=false)
          species=params[0]
          if egg
            bitmapFileName=sprintf("Graphics/Icons/icon%segg",getConstantName(PBSpecies,species)) rescue nil
            if !pbResolveBitmap(bitmapFileName)
              bitmapFileName=sprintf("Graphics/Icons/icon%03degg",species) 
              if !pbResolveBitmap(bitmapFileName)
                bitmapFileName=sprintf("Graphics/Icons/iconEgg")
              end
            end
            return pbResolveBitmap(bitmapFileName)
          else
            factors=[]
            factors.push([4,params[4],false]) if params[4] && params[4]!=false     # shadow
            factors.push([1,params[1],false]) if params[1] && params[1]!=false     # gender
            factors.push([2,params[2],false]) if params[2] && params[2]!=false     # shiny
            factors.push([5,params[5],false]) if params[5] && params[5]!=false     # delta
            factors.push([3,params[3].to_s,""]) if params[3] && params[3].to_s!="" &&
                                                                params[3].to_s!="0" # form
            tshadow=false
            tgender=false
            tshiny=false
            tdelta=false
            tform=""
            for i in 0...2**factors.length
              for j in 0...factors.length
                case factors[j][0]
                when 1   # gender
                  tgender=((i/(2**j))%2==0) ? factors[j][1] : factors[j][2]
                when 2   # shiny
                  tshiny=((i/(2**j))%2==0) ? factors[j][1] : factors[j][2]
                when 3   # form
                  tform=((i/(2**j))%2==0) ? factors[j][1] : factors[j][2]
                when 4   # shadow
                  tshadow=((i/(2**j))%2==0) ? factors[j][1] : factors[j][2]
                when 5   # delta
                  tdelta=((i/(2**j))%2==0) ? factors[j][1] : factors[j][2]
                end
              end
              bitmapFileName=sprintf("Graphics/Icons/icon%s%s%s%s%s%s",
                 getConstantName(PBSpecies,species),
                 tgender ? "f" : "",
                 tshiny ? "s" : "",
                 tdelta ? "d" : "",
                 (tform!="" ? "_"+tform : ""),
                 tshadow ? "_shadow" : "") rescue nil
              ret=pbResolveBitmap(bitmapFileName)
              return ret if ret
              bitmapFileName=sprintf("Graphics/Icons/icon%03d%s%s%s%s%s",
                 species,
                 tgender ? "f" : "",
                 tshiny ? "s" : "",
                 tdelta ? "d" : "",
                 (tform!="" ? "_"+tform : ""),
                 tshadow ? "_shadow" : "")
              ret=pbResolveBitmap(bitmapFileName)
              return ret if ret
            end
          end
          return nil
        end
        
        #########################################################################
        # Following Pokemon compatibility
        #########################################################################
        class DependentEvents
          def change_sprite(id, shiny=nil, animation=nil, form=nil, gender=nil, shadow=false, delta=nil)
            events=$PokemonGlobal.dependentEvents
            for i in 0...events.length
              if events[i] && events[i][8]=="Dependent"
                file=FOLLOWER_FILE_DIR+pbCheckPokemonFollowerFiles([id,gender,shiny,delta,form,shadow])
                events[i][6]=file
                @realEvents[i].character_name=file
                if animation
                  $scene.spriteset.addUserAnimation(Animation_Come_Out,@realEvents[i].x,@realEvents[i].y)
                end
                $game_variables[Walking_Time_Variable]=0
              end
            end
          end
          
          def refresh_sprite(animation=true)
            if $game_variables[Current_Following_Variable]!=0
              return unless $game_switches[Toggle_Following_Switch]
              return if $PokemonGlobal.bicycle
              if $Trainer.party[0].isShiny?
                shiny=true
              else
                shiny=false
              end
              if defined?($Trainer.party[0].isDelta?)
                delta = $Trainer.party[0].isDelta?
              else
                delta = false
              end
              if $Trainer.party[0].form>0
                form=$Trainer.party[0].form
              else
                form=nil
              end
              if defined?($Trainer.party[0].isShadow?)
                shadow = $Trainer.party[0].isShadow?
              else
                shadow = false
              end
              if $PokemonGlobal.surfing
                if $Trainer.party[0].hp>0 && !$Trainer.party[0].isEgg? && $Trainer.party[0].hasType?(:WATER) 
                  events=$PokemonGlobal.dependentEvents
                  if animation
                    for i in 0...events.length
                      $scene.spriteset.addUserAnimation(Animation_Come_Out,@realEvents[i].x,@realEvents[i].y)
                      pbWait(10)
                    end
                  end
                  change_sprite($Trainer.party[0].species, shiny, false, form, $Trainer.party[0].gender, shadow, delta)
                elsif ALWAYS_ANIMATED_CAN_SURF && ($Trainer.party[0].hasType?(:FLYING) || 
                  isConst?($Trainer.party[0].ability,PBAbilities,:LEVITATE) ||
                  ALWAYS_ANIMATED_FOLLOWERS.include?($Trainer.party[0].species)) &&
                  !(ALWAYS_ANIMATED_EXCEPTION.include?($Trainer.party[0].species)) &&
                  $Trainer.party[0].hp>0 && !$Trainer.party[0].isEgg? 
                  events=$PokemonGlobal.dependentEvents
                  if animation
                    for i in 0...events.length
                      $scene.spriteset.addUserAnimation(Animation_Come_Out,@realEvents[i].x,@realEvents[i].y)
                      pbWait(10)
                    end
                  end
                  change_sprite($Trainer.party[0].species, shiny, false, form, $Trainer.party[0].gender, shadow, delta)
                else
                  remove_sprite(false)
                end  
              elsif $PokemonGlobal.diving
                if $Trainer.party[0].hp>0 && !$Trainer.party[0].isEgg? && $Trainer.party[0].hasType?(:WATER) && WATERPOKEMONCANDIVE
                  events=$PokemonGlobal.dependentEvents
                  if animation
                    for i in 0...events.length
                      $scene.spriteset.addUserAnimation(Animation_Come_Out,@realEvents[i].x,@realEvents[i].y)
                      pbWait(10)
                    end
                  end
                  change_sprite($Trainer.party[0].species, shiny, false, form, $Trainer.party[0].gender, shadow, delta)
                else
                  remove_sprite(false)
                end  
              else
                if $Trainer.party[0].hp>0 && !$Trainer.party[0].isEgg? && $scene.is_a?(Scene_Map)
                  events=$PokemonGlobal.dependentEvents
                  if animation
                    for i in 0...events.length
                      $scene.spriteset.addUserAnimation(Animation_Come_Out,@realEvents[i].x,@realEvents[i].y)
                      pbWait(10)
                    end
                  end
                  change_sprite($Trainer.party[0].species, shiny, false, form, $Trainer.party[0].gender, shadow, delta)
                elsif $Trainer.party[0].hp<=0 || $Trainer.party[0].isEgg?
                  remove_sprite(animation)
                end
              end
            else
              check_faint
            end
          end
          
          def Come_back(shiny=nil, animation=nil, delta=nil)
            return if !$game_variables[Following_Activated_Switch]
            return if $Trainer.party.length==0
            $PokemonTemp.dependentEvents.pbMoveDependentEvents
            events=$PokemonGlobal.dependentEvents
            if $game_variables[Current_Following_Variable]==$Trainer.party[0]
              remove_sprite(false)
              if $scene.is_a?(Scene_Map)
                for i in 0...events.length 
                  $scene.spriteset.addUserAnimation(Animation_Come_Out,@realEvents[i].x,@realEvents[i].y)
                end
              end
            end
            if $Trainer.party[0].hp>0 && !$Trainer.party[0].isEgg?
              $game_variables[Current_Following_Variable]=$Trainer.party[0]
              refresh_sprite(animation)
            end
            for i in 0...events.length 
              if events[i] && events[i][8]=="Dependent"
                file=FOLLOWER_FILE_DIR+pbCheckPokemonFollowerFiles([id,gender,shiny,delta,form,shadow])
                events[i][6]=file
                @realEvents[i].character_name=file
                if animation
                  $scene.spriteset.addUserAnimation(Animation_Come_Out,@realEvents[i].x,@realEvents[i].y)
                end
              end 
            end 
          end
        end
        
        # this is an entirely new function, not found in the official release of Following Pokemon
        # it searches for Follower sprites the same way base Essentials searches for battlers and icons
        # rather than a series of "if-than" events
        def pbCheckPokemonFollowerFiles(params)
          species=params[0]
          factors=[]
          factors.push([1,params[1],false]) if params[1] && params[1]!=false     # gender
          factors.push([2,params[2],false]) if params[2] && params[2]!=false     # shiny
          factors.push([3,params[3],false]) if params[3] && params[3]!=false     # delta
          factors.push([4,params[4].to_s,""]) if params[4] && params[4].to_s!="" # form
          factors.push([5,params[5],false]) if params[5] && params[5]!=false     # shadow
          tshadow=false
          tgender=false
          tshiny=false
          tdelta=false
          tform=""
          for i in 0...2**factors.length
            for j in 0...factors.length
              case factors[j][0]
              when 1   # gender
                tgender=((i/(2**j))%2==0) ? factors[j][1] : factors[j][2]
              when 2   # shiny
                tshiny=((i/(2**j))%2==0) ? factors[j][1] : factors[j][2]
              when 3   # delta
                tdelta=((i/(2**j))%2==0) ? factors[j][1] : factors[j][2]
              when 4   # form
                tform=((i/(2**j))%2==0) ? factors[j][1] : factors[j][2]
              when 5   # shadow
                tshadow=((i/(2**j))%2==0) ? factors[j][1] : factors[j][2]
              end
            end
            bitmapFileName=sprintf("%s%s%s%s%s%s",
               getConstantName(PBSpecies,species),
               tgender ? "f" : "",
               tshiny ? "s" : "",
               tdelta ? "d" : "",
               (tform!="" ? "_"+tform : ""),
               tshadow ? "_shadow" : "") rescue nil
            ret=pbResolveBitmap(sprintf("%s%s%s",FOLLOWER_FILE_PATH,FOLLOWER_FILE_DIR,bitmapFileName))
            return bitmapFileName if ret
            bitmapFileName=sprintf("%03d%s%s%s%s%s",
               species,
               tgender ? "f" : "",
               tshiny ? "s" : "",
               tdelta ? "d" : "",
               (tform!="" ? "_"+tform : ""),
               tshadow ? "_shadow" : "")
            ret=pbResolveBitmap(sprintf("%s%s%s",FOLLOWER_FILE_PATH,FOLLOWER_FILE_DIR,bitmapFileName))
            return bitmapFileName if ret
          end
        end
        
        ##############################################################
        # Hybrid AnimatedBitmapWrapper class to encompass both the
        #     EBS version's inputs and the BW version's ones
        ##############################################################
        class AnimatedBitmapWrapper
          attr_reader :width
          attr_reader :height
          attr_reader :totalFrames
          attr_reader :animationFrames
          attr_reader :currentIndex
          attr_accessor :scale
          
          def initialize(file,twoframe_scale=2)
            raise "filename is nil" if file==nil
            if scale.is_a?(Numeric) # EBS version
              @scale = twoframe_scale
              @twoframe = false
            elsif !!scale == scale # BW version
              @scale = 2
              @twoframe = twoframe_scale
            end
            @width = 0
            @height = 0
            @frame = 0
            @frames = 2
            @direction = +1
            @animationFinish = false
            @totalFrames = 0
            @currentIndex = 0
            @speed = 1
              # 0 - not moving at all
              # 1 - normal speed
              # 2 - medium speed
              # 3 - slow speed
            bmp = BitmapCache.load_bitmap(file)
            #bmp = Bitmap.new(file)
            @bitmapFile=Bitmap.new(bmp.width,bmp.height); @bitmapFile.blt(0,0,bmp,Rect.new(0,0,bmp.width,bmp.height))
            # initializes full Pokemon bitmap
            @bitmap=Bitmap.new(@bitmapFile.width,@bitmapFile.height)
            @bitmap.blt(0,0,@bitmapFile,Rect.new(0,0,@bitmapFile.width,@bitmapFile.height))
            @[email protected]*@scale
            @[email protected]*@scale
            
            @[email protected]/@bitmap.height
            @[email protected]*@frames
            # calculates total number of frames
            @loop_points=[0,@totalFrames]
            # first value is start, second is end
            
            @actualBitmap=Bitmap.new(@width,@height)
            @actualBitmap.clear
            @actualBitmap.stretch_blt(Rect.new(0,0,@width,@height),@bitmap,Rect.new(@currentIndex*(@width/@scale),0,@width/@scale,@height/@scale))
          end
          alias initialize_elite initialize
            
          def length; @totalFrames; end
          def disposed?; @actualBitmap.disposed?; end
          def dispose; @actualBitmap.dispose; end
          def copy; @actualBitmap.clone; end
          def bitmap; @actualBitmap; end
          def bitmap=(val); @actualBitmap=val; end
          def each; end
          def alterBitmap(index); return @strip[index]; end
            
          def prepareStrip
            @strip=[]
            for i in [email protected]
              bitmap=Bitmap.new(@width,@height)
              bitmap.stretch_blt(Rect.new(0,0,@width,@height),@bitmapFile,Rect.new((@width/@scale)*i,0,@width/@scale,@height/@scale))
              @strip.push(bitmap)
            end
          end
          def compileStrip
            @bitmap.clear
            for i in [email protected]
              @bitmap.stretch_blt(Rect.new((@width/@scale)*i,0,@width/@scale,@height/@scale),@strip[i],Rect.new(0,0,@width,@height))
            end
          end
          
          def reverse
            if @direction  >  0
              @direction=-1
            elsif @direction < 0
              @direction=+1
            end
          end
          
          def setLoop(start, finish)
            @loop_points=[start,finish]
          end
          
          def setSpeed(value)
            @speed=value
          end
          
          def toFrame(frame)
            if frame.is_a?(String)
              if frame=="last"
                [email protected]
              else
                frame=0
              end
            end
            [email protected] if frame > @totalFrames
            frame=0 if frame < 0
            @currentIndex=frame
            @actualBitmap.clear
            @actualBitmap.stretch_blt(Rect.new(0,0,@width,@height),@bitmap,Rect.new(@currentIndex*(@width/@scale),0,@width/@scale,@height/@scale))
          end
          
          def play
            return if @currentIndex >= @loop_points[1]-1
            self.update
          end
          
          def finished?
            return (@[email protected])
          end
          
          def update
            return false if @actualBitmap.disposed?
            return false if @speed < 1
            case @speed
            # frame skip
            when 1
              @frames=2
            when 2
              @frames=4
            when 3
              @frames=5
            end
            @frame+=1
            
            if @frame >[email protected]
              # processes animation speed
              @[email protected]
              @[email protected]_points[0] if @currentIndex >[email protected]_points[1]
              @[email protected]_points[1]-1 if @currentIndex < @loop_points[0]
              @frame=0
            end
            @actualBitmap.clear
            @actualBitmap.stretch_blt(Rect.new(0,0,@width,@height),@bitmap,Rect.new(@currentIndex*(@width/@scale),0,@width/@scale,@height/@scale))
            # updates the actual bitmap
          end
          alias update_elite update
            
          # returns bitmap to original state
          def deanimate
            @frame=0
            @currentIndex=0
            @actualBitmap.clear
            @actualBitmap.stretch_blt(Rect.new(0,0,@width,@height),@bitmap,Rect.new(@currentIndex*(@width/@scale),0,@width/@scale,@height/@scale))
          end
        end
        
        ##############################################################
        # Alolan Form differences
        ##############################################################
        
        MultipleForms.register(:RAICHU,{
        "getFormName"=>proc{|pokemon|
           next _INTL("Alola Form") if pokemon.isDelta?
           next
        },
        "type2"=>proc{|pokemon|
           next getID(PBTypes,:PSYCHIC) if pokemon.isDelta?
           next
        },
        "height"=>proc{|pokemon|
           next 0.7 if pokemon.isDelta?
           next
        },
        "weight"=>proc{|pokemon|
           next 21.0 if pokemon.isDelta?
           next
        },
        "getAbilityList"=>proc{|pokemon|
           if pokemon.isDelta?
             next [[getID(PBAbilities,:SURGESURFER),0],
        	         [getID(PBAbilities,:SURGESURFER),2]]
           end
           next
        },
        "onSetForm"=>proc{|pokemon,form|
           pbSeenForm(pokemon)
        }
        })
        
        MultipleForms.register(:MEOWTH,{
        "getFormName"=>proc{|pokemon|
           next _INTL("Alola Form") if pokemon.isDelta?
           next
        },
        "type1"=>proc{|pokemon|
           next getID(PBTypes,:DARK) if pokemon.isDelta?
           next
        },
        "type2"=>proc{|pokemon|
           next getID(PBTypes,:DARK) if pokemon.isDelta?
           next
        },
        "onSetForm"=>proc{|pokemon,form|
           pbSeenForm(pokemon)
        }
        })
        
        MultipleForms.register(:MAROWAK,{
        "getFormName"=>proc{|pokemon|
           next _INTL("Alola Form") if pokemon.isDelta?
           next
        },
        "type1"=>proc{|pokemon|
           next getID(PBTypes,:FIRE) if pokemon.isDelta?
           next
        },
        "type2"=>proc{|pokemon|
           next getID(PBTypes,:GHOST) if pokemon.isDelta?
           next
        },
        "weight"=>proc{|pokemon|
           next 34.0 if pokemon.isDelta?
           next
        },
        "getAbilityList"=>proc{|pokemon|
           if pokemon.isDelta?
             next [[getID(PBAbilities,:CURSEDBODY),0],
        	         [getID(PBAbilities,:LIGHTNINGROD),1]]
           end
           next
        },
        "onSetForm"=>proc{|pokemon,form|
           pbSeenForm(pokemon)
        }
        })
        
        MultipleForms.register(:VULPIX,{
        "getFormName"=>proc{|pokemon|
           next _INTL("Alola Form") if pokemon.isDelta?
           next
        },
        "type1"=>proc{|pokemon|
           next getID(PBTypes,:ICE) if pokemon.isDelta?
           next
        },
        "type2"=>proc{|pokemon|
           next getID(PBTypes,:ICE) if pokemon.isDelta?
           next
        },
        "getMoveList"=>proc{|pokemon|
           next if !pokemon.isDelta?
           movelist=[]
           if pokemon.isDelta?
             movelist=[[1,:POWDERSNOW],[4,:TAILWHIP],[7,:ROAR],[9,:BABYDOLLEYES],
        	           [10,:QUICKATTACK],[12,:CONFUSERAY],[15,:BLIZZARD],
        			   [18,:PAYBACK],[20,:ICEPUNCH],[23,:FEINTATTACK],[26,:HEX],
        			   [28,:ICEBEAM],[31,:EXTRASENSORY],[34,:SAFEGUARD],
        			   [36,:FROSTBREATH],[39,:IMPRISON],[44,:GRUDGE],[47,:CAPTIVATE]]
           end
           for i in movelist
             i[1]=getConst(PBMoves,i[1])
           end
           next movelist
        },
        "getAbilityList"=>proc{|pokemon|
           if pokemon.isDelta?
             next [[getID(PBAbilities,:SNOWCLOAK),0],
        	       [getID(PBAbilities,:SNOWCLOAK),2]]
           end
           next
        },
        "onSetForm"=>proc{|pokemon,form|
           pbSeenForm(pokemon)
        }
        })
        
        MultipleForms.register(:NINETAILS,{
        "getFormName"=>proc{|pokemon|
           next _INTL("Alola Form") if pokemon.isDelta?
           next
        },
        "type1"=>proc{|pokemon|
           next getID(PBTypes,:ICE) if pokemon.isDelta?
           next
        },
        "type2"=>proc{|pokemon|
           next getID(PBTypes,:FAIRY) if pokemon.isDelta?
           next
        },
        "getMoveList"=>proc{|pokemon|
           next if pokemon.form==0
           movelist=[]
           if pokemon.isDelta?
             movelist=[[1,:IMPRISON],[1,:NASTYPLOT],[1,:ICEBEAM],[1,:QUICKATTACK],
        	           [1,:CONFUSERAY],[1,:SAFEGUARD]]
           end
           for i in movelist
             i[1]=getConst(PBMoves,i[1])
           end
           next movelist
        },
        "getAbilityList"=>proc{|pokemon|
           if pokemon.isDelta?
             next [[getID(PBAbilities,:SNOWCLOAK),0],
        	       [getID(PBAbilities,:SNOWCLOAK),2]]
           end
           next
        },
        "onSetForm"=>proc{|pokemon,form|
           pbSeenForm(pokemon)
        }
        })
        
        MultipleForms.register(:SANDSHREW,{
        "getFormName"=>proc{|pokemon|
           next _INTL("Alola Form") if pokemon.isDelta?
           next
        },
        "type1"=>proc{|pokemon|
           next getID(PBTypes,:ICE) if pokemon.isDelta?
           next
        },
        "type2"=>proc{|pokemon|
           next getID(PBTypes,:STEEL) if pokemon.isDelta?
           next
        },
        "height"=>proc{|pokemon|
           next 0.6 if pokemon.isDelta?
           next
        },
        "weight"=>proc{|pokemon|
           next 40.0 if pokemon.isDelta?
           next
        },
        "getMoveList"=>proc{|pokemon|
           next if pokemon.form==0
           movelist=[]
           if pokemon.isDelta?
             movelist=[[1,:SCRATCH],[1,:DEFENSECURL],[3,:HAIL],[5,:ICEPUNCH],
        	           [7,:ROLLOUT],[9,:RAPIDSPIN],[11,:CUT],[14,:SHEERCOLD],
        			   [17,:SWIFT],[20,:FURYSWIPES],[23,:HAIL],[26,:SLASH],
        			   [30,:DIG],[34,:GYROBALL],[38,:SWORDSDANCE],[42,:HAIL],]
           end
           for i in movelist
             i[1]=getConst(PBMoves,i[1])
           end
           next movelist
        },
        "getAbilityList"=>proc{|pokemon|
           if pokemon.isDelta?
             next [[getID(PBAbilities,:SNOWCLOAK),0],
        	       [getID(PBAbilities,:SNOWCLOAK),2]]
           end
           next
        },
        "onSetForm"=>proc{|pokemon,form|
           pbSeenForm(pokemon)
        }
        })
        
        MultipleForms.register(:SANDSLASH,{
        "getFormName"=>proc{|pokemon|
           next _INTL("Alola Form") if pokemon.isDelta?
           next
        },
        "type1"=>proc{|pokemon|
           next getID(PBTypes,:ICE) if pokemon.isDelta?
           next
        },
        "type2"=>proc{|pokemon|
           next getID(PBTypes,:STEEL) if pokemon.isDelta?
           next
        },
        "height"=>proc{|pokemon|
           next 1.2 if pokemon.isDelta?
           next
        },
        "weight"=>proc{|pokemon|
           next 55.0 if pokemon.isDelta?
           next
        },
        "getMoveList"=>proc{|pokemon|
           next if pokemon.form==0
           movelist=[]
           if pokemon.isDelta?
             movelist=[[1,:SCRATCH],[1,:DEFENSECURL],[3,:HAIL],[5,:ICEPUNCH],
        	           [7,:ROLLOUT],[9,:RAPIDSPIN],[11,:CUT],[14,:SHEERCOLD],
        			   [17,:SWIFT],[20,:FURYSWIPES],[23,:HAIL],[26,:SLASH],
        			   [30,:DIG],[34,:GYROBALL],[38,:SWORDSDANCE],[42,:HAIL],]
           end
           for i in movelist
             i[1]=getConst(PBMoves,i[1])
           end
           next movelist
        },
        "getAbilityList"=>proc{|pokemon|
           if pokemon.isDelta?
             next [[getID(PBAbilities,:SNOWCLOAK),0],
        	       [getID(PBAbilities,:SNOWCLOAK),2]]
           end
           next
        },
        "onSetForm"=>proc{|pokemon,form|
           pbSeenForm(pokemon)
        }
        })
        
        MultipleForms.register(:EXEGGUTOR,{
        "getFormName"=>proc{|pokemon|
           next _INTL("Alola Form") if pokemon.isDelta?
           next
        },
        "type2"=>proc{|pokemon|
           next getID(PBTypes,:DRAGON) if pokemon.isDelta?
           next
        },
        "height"=>proc{|pokemon|
           next 10.9 if pokemon.isDelta?
           next
        },
        "weight"=>proc{|pokemon|
           next 415.6 if pokemon.isDelta?
           next
        },
        "getAbilityList"=>proc{|pokemon|
           if pokemon.isDelta?
             next [[getID(PBAbilities,:FRISK),0],
        	       [getID(PBAbilities,:FRISK),2]]
           end
           next
        },
        "getMoveList"=>proc{|pokemon|
           next if pokemon.form==0
           movelist=[]
           if pokemon.isDelta?
             movelist=[[1,:SEEDBOMB],[1,:BARRAGE],[1,:HYPNOSIS],[1,:CONFUSION],
        	           [1,:STOMP],[17,:PSYSHOCK],[27,:EGGBOMB],[37,:WOODHAMMER],
        			   [47,:LEAFSTORM]]
           end
           for i in movelist
             i[1]=getConst(PBMoves,i[1])
           end
           next movelist
        },
        "onSetForm"=>proc{|pokemon,form|
           pbSeenForm(pokemon)
        }
        })
        
        ###################################################################
        # EXAMPLE ENCOUNTER MODIFIER
        # "pokemon.deltaflag=true" is how to make the Pokemon a Delta/Alolan
        ###################################################################
        # Events.onWildPokemonCreate+=proc {|sender,e|
        #    pokemon=e[0]
        #    if $game_map.map_id==51 && isConst?(pokemon.species,PBSpecies,:EXEGGUTOR)
        #      pokemon.deltaflag=true
        #    end
        # }
        In order to make a sprite for an Alolan Pokemon, name the sprite "###d.png", where the ### is replaced with the National Pokedex number of the species. For example, Alolan Ninetails's sprite would be named "038d.png". This can be combined with the existing modifiers - "###sd.png" for a Shiny Alolan Pokemon, "###db.png" for the backsprite of an Alolan Pokemon, "##fd.png" for a female Alolan Pokemon, "###d_1.png" for the (numbered) alternate form of an Alolan Pokemon, etc. (In order to do the backsprite for a female Shiny Alolan Pokemon in a numbered alternate form, the proper syntax is "###fsdb_1.png")

        The movesets listed here are temporary movesets crated by changing old STAB to new STAB. They are by no means the final movesets. Otherwise, this is everything we know about Alola Forms.
        This script breaks "Title Screen" if title screen is set to 5
        __________________
        Green Remix is Done !
        Thank you for the many years !
        Reply With Quote
          #29    
        Old August 25th, 2016 (7:59 AM).
        Rot8er_ConeX's Avatar
        Rot8er_ConeX Rot8er_ConeX is offline
           
          Join Date: May 2015
          Location: The Dissa Region
          Gender: Male
          Posts: 822
          Can you please explain farther, Zeak? What's the error you get?
          __________________
          Features of Pokemon Entropy

          The black circular "doodles" in the lower right corner of my avatar are actually my username written in Gallifreyan. Yes I'm a Whovian.
          Reply With Quote
            #30    
          Old August 25th, 2016 (8:39 AM). Edited August 25th, 2016 by Zeak6464.
          Zeak6464's Avatar
          Zeak6464 Zeak6464 is offline
          Zeak #3205 - Discord
             
            Join Date: Mar 2013
            Location: USA
            Age: 25
            Gender: Male
            Nature: Calm
            Posts: 557
            Quote:
            Originally Posted by Rot8er_ConeX View Post
            Can you please explain farther, Zeak? What's the error you get?


            __________________
            Green Remix is Done !
            Thank you for the many years !
            Reply With Quote
              #31    
            Old August 25th, 2016 (9:03 AM). Edited August 25th, 2016 by Rot8er_ConeX.
            Rot8er_ConeX's Avatar
            Rot8er_ConeX Rot8er_ConeX is offline
               
              Join Date: May 2015
              Location: The Dissa Region
              Gender: Male
              Posts: 822
              Okay, it looks like both those errors are being caused by "ghost Pokemon". I do remember having to edit my version of the Gen V title screen to allow for Delta Pokemon.

              Looking at the title screen resource that exists now, I'm wondering if it has to do with the spoofForm function. Otherwise, any possible errors are beyond me.



              EDIT: Okay, I've got a possible fix for the error with the Title Screen. Unfortunately, the problem having to do with the Starter Selection thing seems to be something that can only be fixed on their end - by generating the Pokemon before the sprites and then rendering the Pokemon's appearance, rather than searching for the sprite directly.
              __________________
              Features of Pokemon Entropy

              The black circular "doodles" in the lower right corner of my avatar are actually my username written in Gallifreyan. Yes I'm a Whovian.
              Reply With Quote
                #32    
              Old August 25th, 2016 (11:50 AM).
              Luka S.J.'s Avatar
              Luka S.J. Luka S.J. is offline
              Jealous Croatian
                 
                Join Date: Dec 2008
                Location: Croatia
                Age: 25
                Gender: Male
                Nature: Adamant
                Posts: 1,116
                Quote:
                Originally Posted by Rot8er_ConeX View Post
                I'll have to figure out how to detect if someone is using BW essentials.
                If you're still looking for this, this is what I use to check for Klein's kit
                Code:
                if defined?(DUALSCREENHEIGHT)
                Reply With Quote
                  #33    
                Old August 25th, 2016 (2:21 PM).
                Rot8er_ConeX's Avatar
                Rot8er_ConeX Rot8er_ConeX is offline
                   
                  Join Date: May 2015
                  Location: The Dissa Region
                  Gender: Male
                  Posts: 822
                  Quote:
                  Originally Posted by Luka S.J. View Post
                  If you're still looking for this, this is what I use to check for Klein's kit
                  Code:
                  if defined?(DUALSCREENHEIGHT)
                  I'll fix that in future versions. I was checking for the class he uses to draw the Key Item Get scene.
                  __________________
                  Features of Pokemon Entropy

                  The black circular "doodles" in the lower right corner of my avatar are actually my username written in Gallifreyan. Yes I'm a Whovian.
                  Reply With Quote
                    #34    
                  Old September 1st, 2016 (2:50 PM).
                  Rot8er_ConeX's Avatar
                  Rot8er_ConeX Rot8er_ConeX is offline
                     
                    Join Date: May 2015
                    Location: The Dissa Region
                    Gender: Male
                    Posts: 822
                    Code for Alolan Rattata and (what is presumed to be the details on) Alolan Raticate are added.
                    __________________
                    Features of Pokemon Entropy

                    The black circular "doodles" in the lower right corner of my avatar are actually my username written in Gallifreyan. Yes I'm a Whovian.
                    Reply With Quote
                      #35    
                    Old September 4th, 2016 (12:02 PM).
                    Rejnka's Avatar
                    Rejnka Rejnka is offline
                       
                      Join Date: Sep 2015
                      Gender: Other
                      Posts: 14
                      Just so you know, Delta Species weren't invented by the fans. They were introduced in the TCG. I am SICK and TIRED of this misconception.

                      Otherwise, nice work. Just don't get too ahead of yourself in implementing the official Alolan Forms, we already know that at least Sandslash and Sandshrew have different stats and we don't fully know their movepools.
                      Reply With Quote
                        #36    
                      Old September 4th, 2016 (2:22 PM).
                      Rot8er_ConeX's Avatar
                      Rot8er_ConeX Rot8er_ConeX is offline
                         
                        Join Date: May 2015
                        Location: The Dissa Region
                        Gender: Male
                        Posts: 822
                        Quote:
                        Originally Posted by Rejnka View Post
                        Just so you know, Delta Species weren't invented by the fans. They were introduced in the TCG. I am SICK and TIRED of this misconception.
                        When did I say that Deltas were invented by the fans? I said that we've been calling them Deltas, but now they're officially called Alolan Forms.

                        I'm aware that they originated in the TCG. The lore of the particular pack they were introduced in, is the reason that Insurgence - the game that sort of popularized the concept of Deltas - calls the portion of their website about Deltas the Honlon Dex.

                        Quote:
                        Otherwise, nice work. Just don't get too ahead of yourself in implementing the official Alolan Forms, we already know that at least Sandslash and Sandshrew have different stats and we don't fully know their movepools.
                        I've been updating this every time we learn new information about the Alolan Forms. That said, we don't technically know Snowshrew and Snowslash have different stats from Sandshrew and Sandslash. The website mentions that they move slower than their non-Alolan counterparts, but that could just be flavor text. Until we see the official base stats, we can't say for sure if that'll be reflected in their actual battle prowess.

                        However, if we do learn that the base stats are different, I can add that capability fairly easily, since the MultipleForms code already allows for that.
                        __________________
                        Features of Pokemon Entropy

                        The black circular "doodles" in the lower right corner of my avatar are actually my username written in Gallifreyan. Yes I'm a Whovian.
                        Reply With Quote
                          #37    
                        Old September 8th, 2016 (1:57 PM).
                        Phasma's Avatar
                        Phasma Phasma is offline
                           
                          Join Date: May 2016
                          Gender: Male
                          Posts: 20
                          is there a way to set a different y altitude for the delta sprite?
                          Reply With Quote
                            #38    
                          Old September 8th, 2016 (2:06 PM).
                          Rot8er_ConeX's Avatar
                          Rot8er_ConeX Rot8er_ConeX is offline
                             
                            Join Date: May 2015
                            Location: The Dissa Region
                            Gender: Male
                            Posts: 822
                            Quote:
                            Originally Posted by Phasma View Post
                            is there a way to set a different y altitude for the delta sprite?
                            Same way you set the Y altitude for an alternate form. Just use "pokemon.isDelta?" instead of "pokemon.form==1"
                            __________________
                            Features of Pokemon Entropy

                            The black circular "doodles" in the lower right corner of my avatar are actually my username written in Gallifreyan. Yes I'm a Whovian.
                            Reply With Quote
                              #39    
                            Old September 10th, 2016 (2:09 PM).
                            BlackOutG5's Avatar
                            BlackOutG5 BlackOutG5 is offline
                               
                              Join Date: Jul 2015
                              Gender: Male
                              Nature: Bold
                              Posts: 77
                              The abilities won't change for the delta Pokemon. I don't know again if this is because of BW essentials but, that's my guess with the issue.
                              Reply With Quote
                                #40    
                              Old September 10th, 2016 (8:45 PM).
                              Rot8er_ConeX's Avatar
                              Rot8er_ConeX Rot8er_ConeX is offline
                                 
                                Join Date: May 2015
                                Location: The Dissa Region
                                Gender: Male
                                Posts: 822
                                Quote:
                                Originally Posted by BlackOutG5 View Post
                                The abilities won't change for the delta Pokemon. I don't know again if this is because of BW essentials but, that's my guess with the issue.
                                Probably because the BW kit is based on v15 or lower, and the getAbilityList function of multiple forms was added in version 16.

                                Try adding this somewhere above the Alolan Forms script:

                                Code:
                                class PokeBattle_Pokemon
                                  alias __mf_getAbilityList getAbilityList
                                  def getAbilityList
                                    v=MultipleForms.call("getAbilityList",self)
                                    return v if v!=nil && v.length>0
                                    return self.__mf_getAbilityList
                                  end
                                end
                                __________________
                                Features of Pokemon Entropy

                                The black circular "doodles" in the lower right corner of my avatar are actually my username written in Gallifreyan. Yes I'm a Whovian.
                                Reply With Quote
                                  #41    
                                Old September 11th, 2016 (9:06 AM).
                                onepiece01 onepiece01 is offline
                                   
                                  Join Date: Aug 2015
                                  Posts: 8
                                  ---------------------------
                                  Pokemon Essentials
                                  ---------------------------
                                  Exception: NoMethodError

                                  Message: undefined method `isEgg?' for #<PokeBattle_Battler:0x99ed560>

                                  Alola Pokemon:127:in `pbLoadPokemonBitmapSpecies'

                                  Alola Pokemon:115:in `pbLoadPokemonBitmap'

                                  Sprite:162:in `setPokemonBitmap'

                                  Scene:1456:in `pbSendOut'

                                  Battle:316:in `pbSendOutInitial'

                                  Battle:254:in `pbStartBattleCore'

                                  PokeBattle_Battle:2395:in `pbStartBattle'

                                  PField_Field:905:in `pbWildBattle_old'

                                  PField_Field:904:in `pbSceneStandby'

                                  PField_Field:906:in `pbWildBattle_old'



                                  This exception was logged in

                                  C:\Users\utente\Saved Games/Pokemon Essentials/errorlog.txt.

                                  Press Ctrl+C to copy this message to the clipboard.
                                  ---------------------------
                                  OK
                                  ---------------------------

                                  Hi, I have this problem. How can I resolve it?
                                  Reply With Quote
                                    #42    
                                  Old September 11th, 2016 (10:57 AM). Edited September 11th, 2016 by Rot8er_ConeX.
                                  Rot8er_ConeX's Avatar
                                  Rot8er_ConeX Rot8er_ConeX is offline
                                     
                                    Join Date: May 2015
                                    Location: The Dissa Region
                                    Gender: Male
                                    Posts: 822
                                    Are you using the latest version of Essentials? v16, I think, killed the "isEgg?" function and replaced it with just "egg?" the old function was added back in v16.2 IIRC.

                                    Edit: nevermind, I looked at the error better. It's trying to look at whether a battler is an egg, not a Pokemon. Huh.

                                    Second edit: Added an isEgg? function to the Battlers section of this script, just in case.
                                    __________________
                                    Features of Pokemon Entropy

                                    The black circular "doodles" in the lower right corner of my avatar are actually my username written in Gallifreyan. Yes I'm a Whovian.
                                    Reply With Quote
                                      #43    
                                    Old September 11th, 2016 (4:14 PM).
                                    Zeak6464's Avatar
                                    Zeak6464 Zeak6464 is offline
                                    Zeak #3205 - Discord
                                       
                                      Join Date: Mar 2013
                                      Location: USA
                                      Age: 25
                                      Gender: Male
                                      Nature: Calm
                                      Posts: 557
                                      Quote:
                                      Originally Posted by Rot8er_ConeX View Post
                                      Are you using the latest version of Essentials? v16, I think, killed the "isEgg?" function and replaced it with just "egg?" the old function was added back in v16.2 IIRC.

                                      Edit: nevermind, I looked at the error better. It's trying to look at whether a battler is an egg, not a Pokemon. Huh.

                                      Second edit: Added an isEgg? function to the Battlers section of this script, just in case.
                                      or you could add in
                                      Code:
                                      alias :egg? :isEgg?
                                      after the line
                                      Code:
                                      def isEgg?
                                          return @eggsteps>0
                                        end
                                      in PokeBattle_Pokemon script
                                      __________________
                                      Green Remix is Done !
                                      Thank you for the many years !
                                      Reply With Quote
                                        #44    
                                      Old September 11th, 2016 (5:57 PM).
                                      Rot8er_ConeX's Avatar
                                      Rot8er_ConeX Rot8er_ConeX is offline
                                         
                                        Join Date: May 2015
                                        Location: The Dissa Region
                                        Gender: Male
                                        Posts: 822
                                        If I did it that way, then I'd break every instance of .egg? everywhere else in their code
                                        __________________
                                        Features of Pokemon Entropy

                                        The black circular "doodles" in the lower right corner of my avatar are actually my username written in Gallifreyan. Yes I'm a Whovian.
                                        Reply With Quote
                                          #45    
                                        Old September 11th, 2016 (6:26 PM).
                                        Zeak6464's Avatar
                                        Zeak6464 Zeak6464 is offline
                                        Zeak #3205 - Discord
                                           
                                          Join Date: Mar 2013
                                          Location: USA
                                          Age: 25
                                          Gender: Male
                                          Nature: Calm
                                          Posts: 557
                                          Quote:
                                          Originally Posted by Rot8er_ConeX View Post
                                          If I did it that way, then I'd break every instance of .egg? everywhere else in their code
                                          could just do
                                          Code:
                                          alias :isEgg? :egg?
                                          so that every time it says "egg?" it also means "isEgg?"
                                          __________________
                                          Green Remix is Done !
                                          Thank you for the many years !
                                          Reply With Quote
                                            #46    
                                          Old September 12th, 2016 (12:58 AM).
                                          onepiece01 onepiece01 is offline
                                             
                                            Join Date: Aug 2015
                                            Posts: 8
                                            Thank you both , I have solved my problem!
                                            Reply With Quote
                                              #47    
                                            Old September 17th, 2016 (3:42 PM). Edited September 19th, 2016 by mej71.
                                            BlackOutG5's Avatar
                                            BlackOutG5 BlackOutG5 is offline
                                               
                                              Join Date: Jul 2015
                                              Gender: Male
                                              Nature: Bold
                                              Posts: 77
                                              Still can't get Pokemon's delta ability to change using

                                              Code:
                                              "getAbilityList"=>proc{|pokemon|
                                                if pokemon.isDelta?
                                                  next [[getID(PBAbilities,:SWIFTSWIM),0],
                                                              [getID(PBAbilities,:SWIFTSWIM),2]]
                                                end
                                                next
                                              },
                                              or

                                              Code:
                                              "ability"=>proc{|pokemon|
                                                 next getID(PBAbilities,:SWIFTSWIM) if pokemon.isDelta?
                                                 next
                                              },
                                              Nvm I fixed it the second method above suddenly started working. :?
                                              Reply With Quote
                                                #48    
                                              Old October 4th, 2016 (2:39 AM).
                                              Tea-Rex's Avatar
                                              Tea-Rex Tea-Rex is offline
                                                 
                                                Join Date: Oct 2016
                                                Location: Australia
                                                Gender: Male
                                                Nature: Modest
                                                Posts: 34
                                                Is there a way so that trainers can have and use delta/Alolan forms?
                                                Reply With Quote
                                                  #49    
                                                Old October 11th, 2016 (5:08 PM). Edited October 12th, 2016 by mej71.
                                                RetroSandslash's Avatar
                                                RetroSandslash RetroSandslash is offline
                                                   
                                                  Join Date: Aug 2016
                                                  Gender: Male
                                                  Posts: 15
                                                  Do any one of you know how to make this script work? I couldn't get the alolan encounters to work? I even tried to change the example at the bottom and that did nothing. Is there something I'm suppose to write in a separate script or something, to get it working?

                                                  Quote:
                                                  Originally Posted by RetroSandslash View Post
                                                  Do any one of you know how to make this script work? I couldn't get the alolan encounters to work? I even tried to change the example at the bottom and that did nothing. Is there something I'm suppose to write in a separate script or something, to get it working?
                                                  Nevermind, I figured it out.
                                                  __________________
                                                  Retro GB!
                                                  Reply With Quote
                                                    #50    
                                                  Old November 12th, 2016 (2:30 PM).
                                                  platypus2101's Avatar
                                                  platypus2101 platypus2101 is offline
                                                     
                                                    Join Date: Oct 2016
                                                    Gender: Male
                                                    Posts: 1
                                                    I have been attempting to use this with Following Pokemon, the compatibility works, but the pbPokemonFollow(x) event needs to be run prior to installing your Delta Pokemon script, or at the very least the section for Follow Pokemon compatibility.
                                                    Attempting to do so after results in the following error;
                                                    Spoiler:
                                                    ---------------------------
                                                    Pokemon Essentials
                                                    ---------------------------
                                                    Exception: RuntimeError

                                                    Message: Script error within event 17, map 3 (Red's house):

                                                    Exception: NameError

                                                    Message: Section179:452:in `Come_back'undefined local variable or method `gender' for #<DependentEvents:0xb6b1b38>

                                                    ***Full script:

                                                    pbPokemonFollow(18)


                                                    Interpreter:243:in `pbExecuteScript'

                                                    DELTAPOKEMON:450:in `each'

                                                    DELTAPOKEMON:450:in `Come_back'

                                                    FOLLOWPOKEMON:1222:in `pbPokemonFollow'

                                                    (eval):1:in `pbExecuteScript'

                                                    Interpreter:1606:in `eval'

                                                    Interpreter:243:in `pbExecuteScript'

                                                    Interpreter:1606:in `command_355'

                                                    Interpreter:494:in `execute_command'

                                                    Interpreter:193:in `update'



                                                    Interpreter:276:in `pbExecuteScript'

                                                    Interpreter:1606:in `command_355'

                                                    Interpreter:494:in `execute_command'

                                                    Interpreter:193:in `update'

                                                    Interpreter:106:in `loop'

                                                    Interpreter:198:in `update'

                                                    Scene_Map:103:in `follow_update'

                                                    Scene_Map:101:in `loop'

                                                    Scene_Map:114:in `follow_update'

                                                    FOLLOWPOKEMON:1544:in `update'



                                                    This exception was logged in

                                                    C:\Users\name\Saved Games/Pokemon Essentials/errorlog.txt.

                                                    Press Ctrl+C to copy this message to the clipboard.
                                                    ---------------------------
                                                    OK
                                                    ---------------------------
                                                    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
                                                    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 10:25 PM.