• Do not use Discord to host any images you post, these links expire quickly! You can learn how to add images to your posts here.
Resource icon

Resource Teach the AI to Use Revives 1

Poq

Cooltrainer
Member
Joined
Aug 7, 2018
Posts
113
Poq submitted a new resource:

Teach the AI to Use Revives - So NPCs can be as annoying as the Player

In Essentials, as in the original Pokemon games, you will never battle an opponent who uses a Revive. Even if you give a trainer a revival item, they'll never use it. That's because the AI hasn't been programmed to know how to revive. I found that, in my game, I had some story reasons for wanting a few NPC's to be able to use Revives in battle. So, I wrote a script to make that possible:

NUJsoEY.png


This is a fairly simple plug & play script, but I...

Read more about this resource...
 

MGriffin

Trainer
Member
Joined
May 8, 2017
Posts
90
Am I right in thinking the AI doesn't do anything special to choose which Pokémon to revive? It just picks the "first" one it finds (which will be the earliest Pokémon in the party definition)?

Perhaps you could use something similar to the logic that chooses the next Pokémon to switch in? That way it would at least try to pick the "best" Pokémon to use vs whatever you've got in right now.

… In fact, now that I mention switching—how does the AI decide when to use Revives? For Potions "my Pokémon has yellow health"(?), should Revives be something like "my Pokémon will faint on the next hit, or I would like to switch my Pokémon out"?
 

Poq

Cooltrainer
Member
Joined
Aug 7, 2018
Posts
113
Am I right in thinking the AI doesn't do anything special to choose which Pokémon to revive? It just picks the "first" one it finds (which will be the earliest Pokémon in the party definition)?

Perhaps you could use something similar to the logic that chooses the next Pokémon to switch in? That way it would at least try to pick the "best" Pokémon to use vs whatever you've got in right now.

… In fact, now that I mention switching—how does the AI decide when to use Revives? For Potions "my Pokémon has yellow health"(?), should Revives be something like "my Pokémon will faint on the next hit, or I would like to switch my Pokémon out"?

Yes, it's very simple at this point. If there is a fainted pokémon in the team, the AI will use the revive on the first one it checks.
I've considered adding more logic to it, like using a revive only when down to their last pokémon and choosing which pokémon to revive based on trainer skill level, for a future update.
 

MGriffin

Trainer
Member
Joined
May 8, 2017
Posts
90
Yes, it's very simple at this point. If there is a fainted pokémon in the team, the AI will use the revive on the first one it checks.
I've considered adding more logic to it, like using a revive only when down to their last pokémon and choosing which pokémon to revive based on trainer skill level, for a future update.
Thanks for the reply, it's a cool resource! Hopefully we'll see more varied and clever AIs in the future as a result :)
 

Poq

Cooltrainer
Member
Joined
Aug 7, 2018
Posts
113
Poq updated Teach the AI to Use Revives with a new update entry:

v1.1 Even Smarter AI

The script now takes into account trainer skill level.
  • High Skill Trainer - waits until they are down to one Pokémon, then revives the fainted Pokémon with the best type advantage and highest stats.
  • Medium Skill Trainer - waits until half the party is fainted, then revives the fainted Pokémon with the highest stats.
  • Low Skill Trainers - revive the first Pokémon that faints.
If you previously installed the script, just re-copy the code in the spoiler and paste it over the old code.

Read the rest of this update entry...
 
Last edited:
Back
Top