• Just a reminder that providing specifics on, sharing links to, or naming websites where ROMs can be accessed is against the rules. If your post has any of this information it will be removed.
  • Ever thought it'd be cool to have your art, writing, or challenge runs featured on PokéCommunity? Click here for info - we'd love to spotlight your work!
  • Our weekly protagonist poll is now up! Vote for your favorite Conquest protagonist in the poll by clicking here.
  • 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.

Better AI system

I'm still getting this error:

Spoiler:
 
I changed opps = eachOpponent -> opps = []
battler.eachOpposing {|b| opps.push(b)}

Then replaced idxbattler with battler.index in the following script line.
skill = @battle.pbGetOwnerFromBattlerIndex(battler.index).skill || 0

Still getting the "moves" error though
 
I changed opps = eachOpponent -> opps = []
battler.eachOpposing {|b| opps.push(b)}

Then replaced idxbattler with battler.index in the following script line.
skill = @battle.pbGetOwnerFromBattlerIndex(battler.index).skill || 0

Still getting the "moves" error though

I'm still getting this error:

Spoiler:

Just a recommendation, you should probably put the beast mode part of the different trainer ai scale.

Ill take a look at these later and post some solutions. Could you tell me when these errors occur?
 
Exact same time for me. Your opponent in battle gets an error every time it's their turn to attack.
 
Hey there,

I'm currently testing/fixing this script, so maybe I can help.

I think I got a new error :

Spoiler:


I was testing and got a random wild battle

The most important words are wild battle.

The problem is that the function pbEnemyShouldMegaEvolve?(idxBattler) is trying to ask the owner of the battler if it should mega-evolve. What owner? None, as it is a wild battle.

My solution consists in adding:

Code:
  #=============================================================================
  # Decide whether the opponent should Mega Evolve their Pokémon
  #=============================================================================
  def pbEnemyShouldMegaEvolve?(idxBattler)
    return false if @battle.wildBattle? [COLOR="Green"]# Add this line right below the definition. [/COLOR]
    # And then the rest


I also noted a few errors in the code.

Spoiler:



I also have a few remarks.

Remark 1. I noticed a lot of bugs due to the use of PurifyChamberSet.isSuperEffective(t1, t2). Why use this function instead of PBTypes.superEffective?(t1, t2) ?
Furthermore, PurifyChamberSet.isSuperEffective(t1, t2) assumes t1 and t2 are battlers, not types!

Remark 2. I tested this script with trainers with level 100 skill, I didn't notice they switch more...
 
Hey there,

I'm currently testing/fixing this script, so maybe I can help.



The most important words are wild battle.

The problem is that the function pbEnemyShouldMegaEvolve?(idxBattler) is trying to ask the owner of the battler if it should mega-evolve. What owner? None, as it is a wild battle.

Tried it with your fix but wild battle still make error :(
 
Tried it with your fix but wild battle still make error :(

Is it the same error? Please post a screenshot!

I think I should post the fixed script that I'm testing. There were several errors throughout the script so you may just have found another bug.
 
I'll show you after, but I think it was same error

EDIT: Here you go :

Spoiler:

Well, it's the same error, but at the same time it's not the same error XD
It's the same error in that it's trying to find the skill of the trainer, while it's again a wild battle.

Go to line 482, it should be:

Code:
skill = @battle.pbGetOwnerFromBattlerIndex(idxBattler) || 0

and delete this line. Don't worry, the skill variable is already defined at the beginning of the pbChooseMoves() function.

See you at your next bug XD
 
Last edited:
Back
Top