- 4
- Posts
- 8
- Years
- Seen Feb 6, 2017
Hi all!
Tweaking the AI scripts a little bit, I've run into a problem. I wanted to make the opposing pokemon to always use Thunder Wave in case your pokemon (the one controled by the player) was faster. Looking through the scripts I ended up bumping into this:
In this example, a reference to both pokemon speed is made to decide wether to use Flame Charge or not.
So adapting this I made a custom one for Thunder Wave:
Which caused the following error:
Exception: NoMethodError
Message: undefined method `pbRoughStat' for #<PokeBattle_Battle:0x6f74218>
PokeBattle_AI:301:in `pbGetMoveScore'
PokeBattle_AI:3969:in `pbChooseMoves'
PokeBattle_AI:3967:in `each'
PokeBattle_AI:3967:in `pbChooseMoves'
PokeBattle_AI:4309:in `pbDefaultChooseEnemyCommand'
PokeBattle_Scene:2779:in `pbChooseEnemyCommand'
PokeBattle_Battle:2670:in `pbCommandPhase_old'
PokeBattle_Battle:2665:in `each'
PokeBattle_Battle:2665:in `pbCommandPhase_old'
#1 Battle:311:in `pbCommandPhase'
I'd like some help to spot what I'm doing wrong.
Thanks in advance!
Tweaking the AI scripts a little bit, I've run into a problem. I wanted to make the opposing pokemon to always use Thunder Wave in case your pokemon (the one controled by the player) was faster. Looking through the scripts I ended up bumping into this:
Code:
when 0x1F
aspeed=pbRoughStat(attacker,PBStats::SPEED,skill)
ospeed=pbRoughStat(opponent,PBStats::SPEED,skill)
if aspeed<ospeed && aspeed*2>ospeed
score+=30
end
In this example, a reference to both pokemon speed is made to decide wether to use Flame Charge or not.
So adapting this I made a custom one for Thunder Wave:
Code:
aspeed=pbRoughStat(attacker,PBStats::SPEED,skill)
ospeed=pbRoughStat(opponent,PBStats::SPEED,skill)
if (move.basedamage==0) && (ospeed>aspeed) &&
(opponent.pbCanParalyze?(attacker,false)) &&
(isConst?(move.type,PBTypes,:ELECTRIC))
score+=120000
end
Which caused the following error:
Spoiler:
Exception: NoMethodError
Message: undefined method `pbRoughStat' for #<PokeBattle_Battle:0x6f74218>
PokeBattle_AI:301:in `pbGetMoveScore'
PokeBattle_AI:3969:in `pbChooseMoves'
PokeBattle_AI:3967:in `each'
PokeBattle_AI:3967:in `pbChooseMoves'
PokeBattle_AI:4309:in `pbDefaultChooseEnemyCommand'
PokeBattle_Scene:2779:in `pbChooseEnemyCommand'
PokeBattle_Battle:2670:in `pbCommandPhase_old'
PokeBattle_Battle:2665:in `each'
PokeBattle_Battle:2665:in `pbCommandPhase_old'
#1 Battle:311:in `pbCommandPhase'
I'd like some help to spot what I'm doing wrong.
Thanks in advance!