• Just a reminder that providing specifics on, sharing links to, or naming websites where ROMs can be accessed is against the rules. If your post has any of this information it will be removed.
  • Ever thought it'd be cool to have your art, writing, or challenge runs featured on PokéCommunity? Click here for info - we'd love to spotlight your work!
  • Which Pokémon Masters protagonist do you like most? Let us know by casting a vote in our Masters favorite protagonist poll here!
  • Red, Hilda, Paxton, or Kellyn - which Pokémon protagonist is your favorite? Let us know by voting in our poll!
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

Creating Delta Species

  • 155
    Posts
    11
    Years
    • Seen Jun 11, 2021
    I modified the Shiny Pokemon code to try to create Delta Species Pokemon from the TCG. However, when testing it out, it doesn't appear to be working.
    Code:
      def isDelta?
        return @deltaflag if @deltaflag!=nil
        a=@personalID^@trainerID
        b=a&0xFFFF
        c=(a>>16)&0xFFFF
        d=b^c
        return (d<DELTAPOKEMONCHANCE)
      end
    
    # Makes this Pokemon delta species.
      def makeDelta
        case rand(17)
        when 0
          @deltatype=0
        when 1
          @deltatype=1
        when 2
          @deltatype=2
        when 3
          @deltatype=3
        when 4
          @deltatype=4
        when 5
          @deltatype=5
        when 6
          @deltatype=6
        when 7
          @deltatype=7
        when 8
          @deltatype=8
        when 9
          @deltatype=10
        when 10
          @deltatype=11
        when 11
          @deltatype=12
        when 12
          @deltatype=13
        when 13
          @deltatype=14
        when 14
          @deltatype=15
        when 15
          @deltatype=16
        when 16
          @deltatype=17
        when 17
          @deltatype=18
        end
        @deltaflag=true
      end
    
    # Makes this Pokemon not shiny.
      def makeNotDelta
        @deltaflag=false
      end
    This is the code I have in PokeBattle_Pokemon.
    And in PokeBattle_Battler, I replaced each instance of this line:
    Code:
    @type1=pkmn.type1
    With this.
    Code:
    if !pokemon.isDelta?
          @type1=pkmn.type1
        else
          @type1=@deltatype
        end
    Unfortunately, whenever I try it out and head into the tall grass, this error pops up:
    Code:
    Exception: NoMethodError
    
    Message: undefined method `isDelta?' for nil:NilClass
    
    PokeBattle_Battler:215:in `__shadow_pbInitPokemon'
    
    Pokemon_ShadowPokemon:525:in `pbInitPokemon'
    
    PokeBattle_Battler:517:in `pbInitialize'
    
    PokeBattle_Battle:2532:in `pbStartBattleCore'
    
    PokeBattle_Battle:2505:in `pbStartBattle'
    
    InverseSkyBattles:49:in `pbWildBattle'
    
    InverseSkyBattles:48:in `pbSceneStandby'
    
    InverseSkyBattles:50:in `pbWildBattle'
    
    InverseSkyBattles:47:in `pbBattleAnimation'
    
    InverseSkyBattles:47:in `pbWildBattle'
    I know I did something wrong. I'm just not sure what. Can anyone help me out?
     
    Things to consider when making Delta Pokemon that are the same species rather than just a new Pokedex entry:

    1.) You need to initialize the deltaflag variable in Pokebattle_Pokemon. Near the top there's a bunch of lines that read "attr_accessor(:something)" Add one that reads "attr_reader(:deltaflag); attr_reader(:deltatype)" and you're good to go.

    2.) Only changing SHINYPOKEMONCHANCE to DELTAPOKEMONCHANCE when copy-and-pasting def isShiny? isn't enough. Either Shinies will cut into Deltas or vice versa. Might I suggest changing that line to return (65535-d<DELTAPOKEMONCHANCE)?

    3.) When changing the type that a Delta Pokemon will be, you don't want to change the Battler's type, but the Pokemon's. Get rid of your changes to PokeBattle_Battler, and instead, go into PokeBattle_Pokemon, and find def type1. In clean v16, it's found on line 367. Replace it with this:
    Code:
    # Returns this Pokémon's first type.
      def type1
        if self.isDelta?
          ret=(@personalID/4)%17
          ret+=1 if ret>8
          ret=@deltatype if @deltatype != nil
          return ret
        end
        dexdata=pbOpenDexData
        pbDexDataOffset(dexdata,@species,8)
        ret=dexdata.fgetb
        dexdata.close
        return ret
      end
    note that your def makeDelta function would only have altered the types of un-natural deltas. As in, Deltas that your game always makes Delta for whatever reason. Hence, I made it so that other Deltas' types are based on the Pokemon's personality value.

    4.) Changing def type1 doesn't affect def type2. Might I suggest this?
    Code:
    # Returns this Pokémon's second type.
      def type2
        if self.isDelta?
          ret=((@personalID/4)/17)%17
          ret+=1 if ret>8
          ret=@deltatype if @deltatype != nil
          return ret
        end
        dexdata=pbOpenDexData
        pbDexDataOffset(dexdata,@species,9)
        ret=dexdata.fgetb
        dexdata.close
        return ret
      end
    Now if @deltatype exists, then it'll be a single-typed Delta. If not, then it'll have a chance at being dual-typed.

    5.) Are Deltas changing abilities? Level-up Moves? TM compatibilities? Move Tutors?

    6.) Note that Arceus and Castform change primary types when they change form, and all of these Pokemon change secondary type when form-changing:
    Castform
    Wormadam
    Rotom
    Shaymin
    Arceus
    Darmanitan
    Meloetta
    Hoopa
    Charizard
    Pinsir
    Gyarados
    Mewtwo
    Ampharos
    Aggron
    Sceptile
    Altaria
    Lopunny
    Audino
    Groudon
    As of right now, these default type changes will overwrite the changes done by the Pokemon being Delta. You want to figure out if you want these Pokemon to gain a different Delta typing or (my suggestion) keep their default Delta typing when they form change.

    7.) now that we have Delta Pokemon working, it's time to bring them into battle!
    in PokeBattle_Battler, you want to find this around line 173:
    Code:
      def isShiny?
        if @effects[PBEffects::Illusion]
          return @effects[PBEffects::Illusion].isShiny?
        end
        return @pokemon.isShiny? if @pokemon
        return false
      end
    You want to make a clone of this function for def isDelta?

    8.) Likewise, you want to make a clone of this function found on line 18 pf PokeBattle_SafariZone:
    Code:
      def isShiny?; return @pokemon.isShiny?; end

    9.) You probably want to make a indicator in battle if a Pokemon is Delta. Essentials already does one for shininess.

    10.) You also likely want to make Delta Pokemon have different sprites.
     
    That worked! I tested the changes you made and it all worked with relatively no problems at all! I even evolved the Pokemon and their typing remained, just as I wanted!

    Also, I'd like TM/Move Tutor compatibility to change with the new typings of the Delta Pokemon, but I'm not 100% sure how to go about it. As for abilities, I'm not sure if I want them to remain or change, tbh. And I do have an indicator planned for it. I intend to show a the type symbol(s) from the TCG in the box just like the symbol for Primal Reversion/Shiny Pokemon.

    Also, when encountered in the wild and not owned by trainers, I thought about having the game display a message that says "Oh! It's a delta species!" just before the player sends out their Pokemon.

    EDIT: Got the display message to work since I posted that. Now I'm working on the icons for the delta types, but two issues.

    1. I'm not sure where to put them where they're not in the way of the Primal Reversion/Shiny displays.
    2. For whatever reason, the sprite isn't showing up on the screen.
    Code:
    if @battler.isDelta?
          imagepos.push(["Graphics/Pictures/delta.png",@spritebaseX+140,4,0,0,-1,-1])
        end
    in PokeBattle_Scene. This is just the testing version of the script. In the finished version, I intend the "delta.png" part to display the symbol for the type the Pokemon is.
    [PokeCommunity.com] Creating Delta Species

    These are just examples.
     
    Last edited:
    1.) You never explained if you want form changes to alter the Delta types (i.e., if an Electric/Fighting-type Delta Gyarados should Mega Evolve and become, maybe, Electric/Grass, or if it should always stay Electric/Fighting. Even if you're not going to have Mega Evolution, you still need to worry about:
    Castform
    Wormadam
    Rotom
    Shaymin
    Arceus
    Darmanitan
    Meloetta
    Hoopa)

    2.) Adding in an indicator. Found on line 655 of PokeBattle_Scene:
    Code:
        if @battler.isShiny?
          shinyX=206
          shinyX=-6 if (@battler.index&1)==0 # If player's Pokémon
    [COLOR="Blue"]      shinyX-=18 if @battler.isDelta?[/COLOR]
          imagepos.push(["Graphics/Pictures/shiny.png",@spritebaseX+shinyX,36,0,0,-1,-1])
        end
    Add the blue line. Under that, put this:
    Code:
        if @battler.isDelta?
          deltaX=206
          deltaX=-6 if (@battler.index&1)==0 # If player's Pokémon
          deltaX+=18 if @battler.isShiny?
          imagepos.push(["Graphics/Pictures/delta.png",@spritebaseX+deltaX,36,0,0,-1,-1])
        end

    Note that as of right now, it'll display one image for all Deltas, regardless of type. I will get to that later. Working on making my own image for you to use, and I'll also need to write a script to translate game types into TCG types.
     
    Oh right! Sorry about that. I think the Mega Evolution types should remain the same as they were before Mega Evolving. As for Arceus, I think I might need to have him be an exception: As in the only one to not have a Delta type.
    [PokeCommunity.com] Creating Delta Species

    Finished the indicators I was going to use. But if you want to use your own sprites, that's fine too. (Note: ??? type won't actually be a delta. I just included it as an error handler.)
     
    Okay, then in order for the types to properly work:
    1.) Go into PokeBattle_Pokemon's def isDelta?
    At the very top of the function, add the line return false if isConst?(self.species,PBSpecies,:ARCEUS). Now Arceus cannot be Delta.

    2.) Now go into PokeBattle_MultipleForms, and find def type1
    add the line return self.__mf_type1 if self.isDelta?

    3.) Likewise, add return self.__mf_type2 if self.isDelta? to the start of def type2. Now all form changes for Delta Pokemon will be the same type as their standard form.

    4.) I just made a graphic that has all the normal types from the TCG, and thought it would be interesting if we only used the TCG types for the symbols (meaning Grass and Bug types would have the same icon, for example). Is this a bad idea? It adds to the mystery of what type a Delta is - since you normally don't know what type a Pokemon is when you first see it.
     
    You can go ahead and do that if you want, but I personally would rather have the other types shown. I guess it's a personal preference.
    As for Castform, I'm thinking maybe type 2 should be its regular typings (excluding the default form) while type 1 is the regular delta typing. Same deal with Darminitan's Zen Mode. Shaymin, Meloetta, and Hoopa, however, I'm thinking should have the same thing as Mega Evolutions.
     
    1.) then in type2 in step 3 of my previous post, change that line to read
    Code:
    return self.__mf_type2 if self.isDelta? && ![getConst(PBSpecies,:CASTFORM),getConst(PBSpecies,:DARMANITAN)].include?(self.species)

    2.) Fair enough. I'll find a picture with all the proper types, then will get back to you.
     
    Alright. Thanks again. Though now that I think about it, I'm thinking about how I'm going to modify the TM/Move Tutor set for the Pokemon. I think it would make sense to base it on delta typing rather than modifying each individual species, but how would I go about doing that?
     
    Attached is a file with an icon for each type, in their programmed order.

    to make the game display properly. PokeBattle_Scene:
    Code:
        if @battler.isDelta?
          deltaX=206
          deltaX=-6 if (@battler.index&1)==0 # If player's Pokémon
          deltaX+=18 if @battler.isShiny?
          if @[email protected]
            imagepos.push(["Graphics/Pictures/delta.png",@spritebaseX+deltaX+8,36+8,20*@battler.type1,0,20,-1])
          else
            imagepos.push(["Graphics/Pictures/delta.png",@spritebaseX+deltaX,36,20*@battler.type1,0,20,-1])
            imagepos.push(["Graphics/Pictures/delta.png",@spritebaseX+deltaX+16,36+16,20*@battler.type2,0,20,-1])
          end
        end



    As for the TM/Move Tutor compatibility, the way I have it working in my game is by removing any TMs and Move Tutors that share a type with the original type for the species (aside from the "everyone learns them" TMs), then gift them with every TM/Move Tutor that share a type with their new type. I'll have to see if I can adapt this to v16, since mine is coded in v15.
     

    Attachments

    • [PokeCommunity.com] Creating Delta Species
      Delta.png
      18.2 KB · Views: 4
    A few issues. When I set the Delta Species switch on, for whatever reason, it's still not being displayed. Strangely enough, however, it works when I set both the delta and shiny switch on, but... The delta symbol...
    [PokeCommunity.com] Creating Delta Species

    It kinda gets cut off. Is this because of v16?
     
    Hmmm....interesting. When the Shiny switch is off, it should be displaying exactly where that shiny star is now.

    Try this:
    Code:
        if @battler.isDelta?
          deltaX=206
          deltaX=-6 if (@battler.index&1)==0 # If player's Pokémon
          deltaX+=18 if @battler.isShiny?
          if @[email protected]
            imagepos.push(["Graphics/Pictures/delta.png",@spritebaseX+deltaX,10+8,20*@battler.type1,0,20,-1])
          else
            imagepos.push(["Graphics/Pictures/delta.png",@spritebaseX+deltaX-8,10,20*@battler.type1,0,20,-1])
            imagepos.push(["Graphics/Pictures/delta.png",@spritebaseX+deltaX+8,10+16,20*@battler.type2,0,20,-1])
          end
        end
     
    Okay, to make TMs work the way I have them in my game, except for alterations to v16, go to Pokemon_MultipleForms. Around line 94, you should find def isCompatibleWithMove?(move). You want to replace that function with all of this:

    Code:
      def isCompatibleWithMove?(move)
        data=load_data("Data/tm.dat")
        return false if !data[move]
        species=self.species
    	return false if isConst?(species,PBSpecies,:WURMPLE)
        return false if isConst?(species,PBSpecies,:SILCOON)
        return false if isConst?(species,PBSpecies,:CASCOON)
        return false if isConst?(species,PBSpecies,:BELDUM)
        return false if isConst?(species,PBSpecies,:COMBEE)
        return false if isConst?(species,PBSpecies,:MAGIKARP)
        return false if isConst?(species,PBSpecies,:KAKUNA)
        return false if isConst?(species,PBSpecies,:WEEDLE)
        return false if isConst?(species,PBSpecies,:METAPOD)
        return false if isConst?(species,PBSpecies,:CATERPIE)
        return false if isConst?(species,PBSpecies,:DITTO)
        return false if isConst?(species,PBSpecies,:SMEARGLE)
        return false if isConst?(species,PBSpecies,:UNOWN)
        return false if isConst?(species,PBSpecies,:WOBBUFFET) && !isConst?(move,PBMoves,:SAFEGUARD)
        return false if isConst?(species,PBSpecies,:WYNAUT) && !isConst?(move,PBMoves,:SAFEGUARD)
        return false if isConst?(species,PBSpecies,:KRICKETOT)
        if isConst?(species,PBSpecies,:BURMY) &&
             !isConst?(move,PBMoves,:PROTECT) &&
             !isConst?(move,PBMoves,:HIDDENPOWER)
          return false
        end
        if isConst?(species,PBSpecies,:TYNAMO) &&
             !isConst?(move,PBMoves,:CHARGEBEAM) &&
             !isConst?(move,PBMoves,:THUNDERWAVE)
          return false
        end
        if isConst?(species,PBSpecies,:MEW)
          if isConst?(move,PBMoves,:FRENZYPLANT) ||
             isConst?(move,PBMoves,:BLASTBURN) ||
             isConst?(move,PBMoves,:HYDROCANNON) ||
             isConst?(move,PBMoves,:DRACOMETEOR) ||
             isConst?(move,PBMoves,:GRASSPLEDGE) ||
             isConst?(move,PBMoves,:FIREPLEDGE) ||
             isConst?(move,PBMoves,:WATERPLEDGE) ||
             isConst?(move,PBMoves,:SECRETSWORD) ||
             isConst?(move,PBMoves,:RELICSONG) ||
             isConst?(move,PBMoves,:DRAGONASCENT)
            return false
          else
            return true
          end
        end
    	return true if isConst?(move,PBMoves,:TOXIC)
        return true if isConst?(move,PBMoves,:HIDDENPOWER)
        return true if isConst?(move,PBMoves,:PROTECT) && !isConst?(species,PBSpecies,:REGIGIGAS)
        return true if isConst?(move,PBMoves,:FRUSTRATION)
        return true if isConst?(move,PBMoves,:RETURN)
        return true if isConst?(move,PBMoves,:FACADE)
        return true if isConst?(move,PBMoves,:REST) && !isConst?(species,PBSpecies,:REGIGIGAS)
        return true if isConst?(move,PBMoves,:ATTRACT)
        return true if isConst?(move,PBMoves,:ROUND)
        return true if isConst?(move,PBMoves,:SWAGGER)
        return true if isConst?(move,PBMoves,:SLEEPTALK)
        return true if isConst?(move,PBMoves,:SUBSTITUTE)
        return true if isConst?(move,PBMoves,:CONFIDE)
    	if self.isDelta?
    	  p=self.clone
          p.deltaflag=false
          nret=[p.type1,p.type2]
          dret=[self.type1,self.type2]
          movedata=pbRgssOpen("Data/moves.dat")
          movedata.pos=move*14
          function    = movedata.fgetw
          basedamage  = movedata.fgetb
          movetype    = movedata.fgetb
          movedata.close
          return true if dret.include?(movetype)
          return false if nret.include?(movetype)
        end
        v=MultipleForms.call("getMoveCompatibility",self)
        if v!=nil
          return v.any? {|j| j==move }
        end
        return self.__mf_isCompatibleWithMove?(move)
      end
    .

    The "I don't learn any TMs" Pokemon still won't learn any TMs. The "I am learned by everyone" TMs will still be learned by everyone. Mew retains his "I learn every TM and Move Tutor except those that are exclusive to one Pokemon" attribute. Other than those three things, Delta Pokemon will learn every TM/Move Tutor that shares a type with them, and learn none of the ones that share a type with the non-Delta version of them.
     
    Just tested it out again. With the shiny switch on, it works better, but I think I'm getting a bit closer to pinpointing the issue. Without the shiny switch, it didn't display again, but when I turned the shiny switch on and the delta switch off, it displayed two delta icons despite not being delta.

    EDIT: I discovered what the problem was. It was my fault. When I copied the "isShiny?" code, I forgot to change one line to "isDelta?". It's fixed now.
     
    Last edited:
    Currently, it looks like this:
    Code:
    def isDelta?
        if @effects[PBEffects::Illusion]
          return @effects[PBEffects::Illusion].isDelta?
        end
        return @pokemon.isDelta? if @pokemon
        return false
      end
    But before I fixed it, it looked like this:
    Code:
    def isDelta?
        if @effects[PBEffects::Illusion]
          return @effects[PBEffects::Illusion].isDelta?
        end
        return [COLOR=Red]@pokemon.isShiny?[/COLOR] if @pokemon
        return false
      end
     
    Last edited:
    [PokeCommunity.com] Creating Delta Species

    I moved the symbol to where it's supposed to be. However, I don't know how the dual typing looks. I haven't been lucky enough to get a dual type delta yet.
     
    [PokeCommunity.com] Creating Delta Species

    I moved the symbol to where it's supposed to be. However, I don't know how the dual typing looks. I haven't been lucky enough to get a dual type delta yet.

    Probably because you're using the makeDelta function. Try altering DELTAPOKEMONCHANCE to be really high, then run into a naturally-created Delta Pokemon to see how it looks. It should be both icons diagonally touching.

    As for the placement, looks good.
     
    Back
    Top