Pokémon Essentials All questions and discussion about Pokémon Essentials, the Pokémon game kit for RPG Maker XP, go in here. Also contains links to the latest downloads and the Essentials Wiki.

TrollandToad.com
Reply
 
Thread Tools
  #1    
Old September 27th, 2012 (4:52 PM).
JynxedOne's Avatar
JynxedOne JynxedOne is offline
     
    Join Date: Sep 2012
    Location: Upstate New York
    Gender: Male
    Nature: Hasty
    Posts: 141
    I'd like make a new ability that does just what the Zen Mode ability does, once a certain Hp is reached the Pokemon's sprite and stats change. Is it even possible to make new ones? I've been looking through the scripts and so far found the following about Zen Mode. Where are the scripts telling the game which stats to change when the ability starts? If anyone can help I would be very grateful. Just trying to learn as much about this as I can.

    # Zen Mode
    if isConst?(self.species,PBSpecies,:DARMANITAN) && hp>0
    if isConst?(self.ability,PBAbilities,:ZENMODE)
    if @hp<=((@totalhp/2).floor)
    if self.form!=1
    self.form=1; transformed=true
    end
    else
    if self.form!=0
    self.form=0; transformed=true
    end
    end
    else
    if self.form!=0
    self.form=0; transformed=true
    end
    end
    end
    Reply With Quote

    Relevant Advertising!

      #2    
    Old September 27th, 2012 (5:54 PM).
    Yamiidenryuu's Avatar
    Yamiidenryuu Yamiidenryuu is offline
       
      Join Date: Oct 2011
      Posts: 185
      That looks like you'd just change "DARMANITAN" to the Pokemon with this ability, and change "ZENMODE" to the form it takes. This page details multiple forms, which you'd use to set up the form the ability uses.
      __________________

      Cheren Comic is a comic about Cheren! Go read it.
      Reply With Quote
        #3    
      Old September 27th, 2012 (7:28 PM). Edited September 27th, 2012 by JynxedOne.
      JynxedOne's Avatar
      JynxedOne JynxedOne is offline
         
        Join Date: Sep 2012
        Location: Upstate New York
        Gender: Male
        Nature: Hasty
        Posts: 141
        Thank you. Something happened during the battle. I gave the new form new stats graphic and moves but the moves didn't change. And even though I changed the stats the damage from my it's attacks don't seem to do any more damage. After the transformation I checked it's stats and they all changed to what I set them to though. Any help for me there?
        Reply With Quote
          #4    
        Old September 28th, 2012 (1:36 AM).
        Maruno's Avatar
        Maruno Maruno is offline
        Lead Dev of Pokémon Essentials
           
          Join Date: Jan 2008
          Location: England
          Posts: 5,185
          The only Pokémon which changes its current moveset upon changing its form is Rotom, and that only happens in a safe and controlled environment. My advice is that you don't try to change your Pokémon's moves during battle, because there's all kinds of complications to it.

          To make sure your Pokémon's form is only changed during battle, and reverts back to normal afterwards, find the method immediately below the one you found and quoted, and add in a similar bit of code for your Pokémon.

          The damage inflicted by moves naturally varies by about 15% each way anyway. Unless you made a drastic change to the Atk/Sp Atk, you probably won't notice a difference. If you only changed one of those two stats, make sure you're testing it by using a move that will use that stat (i.e. Atk is Physical, Sp Atk is Special).
          __________________
          Go to the Pokémon Essentials Wiki

          | Downloads | Tutorials | Fangames |
          | All Animations Project |

          Follow me on Twitter: @maruno42


          Reply With Quote
            #5    
          Old September 28th, 2012 (5:06 AM).
          JynxedOne's Avatar
          JynxedOne JynxedOne is offline
             
            Join Date: Sep 2012
            Location: Upstate New York
            Gender: Male
            Nature: Hasty
            Posts: 141
            Thank you for letting me know abut that. Trying to change it's moves was starting to get to me. I made it so the pokemon stays in the new form even outside battle when it's Hp is low. As for the stat changes, to see if I was doing it right I made it so the normal forms attack was 60 and the new form was over 200. When the pokemon changes in battle there doesn't seem to be a difference in damage but if it enters the battle already transformed then it's attacks are taking out everything in one hit. Is there something I may have changed that I shouldn't have to make this happen?
            Reply With Quote
              #6    
            Old September 28th, 2012 (5:47 AM).
            Awkward Squirtle Awkward Squirtle is offline
            ,@,e .ºoO
               
              Join Date: Jul 2011
              Gender: Male
              Posts: 110
              IIRC the PokeBattle_Battler class stores stats separately from the PokeBattle_Pokemon class. I suspect the Zen Mode code (and by extension, your custom code) isn't updating the PokeBattle_Battler stats to match the PokeBattle_Pokemon stats. Maruno, could you confirm/deny?
              Reply With Quote
                #7    
              Old September 28th, 2012 (5:48 AM).
              Maruno's Avatar
              Maruno Maruno is offline
              Lead Dev of Pokémon Essentials
                 
                Join Date: Jan 2008
                Location: England
                Posts: 5,185
                I presume you made a "getForm" procedure for your Pokémon in order to make sure its form changes outside of battle properly (which could happen due to poisoning).

                The stats not changing in battle is an oversight on my part. In PokeBattle_Battler, find def pbUpdate and add this:

                Code:
                  def pbUpdate(fullchange=false)
                    if @pokemon
                      @pokemon.calcStats
                      if fullchange
                        @[email protected]
                        @[email protected]
                Bear in mind that there's a very good reason why, of all the base stats, the HP stat never changes between forms - it would affect the current HP as well, and that's too fiddly to deal with. Make sure any of your Pokémon with multiple forms never change their HP stat.
                __________________
                Go to the Pokémon Essentials Wiki

                | Downloads | Tutorials | Fangames |
                | All Animations Project |

                Follow me on Twitter: @maruno42


                Reply With Quote
                  #8    
                Old September 28th, 2012 (6:14 AM).
                JynxedOne's Avatar
                JynxedOne JynxedOne is offline
                   
                  Join Date: Sep 2012
                  Location: Upstate New York
                  Gender: Male
                  Nature: Hasty
                  Posts: 141
                  It's working much better now. Thank you guys for all the help. Truly appreciate it all.
                  Reply With Quote
                    #9    
                  Old September 28th, 2012 (6:31 AM).
                  Yamiidenryuu's Avatar
                  Yamiidenryuu Yamiidenryuu is offline
                     
                    Join Date: Oct 2011
                    Posts: 185
                    I'm a bit late, but instead of having the moveset change in-battle along with the form, what about giving it a signature move with an effect that depends on the form? Would that be possible?
                    __________________

                    Cheren Comic is a comic about Cheren! Go read it.
                    Reply With Quote
                      #10    
                    Old September 28th, 2012 (6:38 AM). Edited September 28th, 2012 by JynxedOne.
                    JynxedOne's Avatar
                    JynxedOne JynxedOne is offline
                       
                      Join Date: Sep 2012
                      Location: Upstate New York
                      Gender: Male
                      Nature: Hasty
                      Posts: 141
                      Like a move that once in the new form, would add burn or freeze? Or change type from say fire to Dark? That would be cool. Looking at Judgment I could maybe make a move that changes type when the new form is used but I have no idea how I could add effects once it transforms.
                      Reply With Quote
                        #11    
                      Old September 28th, 2012 (7:06 AM).
                      Maruno's Avatar
                      Maruno Maruno is offline
                      Lead Dev of Pokémon Essentials
                         
                        Join Date: Jan 2008
                        Location: England
                        Posts: 5,185
                        That's certainly possible. Part of the move's effect as defined in PokeBattle_MoveEffects (under its own function code) should be to check the user's form, and do something depending on it. You can change pretty much anything about a move this way (except its name/PP).

                        Compare with Curse, which does different things depending on the user's type.
                        __________________
                        Go to the Pokémon Essentials Wiki

                        | Downloads | Tutorials | Fangames |
                        | All Animations Project |

                        Follow me on Twitter: @maruno42


                        Reply With Quote
                          #12    
                        Old September 28th, 2012 (9:17 AM).
                        JynxedOne's Avatar
                        JynxedOne JynxedOne is offline
                           
                          Join Date: Sep 2012
                          Location: Upstate New York
                          Gender: Male
                          Nature: Hasty
                          Posts: 141
                          I took a look at PokeBattle_MoveEffects. Scripting was never my strong suit, but I tried piecing together code for an attack to hit twice, and when the user is part Ghost it would double damage hit twice and paralyze. Could one of you check over the code? I know there's stuff wrong with it but I would never be able to find out what myself.

                          ################################################################################
                          # Hits twice. If Ghost Type hits twice paralyze and double damage.
                          ################################################################################
                          class PokeBattle_Move_133 < PokeBattle_Move
                          def pbIsMultiHit
                          return true
                          end

                          def pbNumHits
                          return 2
                          end
                          end
                          def pbBaseDamage(damage,attacker,opponent)
                          if !attacker.pbHasType?(:GHOST)
                          damage*=2
                          end
                          return damage
                          end
                          return -1 if !opponent.pbCanParalyze?(true)
                          @battle.pbAnimation(@id,attacker,opponent)
                          opponent.pbParalyze(attacker)
                          @battle.pbDisplay(_INTL("{1} is paralyzed! It may be unable to move!",opponent.pbThis))
                          return 0
                          end
                          end
                          Reply With Quote
                            #13    
                          Old September 28th, 2012 (11:17 AM).
                          Maruno's Avatar
                          Maruno Maruno is offline
                          Lead Dev of Pokémon Essentials
                             
                            Join Date: Jan 2008
                            Location: England
                            Posts: 5,185
                            That's a bit of a jumble. Study the following and see if you can spot where you went wrong:

                            Code:
                            ################################################################################
                            # Hits twice. If user is Ghost-type, also doubles damage and paralyzes target.
                            ################################################################################
                            class PokeBattle_Move_133 < PokeBattle_Move
                              def pbIsMultiHit
                                return true
                              end
                            
                              def pbNumHits
                                return 2
                              end
                            
                              def pbBaseDamage(damage,attacker,opponent)
                                damage*=2 if attacker.pbHasType?(:GHOST)
                                return damage
                              end
                            
                              def pbAdditionalEffect(attacker,opponent)
                                return false if !attacker.pbHasType?(:GHOST)
                                return false if !opponent.pbCanParalyze?(false)
                                opponent.pbParalyze(attacker)
                                @battle.pbDisplay(_INTL("{1} was paralyzed!  It may be unable to move!",opponent.pbThis))
                                return true
                              end
                            end
                            The move as defined in moves.txt should have an additional effect chance of whatever percentage chance you want the paralysis to be (apparently 100 for "always"). The move will always hit twice in a row (regardless) and do double damage (if the user is a Ghost type).
                            __________________
                            Go to the Pokémon Essentials Wiki

                            | Downloads | Tutorials | Fangames |
                            | All Animations Project |

                            Follow me on Twitter: @maruno42


                            Reply With Quote
                              #14    
                            Old September 28th, 2012 (11:41 AM).
                            JynxedOne's Avatar
                            JynxedOne JynxedOne is offline
                               
                              Join Date: Sep 2012
                              Location: Upstate New York
                              Gender: Male
                              Nature: Hasty
                              Posts: 141
                              The first part I think I see how it's supposed to be, adding effects still seems complicated but Looking at this I think I'll be able to make others like this. Thanks so much for fixing the code for me. If I wanted to have this without the paralyze would I just get rid of everything after "def pbAdditionalEffect" and put a second end?
                              Reply With Quote
                                #15    
                              Old September 28th, 2012 (12:49 PM).
                              Maruno's Avatar
                              Maruno Maruno is offline
                              Lead Dev of Pokémon Essentials
                                 
                                Join Date: Jan 2008
                                Location: England
                                Posts: 5,185
                                To remove the paralysing effect, just remove the lines between (and including) def pbAdditionalEffect(attacker,opponent) and the penultimate end. No need to add anything.

                                Hint: A method always begins with a line saying def something, and ends with a line saying end. To delete a method, delete those two lines and everything in between. Line indents are very helpful when deciding which end belongs with each def (the two should have the same amount of indent).
                                __________________
                                Go to the Pokémon Essentials Wiki

                                | Downloads | Tutorials | Fangames |
                                | All Animations Project |

                                Follow me on Twitter: @maruno42


                                Reply With Quote
                                Reply

                                Quick Reply

                                Join the conversation!

                                Create an account to post a reply in this thread, participate in other discussions, and more!

                                Create a PokéCommunity Account

                                Sponsored Links
                                Thread Tools

                                Posting Rules
                                You may not post new threads
                                You may not post replies
                                You may not post attachments
                                You may not edit your posts

                                BB code is On
                                Smilies are On
                                [IMG] code is On
                                HTML code is Off

                                Forum Jump


                                All times are GMT -8. The time now is 5:44 PM.