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 August 25th, 2013 (4:23 PM).
woobowiz woobowiz is offline
     
    Join Date: Jun 2013
    Gender: Male
    Posts: 3
    I'm very new to this forum, and I'm not aware if this has been asked.

    I recently wanted to script in some during battle effects as well as moves, I'm currently working on Moxie, as it's a least concern priority to get working for most people.

    I would assume I would have to put the script code somewhere between lines 2522 and 2532 in the PokeBattle_ActualScene script?

    Code:
    # This method is called whenever a Pokémon faints.
      def pbFainted(pkmn)
        frames=pbCryFrameLength(pkmn.pokemon)
        pbPlayCry(pkmn.pokemon)
        frames.times do
          pbGraphicsUpdate
          pbInputUpdate
        end
        @sprites["shadow#{pkmn.index}"].visible=false
        [email protected]["pokemon#{pkmn.index}"]
        pkmnsprite.visible=false
        if @battle.pbIsOpposing?(pkmn.index)
          ycoord=(@sprites["battler0"].visible && @battle.doublebattle) ? 118 : 130
          tempvp=Viewport.new(0,0,Graphics.width,[email protected])
        else
          tempvp=Viewport.new(0,0,Graphics.width,[email protected])
        end
        [email protected]
        tempsprite=SpriteWrapper.new(tempvp)
        tempsprite.x=pkmnsprite.x
        tempsprite.y=pkmnsprite.y
        tempsprite.bitmap=pkmnsprite.bitmap
        tempsprite.visible=true
        pbSEPlay("faint")
        20.times do
          tempsprite.y+=8
          pbGraphicsUpdate
          pbInputUpdate
        end
        # I assume I have to insert the code here?
        tempsprite.dispose
        tempvp.dispose
        8.times do
          @sprites["battler#{pkmn.index}"].opacity-=32
          pbGraphicsUpdate
          pbInputUpdate
        end
        @sprites["battler#{pkmn.index}"].visible=false
        pkmn.pbResetForm
      end
    Reply With Quote

    Relevant Advertising!

      #2    
    Old August 26th, 2013 (4:59 PM).
    dexter1o6 dexter1o6 is offline
       
      Join Date: Jul 2013
      Age: 29
      Gender: Male
      Posts: 64
      Looks about right to me. But I must say I'm not very experienced with including moves and abilities. Is there any other ability that is triggered when the opponent faints? And if so, has it been implemented yet? And if so, where was that ability implemented?

      Otherwise I would say, make a backup, fiddle with the code, test it, and if it works, post it among resources/scripts or something, and if it doesn't, post it here with some questions. You can always switch back to the backup.
      Reply With Quote
        #3    
      Old August 27th, 2013 (5:11 AM).
      Maruno's Avatar
      Maruno Maruno is offline
      Lead Dev of Pokémon Essentials
         
        Join Date: Jan 2008
        Location: England
        Posts: 5,185
        PokeBattle_ActualScene is for the visual stuff. It's not where effects go.

        Moxie sounds like it occurs at the same time that Destiny Bond occurs. That's a good place to start. Search for DestinyBond.
        __________________
        Go to the Pokémon Essentials Wiki

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

        Follow me on Twitter: @maruno42


        Reply With Quote
          #4    
        Old August 27th, 2013 (2:13 PM).
        dexter1o6 dexter1o6 is offline
           
          Join Date: Jul 2013
          Age: 29
          Gender: Male
          Posts: 64
          When you say destiny bond, I think of Aftermath. Since this is an ability just like moxie, it should be at the same place. Also, if I remember correctly, Aftermath works already works. So you can search for Aftermath as well.
          Reply With Quote
            #5    
          Old August 28th, 2013 (5:14 PM).
          woobowiz woobowiz is offline
             
            Join Date: Jun 2013
            Gender: Male
            Posts: 3
            So I mixed a bit of code from Aftermath and Speed Boost

            and squeezed it after Mummy (I would assume Mummy would activate first because of this so Moxie gets negated?)

            Code:
            if isConst?(target.ability,PBAbilities,:MUMMY) && user.hp>0
                    if !isConst?(user.ability(true),PBAbilities,:MULTITYPE) &&
                       !isConst?(user.ability(true),PBAbilities,:WONDERGUARD) &&
                       !isConst?(user.ability(true),PBAbilities,:MUMMY)
                      user.ability=getConst(PBAbilities,:MUMMY) || 0
                      pbDisplay(_INTL("{1} was mummified by {2}!",user.pbThis,target.pbThis(true)))
                    end
                  end
                  if isConst?(user.ability,PBAbilities,:MOXIE) && user.hp>0 && target.hp<=0
                    if !user.pbTooHigh?(PBStats::ATTACK)
                      user.pbIncreaseStatBasic(PBStats::ATTACK,1)
                      pbCommonAnimation("StatUp",i,nil)
                      pbDisplay(_INTL("{1}'s Moxie raised its Attack!",user.pbThis))
                    end 
                  end
            Reply With Quote
              #6    
            Old August 28th, 2013 (8:35 PM).
            dexter1o6 dexter1o6 is offline
               
              Join Date: Jul 2013
              Age: 29
              Gender: Male
              Posts: 64
              You may want to test that assumption in an actual game.
              Reply With Quote
                #7    
              Old August 29th, 2013 (6:17 PM).
              woobowiz woobowiz is offline
                 
                Join Date: Jun 2013
                Gender: Male
                Posts: 3
                Well I know for certain Moxie works, but I haven't a clue how to simulate the Mummy test case.
                Reply With Quote
                  #8    
                Old August 29th, 2013 (7:44 PM).
                dexter1o6 dexter1o6 is offline
                   
                  Join Date: Jul 2013
                  Age: 29
                  Gender: Male
                  Posts: 64
                  Have a pokemon with moxie defeat a pokemon with mummy in one (physical) blow. That should do for testing.
                  Reply With Quote
                    #9    
                  Old September 3rd, 2013 (4:45 PM).
                  Joltik's Avatar
                  Joltik Joltik is offline
                     
                    Join Date: Jan 2010
                    Gender: Male
                    Nature: Modest
                    Posts: 116
                    Hi there. Did you guys get moxie working fine?
                    I tried to make it work using woobowiz idea, but I still get no effects, it seems like I'm missing something. What should be done in order to add it properly?
                    Thank you all.
                    Reply With Quote
                      #10    
                    Old September 5th, 2013 (11:41 AM).
                    AmethystRain's Avatar
                    AmethystRain AmethystRain is offline
                    pixie-powered judgment!
                       
                      Join Date: Apr 2012
                      Gender: Female
                      Posts: 245
                      Yeah, Woobowiz did actually!
                      Here, I'll put up the script she gave me for future users
                      Quote:
                      So Moxie's code is applied directly after Mummy's code in the PokeBattle_Battle script. The code for Moxie should start at line 1966.
                      Code:
                      if isConst?(user.ability,PBAbilities,:MOXIE) && user.hp>0 && target.hp<=0
                      
                              if !user.pbTooHigh?(PBStats::ATTACK)
                      
                                user.pbIncreaseStatBasic(PBStats::ATTACK,1)
                      
                                pbCommonAnimation("StatUp",user,nil)
                      
                                pbDisplay(_INTL("{1}'s Moxie raised its Attack!",user.pbThis))
                      
                              end
                      
                      end
                      __________________
                      i'm a lover before a fighter, but a killer before a kisser
                      also i made reborn or something
                      Reply With Quote
                        #11    
                      Old September 5th, 2013 (12:49 PM).
                      Joltik's Avatar
                      Joltik Joltik is offline
                         
                        Join Date: Jan 2010
                        Gender: Male
                        Nature: Modest
                        Posts: 116
                        Quote:
                        Originally Posted by AmethystRain View Post
                        Yeah, Woobowiz did actually!
                        Here, I'll put up the script she gave me for future users
                        Thank you so much! Now I've noticed that the original script had only a little difference from this one that prevented it from working. Now it is working perfectly fine.
                        Thank you and Woobowiz. :D
                        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 10:21 PM.