• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • 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.

Research: Trainer AI Command Research

AkameTheBulbasaur

Akame Marukawa of Iyotono
409
Posts
10
Years
Okay. Thanks for answering. In the JumpIfDamageBonusEquals AI commands, why Fairy doesn't use the own Fairy move instead of the Metronome?

Because in my game (where I originally developed the routine) Metronome was a Fairy Type move. If it's not for you you'll want to change that to a move that is Fairy Type for you.
 

Lance Koijer 2.0

Lance Koijer
105
Posts
6
Years
Because in my game (where I originally developed the routine) Metronome was a Fairy Type move. If it's not for you you'll want to change that to a move that is Fairy Type for you.


Wow thanks for the response...

anyway.. What I was asking is if it's possible to use AI Script on player not just on aoppomemt trainer...

Another question, would it be possible to make it in wild battles? Not the wildbattle command in XSE but the actual wild battle where you will emcounter Pokémon in grass and water areas and etcetera.

Thanks man.
 

AkameTheBulbasaur

Akame Marukawa of Iyotono
409
Posts
10
Years
Wow thanks for the response...

anyway.. What I was asking is if it's possible to use AI Script on player not just on aoppomemt trainer...

Another question, would it be possible to make it in wild battles? Not the wildbattle command in XSE but the actual wild battle where you will emcounter Pokémon in grass and water areas and etcetera.

Thanks man.

The AI Scripts are only activated for the AI, not any manual input (like the player). It is possible for wild battles, but only in certain circumstances. The last two scripts in the table are used for wild Pokemon battles. One is the script that makes the Pokemon run away in Safari battles, and the other I believe is the one that makes Entei/Raikou/Suicune run away. I don't know how they are activated though, so I'm not sure how to make them work for normal wild battles.
 

Lance Koijer 2.0

Lance Koijer
105
Posts
6
Years
The AI Scripts are only activated for the AI, not any manual input (like the player). It is possible for wild battles, but only in certain circumstances. The last two scripts in the table are used for wild Pokemon battles. One is the script that makes the Pokemon run away in Safari battles, and the other I believe is the one that makes Entei/Raikou/Suicune run away. I don't know how they are activated though, so I'm not sure how to make them work for normal wild battles.

Thanks man. That really is a good finding. Kudos
 
116
Posts
16
Years
In the JumpIfDamageBonusEquals AI commands, I used the Fairy type move, Fairy Wind that its hex code is 0x166. But the error of "invalid immediate: 358 is out of range" appearred while I was compiling the routine. Is there any way to solve it?
 
Last edited:

Skeli

Lord of the Rings
300
Posts
10
Years
In the JumpIfDamageBonusEquals AI commands, I used the Fairy type move, Fairy Wind that its hex code is 0x166. But the error of "invalid immediate: 358 is out of range" appearred while I was compiling the routine. Is there any way to solve it?
Are you using the old AI Script Pro? I rewrote it last week and I recommend using it instead. https://github.com/xizqu/FR_AI_Script/tree/master/Python_Compiler

As for your bug, JumpIfDamageBonusEquals takes a byte as its first argument; a number up to 0xFF or 255. You're getting that error because 0x166 or 358 is larger than a byte. In any case, the argument does not take a move ID as its argument. Look through the OP again to see what you should be putting there.
 
116
Posts
16
Years
Are you using the old AI Script Pro? I rewrote it last week and I recommend using it instead. https://github.com/xizqu/FR_AI_Script/tree/master/Python_Compiler

As for your bug, JumpIfDamageBonusEquals takes a byte as its first argument; a number up to 0xFF or 255. You're getting that error because 0x166 or 358 is larger than a byte. In any case, the argument does not take a move ID as its argument. Look through the OP again to see what you should be putting there.

Thanks a lot for the updating of the tools. Is it means that the move hex code must less than 0xFF and there is no other ways to make the command to take two bytes as its argument?
 

Skeli

Lord of the Rings
300
Posts
10
Years
Thanks a lot for the updating of the tools. Is it means that the move hex code must less than 0xFF and there is no other ways to make the command to take two bytes as its argument?
The move hex code can be more than 0xFF, it's just that command isn't looking for a move ID. Read through what the command does and you'll understand.
 
116
Posts
16
Years
The move hex code can be more than 0xFF, it's just that command isn't looking for a move ID. Read through what the command does and you'll understand.

What I see is the hex code is really move ID, such as "mov r0, #0xF /*Cut*/", cut move hex code is 0xF, others are also the same except dragon type move, dragon rush.
 

Skeli

Lord of the Rings
300
Posts
10
Years
What I see is the hex code is really move ID, such as "mov r0, #0xF /*Cut*/", cut move hex code is 0xF, others are also the same except dragon type move, dragon rush.
Ah, I see where you're confusion is coming from. If you're using the rewritten JumpIfDamageBonusEquals, the first argument takes a move type, or 0x12 to compare the current move. You cannot check if it's a certain move. If you use the rewritten command, you'll also need to update the command in the commands file.
 
82
Posts
6
Years
What I see is the hex code is really move ID, such as "mov r0, #0xF /*Cut*/", cut move hex code is 0xF, others are also the same except dragon type move, dragon rush.

Just going on what skeli said, if you need to update your commands, I have a tool in the tool/resource section. Akame has updated 5+ commands so I'll be adding them this week. Just wait a few days if you're interested in it. It'll add all new commands, repoint the table and repoint the commands in the table to the new ones. Only thing it doesn't do is clear out the old command data. Too lazy to add it and it you ever need to repoint back, it's easy.
 

AkameTheBulbasaur

Akame Marukawa of Iyotono
409
Posts
10
Years
I'm nearing the end of my work on AI Scripting, as I'm almost finished with the scripts for my game. Once I'm finished with bug testing those, I'll have all the commands I plan to do done.

Current updates are that I fixed a bug with the Double Battle Target Select routine (it was small, nothing game breaking, but still). Basically it never set the Defender Partner bank to anything if you were in a single battle. This wouldn't mean much except that a few of the new commands use DPartner as a bank regardless of whether you are in a Double Battle or not (and thus won't work correctly if that bank isn't set correctly).

I've also updated the Google Drive folders with the new commands I did within the past months. If the command doesn't have a number, it means I used it with the CallASM command. You could technically use any AI command at all with CallASM as long as you know the address of the routine and what the proper arguments are.

When I'm finished, I may upload a patch with all of this stuff complete for Default Fire Red (in case you want to play Fire Red with smarter AI, or don't want to add new moves or whatever). More likely I will just upload the scripts I used and let people look at those.

I changed quite a bit from default FireRed for my game (although most of it is the same) so I would have to alter a few things before creating the patch. It's doable, but I'm not too sure if I will get around to it (or if there is even interest at all).

EDIT: After 503,234,526,544,585 years I have finally finished all of my AI Scripts!!!

I've attached a PDF of all seven scripts that I used, in case anyone is interested in referencing it when making their own scripts.
 

Attachments

  • Trainer AI Scripts.pdf
    1.6 MB · Views: 35
Last edited:
Back
Top