• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • 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.

Help Needed For Battle Messages

Nickalooose

--------------------
  • 1,309
    Posts
    16
    Years
    • Seen Dec 28, 2023
    This is going to sound stupid but, I would like to know if it is possible to create messages during battles, I know you can in original RMXP, but you got to use it VIA monsters page in database, but, Essentials doesn't have this, so is there any way to make this possible?

    For example:

    An opponent Pokémon going down to 50% HP, 25% HP or 10% HP.
    An opponent down to their last Pokémon, "One left, this is where it get's interesting".
    An opponent Pokémon asleep, "Wake up [insert Pokémon name here], wake up!"

    And so forth... X
     
    This is going to sound stupid but, I would like to know if it is possible to create messages during battles, I know you can in original RMXP, but you got to use it VIA monsters page in database, but, Essentials doesn't have this, so is there any way to make this possible?

    For example:

    An opponent Pokémon going down to 50% HP, 25% HP or 10% HP.
    An opponent down to their last Pokémon, "One left, this is where it get's interesting".
    An opponent Pokémon asleep, "Wake up [insert Pokémon name here], wake up!"

    And so forth... X


    possible, but I don't know how.
     
    Yeah I know it's possible, becuse it is already within RMXP, just didn't know if Essentials has it implemented within a script, this is good edition IMO, it's used within the original games, such as gym battles and elite4, didn't know if Poccil put this in too, just hasn't been noticed by Maruno or anyone to add to the (broken link removed).
     
    I assume you're talking about the occasions where the enemy trainer slides back in to say a little something during the battle (usually Gym Leaders upon sending out their final Pokémon).

    No, that feature isn't in Essentials. It's not the most essential feature either, so it may be a while before it's added. Each kind of message would be rather complicated too, since they'd need to be easily defined by the user (probably via battle comments), and then there's an animation going on too (the foe trainer sliding around).

    On a related note, there's the call-out message shown when the player sends out a new Pokémon. With just a bit of tweaking you can customise that message depending on the state of the foe/foe's party. It's also not done already, but at least it's easier (still non-essential, though).
     
    Ah yes, I see, that's a simple enough edit too, may play around with that message instead.

    Yeah, I didn't think the other option was available within Essentials, worth asking I think... Would've been nice to see the vastness of battle messages, but I guess as far as they go are the comments that can be converted VIA the event page...

    On another note, this has nothing to do with battle messages, for say, but, when I battle, I tested something, to see if I could add something I wanted to implement, and I don't get a

    "gained 2XP" (example)

    message... This happens when I use a Pokémon and he/she feints, then a new Pokémon wins the battle, (or the fight against the other Pokémon which knocked the first one out)... There is no error, just doesn't say the message, checked the scripts, and the message is deffinitly there, any ideas? X
     
    It'd be quite hard to get the messages from the event to the correct place in battle, actually.


    On another note, this has nothing to do with battle messages, for say, but, when I battle, I tested something, to see if I could add something I wanted to implement, and I don't get a

    "gained 2XP" (example)

    message... This happens when I use a Pokémon and he/she feints, then a new Pokémon wins the battle, (or the fight against the other Pokémon which knocked the first one out)... There is no error, just doesn't say the message, checked the scripts, and the message is deffinitly there, any ideas? X
    I've just tried this scenario:

    I send out L2 Pikachu, opponent trainer sends out L16 Geodude. Geodude uses Magnitude and knocks out Pikachu. I replace with L40 Gyarados. Gyarados uses Surf, and knocks out Geodude. I get the Exp gain message as normal. There are no other enemy Pokémon, and battle ends.

    Is that a different kind of scenario to the one you had? If it is, I can't replicate your problem. You did say you were testing an addition, which may well have interfered (probably by throwing a wobbly just before Exp calculations, causing pbGainExp to exit right then rather than run fully).
     
    Okay, well, since yesterday when I had this problem, I've now turned the game back on and it's fine, I'm just going to assume Essentials was just acting like a baby, but now I got a new problem (which I never noticed before), continuing the battle with the same Pokémon that won the fight before, the next Pokémon doesn't give EXP...

    Sorry I don't have any video recording program.

    Spoiler:


    I have looked in bug fixes and known bugs in the wiki and this hasn't been uploaded, so, I guess this is just my problem.

    Any ideas? X
     
    I've tried this scenario out too, as follows:

    I send out L40 Gyarados, opponent sends out Geodude. Gyarados uses Surf, Geodude is knocked out, Gyarados gains Exp. Opponent sends out Nosepass, I keep Gyarados in battle. Gyarados uses Surf, Nosepass is knocked out, Gyarados gains Exp.

    Again, it's fine for me. You still haven't mentioned what you had added and were testing, so I can't tell whether it would be responsible for your problem. If it's supposed to be a secret feature, you can just PM me about it.
     
    I haven't added anything yet... The only things I have added is a few extra messages to make it look more free with what "you" say... Here's my pbGainEXP section.

    Code:
    def pbGainEXP
        return if !@internalbattle
        successbegin=true
        for i in 0..3 # Not ordered by priority
          if !@doublebattle && pbIsDoubleBattler?(i)
            @battlers[i].participants=[]
            next
          end
          if pbIsOpposing?(i) && @battlers[i].participants.length>0 && @battlers[i].hp<=0
            dexdata=pbOpenDexData
            battlerSpecies=@battlers[i].species
            # Current species, not original species; also using R/S base EXP
            pbDexDataOffset(dexdata,battlerSpecies,17)
            baseexp=dexdata.fgetb
            level=@battlers[i].level
            dexdata.close
            # First count the number of participants
            partic=0
            expshare=0
            for j in @battlers[i].participants
              @participants[j]=true # Add participant to global list
            end
            for j in @battlers[i].participants
              next if !@party1[j] || !pbIsOwner?(0,j)
              partic+=1 if @party1[j].hp>0 && !@party1[j].egg?
            end
            for j in [email protected]
              next if !@party1[j] || !pbIsOwner?(0,j)
              expshare+=1 if @party1[j].hp>0 && !@party1[j].egg? && 
                 isConst?(@party1[j].item,PBItems,:EXPSHARE)
            end
            # Now calculate EXP for the participants
            if partic>0
              if !@opponent && successbegin && pbAllFainted?(@party2)
                @scene.pbWildBattleSuccess
                successbegin=false
              end
              for j in [email protected]
                thispoke=@party1[j]
                next if !@party1[j] || !pbIsOwner?(0,j)
                ispartic=0
                level=@battlers[i].level
                haveexpshare=(isConst?(thispoke.item,PBItems,:EXPSHARE)) ? 1 : 0
                for k in @battlers[i].participants
                  ispartic=1 if k==j
                end
                if thispoke.hp>0 && !thispoke.egg?
                  exp=0
                  if expshare>0
                    exp=((level*baseexp/7).floor/2).floor
                    exp=(exp/partic).floor*ispartic+(exp/expshare).floor*haveexpshare
                  elsif ispartic==1
                    exp=((level*baseexp/7).floor/partic).floor
                  end
                  isOutsider=(thispoke.trainerID!=self.pbPlayer.id ||
                     (thispoke.language!=0 && thispoke.language!=self.pbPlayer.language))
                  exp=(exp*3/2).floor if @opponent
                  exp=(exp*3/2).floor if isOutsider
                  exp=(exp*3/2).floor if isConst?(thispoke.item,PBItems,:LUCKYEGG)
                  growthrate=thispoke.growthrate
                  newexp=PBExperience.pbAddExperience(thispoke.exp,exp,growthrate)
                  exp=newexp-thispoke.exp;
                  if exp > 0
                    if isOutsider
                      pbDisplayPaused(_INTL("{1} gained a boosted\r\n{2} Exp. Points!",thispoke.name,exp))
                    else
                      pbDisplayPaused(_INTL("{1} gained\r\n{2} Exp. Points!",thispoke.name,exp))
                    end
                    #Gain effort value points, using RS effort values
                    totalev=0
                    for k in 0..5
                      totalev+=thispoke.ev[k]
                    end
                    dexdata=pbOpenDexData
                    pbDexDataOffset(dexdata,battlerSpecies,23)
                    for k in 0..5
                      evgain=dexdata.fgetb
                      if isConst?(thispoke.item,PBItems,:MACHOBRACE)
                        evgain*=2
                      end
                      if evgain>0
                        # Can't exceed overall limit
                        if totalev+evgain>510
                        # Bug Fix: must use "-=" instead of "="
                        evgain-=totalev+evgain-510
                      end
                      # Can't exceed stat limit
                      if thispoke.ev[k]+evgain>255
                        # Bug Fix: must use "-=" instead of "="
                        evgain-=thispoke.ev[k]+evgain-255
                      end
                        # Add EV gain
                        thispoke.ev[k]+=evgain
                        if thispoke.ev[k]>255
                          print "Single-stat EV limit 255 exceeded.\r\nStat: #{k}  EV gain: #{evgain}  EVs: #{thispoke.ev.inspect}"
                          thispoke.ev[k]=255
                        end
                        totalev+=evgain
                        if totalev>510
                          print "EV limit 510 exceeded.\r\nTotal EVs: #{totalev} EV gain: #{evgain}  EVs: #{thispoke.ev.inspect}"
                        end
                      end
                    end
                    newlevel=PBExperience.pbGetLevelFromExperience(newexp,growthrate)
                    tempexp=0
                    curlevel=thispoke.level
                    thisPokeSpecies=thispoke.species
                    if newlevel<curlevel
                      debuginfo="#{thispoke.name}: #{thispoke.level}/#{newlevel} | #{thispoke.exp}/#{newexp} | gain: #{exp}"
                      raise RuntimeError.new(
                         _INTL("The new level ({1}) is less than the Pokémon's\r\ncurrent level ({2}), which shouldn't happen.\r\n[Debug: {3}]",
                         newlevel,curlevel,debuginfo))
                      return
                    end
                    if thispoke.respond_to?("isShadow?") && thispoke.isShadow?
                      thispoke.exp+=exp
                    else
                      tempexp1=thispoke.exp
                      tempexp2=0
                      # Find battler
                      battler=pbFindPlayerBattler(j)
                      loop do
                        #EXP Bar animation
                        startexp=PBExperience.pbGetStartExperience(curlevel,growthrate)
                        endexp=PBExperience.pbGetStartExperience(curlevel+1,growthrate)
                        tempexp2=(endexp<newexp) ? endexp : newexp
                        thispoke.exp=tempexp2
                        @scene.pbEXPBar(thispoke,battler,startexp,endexp,tempexp1,tempexp2)
                        tempexp1=tempexp2
                        curlevel+=1
                        break if curlevel>newlevel
                        oldtotalhp=thispoke.totalhp
                        oldattack=thispoke.attack
                        olddefense=thispoke.defense
                        oldspeed=thispoke.speed
                        oldspatk=thispoke.spatk
                        oldspdef=thispoke.spdef
                        thispoke.calcStats
                        battler.pbUpdate if battler
                        @scene.pbRefresh
      ###########################
           #####MY CODE#####
                #######
      case rand(6)
      when 0
             pbDisplayPaused(_INTL("{1} looks to be getting stronger!",thispoke.name))
             pbDisplayPaused(_INTL("Using PokéDex to calculate stats."))
      when 1
             pbDisplayPaused(_INTL("{1} is enjoying all this battle time!",thispoke.name))
             pbDisplayPaused(_INTL("Let's check {1}'s stats with the PokéDex.",thispoke.name))
      when 2
             pbDisplayPaused(_INTL("Look at {1} go!",thispoke.name))
             pbDisplayPaused(_INTL("I wonder how strong you're getting."))
      when 3
             pbDisplayPaused(_INTL("Battling feels good doesn't it {1}!",thispoke.name))
             pbDisplayPaused(_INTL("Let's use the PokéDex to calculate your stats."))
      when 4
             pbDisplayPaused(_INTL("I love how strong {1} is getting!",thispoke.name))
             pbDisplayPaused(_INTL("PokéDex, what are {1}'s stats?",thispoke.name))
      when 5
             pbDisplayPaused(_INTL("Let's put this strength to good use, {1}!",thispoke.name))
             pbDisplayPaused(_INTL("Better check how strong you are."))
      when 6
             pbDisplayPaused(_INTL("I suspect {1} is getting stronger!",thispoke.name))
             pbDisplayPaused(_INTL("PokéDex should be able to tell me."))
           end
             @scene.pbLevelUp(thispoke,battler,oldtotalhp,oldattack,
                 olddefense,oldspeed,oldspatk,oldspdef)
             # Finding all moves learned at this level
    #         atkdata=pbRgssOpen("Data/attacksRS.dat","rb")
    #         offset=atkdata.getOffset(thisPokeSpecies-1)
    #         length=atkdata.getLength(thisPokeSpecies-1)>>1
    #         atkdata.pos=offset
                ########
           #####MY CODE#####
      ###########################
                        if battler
                          if battler.pokemon && @internalbattle
                            battler.pokemon.happiness+=2
                            battler.pokemon.happiness=255 if battler.pokemon.happiness>255
                          end
                        end
    #                    pbDisplayPaused(_INTL("{1} grew to Level {2}!",thispoke.name,curlevel)) ##########MY CODE##########
    #                    @scene.pbLevelUp(thispoke,battler,oldtotalhp,oldattack, ##########MY CODE##########
    #                       olddefense,oldspeed,oldspatk,oldspdef) ##########MY CODE##########
                        # Finding all moves learned at this level
                        atkdata=pbRgssOpen("Data/attacksRS.dat","rb")
                        offset=atkdata.getOffset(thisPokeSpecies-1)
                        length=atkdata.getLength(thisPokeSpecies-1)>>1
                        atkdata.pos=offset
                        for k in 0..length-1
                          atklevel=atkdata.fgetw
                          move=atkdata.fgetw
                          if atklevel==thispoke.level
                            # Learned a new move
                            pbLearnMove(j,move)
                          end
                        end
                        atkdata.close
                      end
                    end
                  end
                end
              end
            end
            # Now clear the participants array
            @battlers[i].participants=[]
          end
        end
      end

    I honestly can't see what the problem is and can't see it being nothing to do with the message part...
     
    Try running editor.exe (force run if necessary with control) then try again.

    Stupid stuff like that happens to me all the time.
    Examples: When you enter your name, it says something about the trainer not defined in trainers.dat.
    Run the editor when you are having an odd problem.
    Did that help?
     
    Nope that didn't help...

    This is confusing me, because I can script, I'm new to this that is all, so when I come across a problem, if I didn't cause it, I can't fix this myself... This will be a HUGE problem for a release if I can't get this fixed.
     
    I have another project with Maruno's Essentials, but my maps and events, but this makes no odds since the only thing I have really done is added maps, events and my own scripts, which I merely removed to see if they clashed, and they never, I haven't edited nothing to effect battling in any way... I had removed the messages "{1} gained 3% EXP. Points" (or whatever it is), just by putting a # key in front of the message, that was all... There are a few messages that interact when a Pokémon Levels up, which I thought was the case, until, I battled without a Pokémon levelling up and still the same outcome.
     
    Back
    Top