Report bugs and errors in unmodified Essentials version 18 Page 47

Started by seeker January 16th, 2012 5:35 PM
  • 207866 views
  • 1173 replies
Seen 1 Day Ago
Posted 1 Week Ago
11 posts
1.2 Years
"Go! *POKEMON*!" text didn't showed up if the foe's HP is full when I switch out.
  def pbMessagesOnReplace(idxBattler,idxParty)
    party = pbParty(idxBattler)
    newPkmnName = party[idxParty].name
    if isConst?(party[idxParty].ability,PBAbilities,:ILLUSION)
      newPkmnName = party[pbLastInTeam(idxBattler)].name
    end
    if pbOwnedByPlayer?(idxBattler)
      opposing = @battlers[idxBattler].pbDirectOpposing
      if opposing.fainted? || opposing.hp==opposing.totalhp
        pbDisplayBrief(_INTL("You're in charge, {1}!",newPkmnName))
      elsif opposing.hp>=opposing.totalhp/2
        pbDisplayBrief(_INTL("Go for it, {1}!",newPkmnName))
      elsif opposing.hp>=opposing.totalhp/4
        pbDisplayBrief(_INTL("Just a little more! Hang in there, {1}!",newPkmnName))
      else
        pbDisplayBrief(_INTL("Your opponent's weak! Get 'em, {1}!",newPkmnName))
      end
    else
      owner = pbGetOwnerFromBattlerIndex(idxBattler)
      pbDisplayBrief(_INTL("{1} sent out {2}!",owner.fullname,newPkmnName))
    end
  end
"*TRAINER* is about to send in *FOE POKEMON*. Will you switch your Pokémon?" text still shows up after this Pokemon faint and I switch a next one.
And the Faint Cry sound isn't hear.

This code is not the same in the gameplay but still a error.
POKÉMON SUPER SQUAD DEVELOPMENT
See the Recruitment thread here!
Male
Seen 2 Weeks Ago
Posted 2 Weeks Ago
4 posts
6.4 Years
So... I posted this over on Relic already, but I thought I might as well post it here too.

When forcing the use of Salac Berry and it's cousins, it doesn't work when the user is at full HP.
I tried to code in Stuff Cheeks, actually got it to work as well.
But in testing I noticed that it doesn't actually get the effects of the held Salac Berry if I was at Full HP.
At first I thought it was a mistake on my end, so I tried to shift some stuff around but it didn't work.

Anyways, next thing I tried was using something Essentials already came with: Bug Bite.

So instead of using Stuff Cheeks, I tricked my Salac Berry and used Bug Bite afterwards and saw the same results.
Bug Bite itself works, but the user only gains the +1 Speed from the Salac Berry while not at Full HP.

Since Bug Bite utilizes "pbHeldItemTriggerCheck", that was the thing I checked first. Due to the bahaviour of only triggering when having taken at least 1 HP damage, I figured I look into "pbItemHPHealCheck", which also lead to a dead end.
Ultimately I checked the Salac Berry itself:
BattleHandlers::HPHealItem.add(:SALACBERRY,
  proc { |item,battler,battle,forced|
    next pbBattleStatIncreasingBerry(battler,battle,item,forced,PBStats::SPEED)
  }
)
"HPHealItem.add"
The game treats it as a healing item, making it unable to be used when at Full HP, even if it's forced to be used.
Age 24
He/Him
Seen 7 Hours Ago
Posted 1 Day Ago
30 posts
274 Days
1) PBS: Alolan Nintetales is set to evolve into itself upon using an Ice Stone
Spoiler:
#-------------------------------
[NINETALES,1]
FormName = Alolan
Type1 = ICE
Type2 = FAIRY
BaseStats = 73,67,75,109,81,100
EffortPoints = 0,0,0,2,0,0
Abilities = SNOWCLOAK
HiddenAbility = SNOWWARNING
Moves = 0,DAZZLINGGLEAM,1,DAZZLINGGLEAM,1,IMPRISON,1,NASTYPLOT,1,ICEBEAM,1,ICESHARD,1,CONFUSERAY,1,SAFEGUARD
Color = Blue
Pokedex = It lives on mountains perpetually covered in snow and is revered as a deity incarnate. It appears draped in a blizzard.
WildItemUncommon = SNOWBALL
Evolutions = NINETALES,Item,ICESTONE
#-------------------------------


2) draining moves such as Leech Life do not restore HP when it is the final move in a battle (my Mega Beedrill one-hit KO'ed a Mewtwo with Leech Life, but did not recover any HP)
Seen 7 Hours Ago
Posted 1 Week Ago
30 posts
2.9 Years
In soak code ->
#===============================================================================
# Target becomes Water type. (Soak)
#===============================================================================
class PokeBattle_Move_061 < PokeBattle_Move
  def pbFailsAgainstTarget?(user,target)
    if !target.canChangeType? ||
       !target.pbHasOtherType?(getConst(PBTypes,:WATER))
      @battle.pbDisplay(_INTL("But it failed!"))
      return true
    end
    return false
  end

  def pbEffectAgainstTarget(user,target)
    newType = getConst(PBTypes,:WATER)
    user.pbChangeTypes(newType)
    typeName = PBTypes.getName(newType)
    @battle.pbDisplay(_INTL("{1} transformed into the {2} type!",target.pbThis,typeName))
  end
end
user.pbChangeTypes(newType)
needs to be changed to
target.pbChangeTypes(newType)
else it'll change user type instead of its target
Seen 4 Hours Ago
Posted 1 Day Ago
64 posts
188 Days
The abilities Beast Boost and Battlebond don't trigger when knocking out another Pokemon(even if the opponent has at least one other Pokemon left). I tried playing around with their functions a bit to find the error and I came as far as this:
This line stops the code from working, because the if statement inside the block never returns true.
Spoiler:
# Greninja - Battle Bond
    if !user.fainted? && !user.effects[PBEffects::Transform] &&
       isConst?(user.species,PBSpecies,:GRENINJA) &&
       isConst?(user.ability,PBAbilities,:BATTLEBOND)
      if [email protected]?(user.idxOpposingSide) &&
         [email protected][user.index&1][user.pokemonIndex]
        numFainted = 0
        targets.each { |b| numFainted += 1 if b.damageState.fainted }
        if numFainted>0 && user.form!=1 
          @battle.battleBond[user.index&1][user.pokemonIndex] = true
          @battle.pbDisplay(_INTL("{1} became fully charged due to its bond with its Trainer!",user.pbThis))
          @battle.pbShowAbilitySplash(user,true)
          @battle.pbHideAbilitySplash(user)
          user.pbChangeForm(1,_INTL("{1} became Ash-Greninja!",user.pbThis))
        end
      end
    end

When I changed it to b.damageState.unaffected and used a move that didn't affect the opponent it returned true, meaning the error has to do with the .fainted attribute.
But looking at def pbRecordDamageLost, I noticed target.damageState.fainted turns true(which it does, I tested it):
Spoiler:
# Used by Counter/Mirror Coat/Metal Burst/Revenge/Focus Punch/Bide/Assurance.
  def pbRecordDamageLost(user,target)
    damage = target.damageState.hpLost
    # NOTE: In Gen 3 where a move's category depends on its type, Hidden Power
    #       is for some reason countered by Counter rather than Mirror Coat,
    #       regardless of its calculated type. Hence the following two lines of
    #       code.
    moveType = nil
    moveType = getID(PBTypes,:NORMAL) if @function=="090"   # Hidden Power
    if physicalMove?(moveType)
      target.effects[PBEffects::Counter]       = damage
      target.effects[PBEffects::CounterTarget] = user.index
    elsif specialMove?(moveType)
      target.effects[PBEffects::MirrorCoat]       = damage
      target.effects[PBEffects::MirrorCoatTarget] = user.index
    end
    if target.effects[PBEffects::Bide]>0
      target.effects[PBEffects::BideDamage] += damage
      target.effects[PBEffects::BideTarget] = user.index
    end
    target.damageState.fainted = true if target.fainted?
    target.lastHPLost = damage             # For Focus Punch
    target.tookDamage = true if damage>0   # For Assurance
    target.lastAttacker.push(user.index)   # For Revenge
    if target.opposes?(user)
      target.lastHPLostFromFoe = damage              # For Metal Burst
      target.lastFoeAttacker.push(user.index)        # For Metal Burst
    end
  end

In conclusion target.damageState.fainted is true for every fainted target in the damage calculation, but never in the block call.
targets.each { |b| numFainted += 1 if b.damageState.fainted }
I tried to find this error's source but failed. If anyone has some time they could look into this. :)

#Not Important

All hail the wishmaker

He/Him
Hoenn
Seen 8 Hours Ago
Posted 2 Days Ago
798 posts
284 Days
The code for
eachOpposing
has no block to yield, so it gives a LocalJumpError. This is my fix:
# Yields each unfainted opposing Pokémon.
  def eachOpposing
    #@battle.battlers.each { |b| yield b if b && !b.fainted? && b.opposes?(@index) } OLD METHOD
   #                             ^ cannot yield nothing
    @battle.battlers.each { |b| return b if b && !b.fainted? && b.opposes?(@index) }
  end

Vendily

Female
Seen 11 Hours Ago
Posted 4 Days Ago
1,276 posts
5.1 Years
The code for
eachOpposing
has no block to yield, so it gives a LocalJumpError. This is my fix:
# Yields each unfainted opposing Pokémon.
  def eachOpposing
    #@battle.battlers.each { |b| yield b if b && !b.fainted? && b.opposes?(@index) } OLD METHOD
   #                             ^ cannot yield nothing
    @battle.battlers.each { |b| return b if b && !b.fainted? && b.opposes?(@index) }
  end
That doesn't seem right, It's supposed to yield, and you call it with a block, else it would crash the second a battler was set up and sent in.
with this code, I believe that some battlers won't be properly set up as participants, and fainting them will give no experience.
| Starly @ 1,228

Common Errors (and How to Fix Them) in Essentials
None of my scripts are made for v18 of Essentials.

#Not Important

All hail the wishmaker

He/Him
Hoenn
Seen 8 Hours Ago
Posted 2 Days Ago
798 posts
284 Days
That doesn't seem right, It's supposed to yield, and you call it with a block, else it would crash the second a battler was set up and sent in.
with this code, I believe that some battlers won't be properly set up as participants, and fainting them will give no experience.
it works fine for me (as of now)
Seen 4 Hours Ago
Posted 1 Day Ago
64 posts
188 Days
# Yields each unfainted opposing Pokémon.
  def eachOpposing
    #@battle.battlers.each { |b| yield b if b && !b.fainted? && b.opposes?(@index) } OLD METHOD
   #                             ^ cannot yield nothing
    @battle.battlers.each { |b| return b if b && !b.fainted? && b.opposes?(@index) }
  end
I think the actual problem is not that eachOpposing doesn't yield anything. It just doesn't yield on fainted battlers:
 && !b.fainted?
This leads to target.damagestate.fainted to never be true. Don't know how to fix it though, because I don't know if removing this clause messes anything else up.
Seen 7 Hours Ago
Posted 1 Week Ago
30 posts
2.9 Years
i was getting an error when adding an item in debug when no one else was, but i was sure it was pbs related so i didnt pay attention
i looked into it again, basically this error happens if u have ur item.pbs set like
item 500
item 501
item 600
if there's a leap in items, the debug will try to get the name from item 502 that doesnt exist and crash
this is how i fixed it
    for i in 1..PBItems.maxValue
      next if [email protected][i]  ##change added
      name = @itemdata[i][ITEM_NAME]
      if name && name!="" && @itemdata[i][ITEM_POCKET]!=0
        cmds.push([i,name])
      end
    end
Age 23
The Netherlands
Seen 1 Week Ago
Posted 1 Week Ago
10 posts
290 Days
For V18:

The pre-evolutions of fully evolved Pokémon do not seem to be retrieved correctly. If a Pokémon itself does not have any evolutions, but has pre-evolved forms, an error is returned if trying to return a pre-evolution. This happens for the functions pbGetBabySpecies and pbGetPreviousForm. For instance, if either of those are called for Raticate and Pidgeot, they return an error, but they both work fine for Rattata, Pidgey and Pidgeotto. It appears to be a problem with pbGetEvolutionData, which returns nil if the Pokémon does not evolve. I found out about this when automatically adjusting the evolution stage of low-level wild Pokémon. When breeding Pokémon, this means that the baby will hatch fully evolved.

I don't see a quick fix for this; the one thing I can think of is a separate subroutine that checks if the Pokémon occurs in another mon's evolution tree before returning nil, but that is not too elegant.

UPDATE:
I've looked into the evolution data that is actually stored; as I understand it, each Pokémon stores its previous and next evolutions in a list. That list consists of lists each having the format [Other Pokémon's ID],[Evolution Method],[Method Parameter],[Boolean whether this is a pre-evolution or not]. So, Bulbasaur's data is [2],[4],[16],[False], meaning "it evolves into Ivysaur at level 16, which is not a pre-evolution". Ivysaur's data, then, is [[1],[4],[16],[True]],[[3],[4],[32],[False]]. This means it evolves from Bulbasaur at level 16 and into Venusaur at level 32. Venusaur's data should then be [2],[4],[32],[True], but is instead empty, which is probably something that goes wrong when compiling. This means that an egg bred from an Ivysaur will correctly hatch a Bulbasaur, but an egg bred from Venusaur will hatch a Venusaur because the evolution data is empty, as it would be for a Pokémon with no evolutionary relatives (Also, returning nil instead of the empty list results in a few unexpected errors; eggs are generated correctly for Pokémon with no relatives). I think I can patch this up in pbGetEvolutionData knowing what I know now; but that's more of a band-aid.

DarrylBD99

Male
Malaysia
Seen 1 Hour Ago
Posted 1 Hour Ago
156 posts
141 Days
2020-09-13 (1).png
I managed to find a fix, but I am not sure if it will be permenant

in Tilemap_XP, look for the following line
spriteZ = priority==0 ? 0 : ypos+priority*32+32
located in the function "addTile" and replace it with
spriteZ = (!priority || priority==0) ? 0 : ypos+priority*32+32
If you run it like that, there is a chance you will encounter a different error like this.2020-09-13 (2).png In that case, go to Game_Map and find
return terrain if terrain > 0 && terrain!=PBTerrain::Neutral
located in the function "terrain_tag" and replace it with
return terrain if terrain && terrain > 0 && terrain!=PBTerrain::Neutral
Seen 4 Hours Ago
Posted 1 Day Ago
64 posts
188 Days
UPDATE:
I've looked into the evolution data that is actually stored; as I understand it, each Pokémon stores its previous and next evolutions in a list. That list consists of lists each having the format [Other Pokémon's ID],[Evolution Method],[Method Parameter],[Boolean whether this is a pre-evolution or not]. So, Bulbasaur's data is [2],[4],[16],[False], meaning "it evolves into Ivysaur at level 16, which is not a pre-evolution". Ivysaur's data, then, is [[1],[4],[16],[True]],[[3],[4],[32],[False]]. This means it evolves from Bulbasaur at level 16 and into Venusaur at level 32. Venusaur's data should then be [2],[4],[32],[True], but is instead empty, which is probably something that goes wrong when compiling. This means that an egg bred from an Ivysaur will correctly hatch a Bulbasaur, but an egg bred from Venusaur will hatch a Venusaur because the evolution data is empty, as it would be for a Pokémon with no evolutionary relatives (Also, returning nil instead of the empty list results in a few unexpected errors; eggs are generated correctly for Pokémon with no relatives). I think I can patch this up in pbGetEvolutionData knowing what I know now; but that's more of a band-aid.
I think the problem lies here in "Compiler_PBS":
Spoiler:
when "Evolutions"
            speciesEvolutions  = []
            for i in 0...value.length/3
              speciesEvolutions.push([value[i*3],value[i*3+1],value[i*3+2],false])
            end
            evolutions[speciesID] = speciesEvolutions

And here
Spoiler:
for e in 0...evolutions.length
    next if !evolutions[e]
etc.

The array "speciesEvolutions" is empty for pokemon without an evolution leading to the part where pre evolution data is created to always be skipped by the second line of code.Simply removing that line won't fix the problem because the function after needs an evolution array?
Age 23
Male
Ohio
Seen 3 Days Ago
Posted 1 Week Ago
40 posts
1 Years
For V18:

----- When breeding Pokémon, this means that the baby will hatch fully evolved.

-----UPDATE:
I've looked into the evolution data that is actually stored; as I understand it, each Pokémon stores its previous and next evolutions in a list. That list consists of lists each having the format [Other Pokémon's ID],[Evolution Method],[Method Parameter],[Boolean whether this is a pre-evolution or not]. So, Bulbasaur's data is [2],[4],[16],[False], meaning "it evolves into Ivysaur at level 16, which is not a pre-evolution". Ivysaur's data, then, is [[1],[4],[16],[True]],[[3],[4],[32],[False]]. This means it evolves from Bulbasaur at level 16 and into Venusaur at level 32. Venusaur's data should then be [2],[4],[32],[True], but is instead empty, which is probably something that goes wrong when compiling. This means that an egg bred from an Ivysaur will correctly hatch a Bulbasaur, but an egg bred from Venusaur will hatch a Venusaur because the evolution data is empty, as it would be for a Pokémon with no evolutionary relatives (Also, returning nil instead of the empty list results in a few unexpected errors; eggs are generated correctly for Pokémon with no relatives). -----.
I have been having the same issue! To add a little more info to hopefully help solve this... I was experimenting in unedited Essentials and found that breeding has problems deciding what to put in the egg. If I bred two Pokemon from the same evolution line (such as Venusaur + Ivysaur or Gyarados + Gyarados) the correct Egg would result. However, if I bred two different Pokemon in the same Egg Group (such as Ditto + Persian or Fearow + Pidgeot) the resulting Egg would just be the exact same as the mother, even if it was evolved.
Developing Pokémon XD: Rebirth, a spiritual successor to Pokémon XD and Colosseum
Seen 4 Hours Ago
Posted 1 Day Ago
64 posts
188 Days
Found a little bug regarding the AI. When the AI can't switch or use an item and all moves return a score of 0 the game automatically registers an encored move or struggle. For my example the AI had a Pokemon with only Tackle against a Ghost type. So it used Struggle (because Tackle had a score of 0) even though it should only do that if it can't use any moves. This is really insignificant because Tackle doesn't do damage, but it just feels unnatural. So I added a little piece of code to register any random move if the AI didn't register any choices and isn't encored:
Spoiler:

Put this in "AI_Move" directly above "if choices.length==0"
# Register any random move if no choices are registered and the Pokemon isn't encored
    if choices.length==0 && user.pbEncoredMoveIndex<0
      user.eachMoveWithIndex do |m,i|
        next if [email protected]?(idxBattler,i,false)
        choices.push([i,100,-1])
      end
    end
If this leads into any other problems let me know. :)