The PokéCommunity Forums Fan Games Game Development Pokémon Essentials
Essentials Question Move that has a chance to attract a target of the opposite gender?

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


Reply
 
Thread Tools
  #1    
Old 1 Week Ago (9:06 AM). Edited 1 Week Ago by Marin.
BlowDryMan BlowDryMan is offline
     
    Join Date: Jul 2018
    Posts: 13
    I tried to make it with this code but it doesn't work.
    Code:
    ################################################################################
    # Attracts the target.
    ################################################################################
    class PokeBattle_Move_016 < PokeBattle_Move
      def pbEffect(attacker,opponent,hitnum=0,alltargets=nil,showanimation=true)
        if !opponent.pbCanAttract?(attacker)
          return -1
        end
        pbShowAnimation(@id,attacker,opponent,hitnum,alltargets,showanimation)
        opponent.effects[PBEffects::Attract]=attacker.index
        @battle.pbCommonAnimation("Attract",opponent,nil)
        @battle.pbDisplay(_INTL("{1} fell in love!",opponent.pbThis))
        if opponent.hasWorkingItem(:DESTINYKNOT) &&
           !attacker.hasWorkingAbility(:OBLIVIOUS) &&
           attacker.effects[PBEffects::Attract]<0
          attacker.effects[PBEffects::Attract]=user.index
          @battle.pbCommonAnimation("Attract",attacker,nil)
          pbDisplay(_INTL("{1}'s {2} infatuated {3}!",opponent.pbThis,
             PBItems.getName(opponent.item),attacker.pbThis(true)))
        end
        return 0
      end
    end
    Reply With Quote

    Relevant Advertising!

      #2    
    Old 1 Week Ago (5:56 PM).
    Sir_Tman's Avatar
    Sir_Tman Sir_Tman is offline
    Head Developer of Pokemon Elemento
       
      Join Date: Aug 2015
      Location: Evergreen City - Elemento Region
      Gender: Male
      Nature: Relaxed
      Posts: 186
      Define "doesn't work." does it give you an error, does nothing happen when you use it in battle?
      We need a little more than doesn't work.
      __________________
      Reply With Quote
        #3    
      Old 6 Days Ago (3:46 PM). Edited 6 Days Ago by BlowDryMan.
      BlowDryMan BlowDryMan is offline
         
        Join Date: Jul 2018
        Posts: 13
        I get this error in battle:
        Quote:

        Exception: TypeError

        Message: nil can't be coerced into Fixnum

        PokeBattle_Battler:2785:in `+'

        PokeBattle_Battler:2785:in `pbProcessMoveAgainstTarget'

        PokeBattle_Battler:2747:in `each'

        PokeBattle_Battler:2747:in `pbProcessMoveAgainstTarget'

        PokeBattle_Battler:3162:in `pbUseMove'

        PokeBattle_Battler:3136:in `loop'

        PokeBattle_Battler:3165:in `pbUseMove'

        PokeBattle_Battler:3299:in `pbProcessTurn'

        PokeBattle_Battler:3298:in `logonerr'

        PokeBattle_Battler:3298:in `pbProcessTurn'

        Reply With Quote
          #4    
        Old 6 Days Ago (6:19 PM).
        James Davy James Davy is offline
           
          Join Date: Oct 2014
          Gender: Male
          Posts: 122
          The error may be in how the move was defined in the PBS file.
          Reply With Quote
            #5    
          Old 3 Days Ago (2:57 PM).
          BlowDryMan BlowDryMan is offline
             
            Join Date: Jul 2018
            Posts: 13
            This is how I have it defined in the PBS file:
            1715,LOVEBURST,Love Burst,282,90,PSYCHIC,Special,95,20,50,00,0,bce,"Chance to infatuate the target."
            Reply With Quote
              #6    
            Old 3 Days Ago (7:10 PM).
            James Davy James Davy is offline
               
              Join Date: Oct 2014
              Gender: Male
              Posts: 122
              The bug would likely lie in how move function 0x282 was programmed. What have you programmed for it?
              Reply With Quote
                #7    
              Old 2 Days Ago (6:23 AM).
              BlowDryMan BlowDryMan is offline
                 
                Join Date: Jul 2018
                Posts: 13
                Quote:
                ################################################################################
                # Attracts the target.
                ################################################################################
                class PokeBattle_Move_282 < PokeBattle_Move
                def pbEffect(attacker,opponent,hitnum=0,alltargets=nil,showanimation=true)
                if !opponent.pbCanAttract?(attacker)
                return -1
                end
                def pbAdditionalEffect(attacker,opponent)
                return false if opponent.effects[PBEffects::Attract]
                return false if opponent.hasWorkingAbility(:OBLIVIOUS) && !attacker.hasBypassingAbility
                opponent.effects[PBEffects::Attract]=attacker.index
                @battle.pbDisplay(_INTL("{1} fell in love!",opponent.pbThis))
                if opponent.hasWorkingItem(:DESTINYKNOT) &&
                !attacker.hasWorkingAbility(:OBLIVIOUS) &&
                attacker.effects[PBEffects::Attract]<0
                attacker.effects[PBEffects::Attract]=user.index
                @battle.pbCommonAnimation("Attract",attacker,nil)
                pbDisplay(_INTL("{1}'s {2} infatuated {3}!",opponent.pbThis,
                PBItems.getName(opponent.item),attacker.pbThis(true)))
                end
                return true
                end
                end
                end
                Reply With Quote
                  #8    
                Old 2 Days Ago (5:56 PM).
                James Davy James Davy is offline
                   
                  Join Date: Oct 2014
                  Gender: Male
                  Posts: 122
                  One of the end statements is misplaced. Here's the fix:
                  Code:
                  class PokeBattle_Move_282 < PokeBattle_Move
                      def pbEffect(attacker,opponent,hitnum=0,alltargets=nil,showanimation=true)
                          if !opponent.pbCanAttract?(attacker)
                              return -1
                          end
                      end
                      def pbAdditionalEffect(attacker,opponent)
                          return false if opponent.effects[PBEffects::Attract]
                          return false if opponent.hasWorkingAbility(:OBLIVIOUS) && !attacker.hasBypassingAbility
                          opponent.effects[PBEffects::Attract]=attacker.index
                          @battle.pbDisplay(_INTL("{1} fell in love!",opponent.pbThis))
                          if opponent.hasWorkingItem(:DESTINYKNOT) &&
                             !attacker.hasWorkingAbility(:OBLIVIOUS) &&
                             attacker.effects[PBEffects::Attract]<0
                              attacker.effects[PBEffects::Attract]=user.index
                              @battle.pbCommonAnimation("Attract",attacker,nil)
                              pbDisplay(_INTL("{1}'s {2} infatuated {3}!",opponent.pbThis,
                                  PBItems.getName(opponent.item),attacker.pbThis(true)))
                          end
                          return true
                          end
                      end
                  end
                  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 4:42 AM.