• 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.
  • Our friends from the Johto Times are hosting a favorite Pokémon poll - and we'd love for you to participate! Click here for information on how to vote for your favorites!
  • Serena, Kris, Dawn, Red - which Pokémon protagonist is your favorite? Let us know by voting in our grand final favorite protagonist poll!
  • PokéCommunity supports the Stop Killing Games movement. If you're a resident of the UK or EU, consider signing one of the petitions to stop publishers from destroying games. Click here for more information!
  • 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

Hey noob dev here, im trying to develop a harder fan rom, how do i correctly implement this into my game?
 
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

Thanks for all your fixes :)
I've been kinda busy lately
 
yea im just not sure where to put it or what to remove if something needs to be removed for this to work.
 
Hello, I had an error maybe a compatibility issue with dynamax :

Spoiler:
 
Hello, I had an error maybe a compatibility issue with dynamax :

Spoiler:

You need to add the possibility to dynamax in the pbChooseMoves def. You should be able to find what you need in the dynamax script.
 
yea im just not sure where to put it or what to remove if something needs to be removed for this to work.

Are you making a ROM hack or a Pokemon essentials game? You can't use it in rom hacks.
 
essentials V18.1 my bad force of habit to say "ROM" vs "Fan game" also a check for Fakeout would be a pretty solid idea so the AI doesn't try to use it past turn one, but would also favor it if first turn if the move would be effective. just a suggestion. :)
 
Last edited:
Spoiler:
What do you mean?

I don't use the dynamax script but this should work:
Code:
def pbDefaultChooseEnemyCommand(idxBattler)
		return if pbEnemyShouldUseItem?(idxBattler)
		return if pbEnemyShouldWithdraw?(idxBattler)
		return if @battle.pbAutoFightMenu(idxBattler)
		@battle.pbRegisterMegaEvolution(idxBattler) if pbEnemyShouldMegaEvolve?(idxBattler)
		if SPIRIT_POWERS
			@battle.pbRegisterSpiritPower(idxBattler) if pbEnemyShouldUseSpiritPower?(idxBattler)
		end
                # ---- Dynamax ---- #
                @battle.pbRegisterDynamax(idxBattler) if pbEnemyShouldUseDynamax?(idxBattler)
                # ----                   ---- #
		pbChooseMoves(idxBattler)
	end
Could you send me your code before you add this change in? thx :)
 
Spoiler:


I don't use the dynamax script but this should work
Could you send me your code before you add this change in? thx :)

There is this with "pbChooseMove" :

Spoiler:
 
Spoiler:


I don't use the dynamax script but this should work:
Code:
def pbDefaultChooseEnemyCommand(idxBattler)
		return if pbEnemyShouldUseItem?(idxBattler)
		return if pbEnemyShouldWithdraw?(idxBattler)
		return if @battle.pbAutoFightMenu(idxBattler)
		@battle.pbRegisterMegaEvolution(idxBattler) if pbEnemyShouldMegaEvolve?(idxBattler)
		if SPIRIT_POWERS
			@battle.pbRegisterSpiritPower(idxBattler) if pbEnemyShouldUseSpiritPower?(idxBattler)
		end
                # ---- Dynamax ---- #
                @battle.pbRegisterDynamax(idxBattler) if pbEnemyShouldUseDynamax?(idxBattler)
                # ----                   ---- #
		pbChooseMoves(idxBattler)
	end
Could you send me your code before you add this change in? thx :)

CTRL + SHIFT + F def pbDefaultChooseEnemyCommand
Select the one in better ai and replace the whole def with that.
Can you send the whole better AI script pls? It would help knowing what you've got on your end.
 
CTRL + SHIFT + F def pbDefaultChooseEnemyCommand
Select the one in better ai and replace the whole def with that.
Can you send the whole better AI script pls? It would help knowing what you've got on your end.

Hello so test in 1 vs raid, 2 vs raid and the problem is when getting to 3 vs raid with dynamax script

And the better AI script is this one:

Spoiler:

EDIT:

After some testing in 3v1 wild battle the problem still happen so it's something to do with your script the problem occurs when selecting the move of our third pokemon (but you can still press "Ok" and keep the fight happen)
 
Last edited:
Seems trainers keep trying to Will O' Wisp against Fire pokemon.
 
Back
Top