- 38
- Posts
- 18
- Years
- Seen Apr 18, 2025
Hey all,
I've been playing around with editing the trainer AI to take more situations into account, and it has been helping it - It's just simple stuff like if the holder has Choice Scarf, they are more likely to Trick, or if the user is an electric type, they are more likely to use Soak. Mostly just stuff copied from the other attacks function codes.
But is there a way to make it ALWAYS use the move I want on the first turn?
Basically, to summarize, I have a Pokemon with Normalize and Skill Swap, that is a ghost type Pokemon. I want the enemy trainer to ALWAYS use Skill Swap first turn if they have Normalize, so I figured just shooting the chance to use it up would basically guarantee it - but it doesn't seem to work that way, no matter how high I put the chance to use it.
Is there a way to see the Debug Logs for how the game does AI Calculations while you are playing? That would help a lot.
Anyway, the code for it is below - Maybe I didn't even do it right. But it definitely worked for some moves. Thanks if anyone knows.
when 0x67
if isConst?(opponent.ability(true),PBAbilities,:WONDERGUARD) ||
isConst?(attacker.ability(true),PBAbilities,:WONDERGUARD)
score-=80
end
if isConst?(attacker.ability(true),PBAbilities,:NORMALIZE)
score+=150
end
if isConst?(opponent.ability(true),PBAbilities,:NORMALIZE)
score-=150
end
if skill>=80
if opponent.ability==attacker.ability ||
(isConst?(opponent.ability(true),PBAbilities,:TRUANT) &&
attacker.pbIsOpposing?(opponent.index)) ||
(isConst?(opponent.ability(true),PBAbilities,:SLOWSTART) &&
attacker.pbIsOpposing?(opponent.index))
score-=90
end
end
score-=40 # don't prefer this move
I've been playing around with editing the trainer AI to take more situations into account, and it has been helping it - It's just simple stuff like if the holder has Choice Scarf, they are more likely to Trick, or if the user is an electric type, they are more likely to use Soak. Mostly just stuff copied from the other attacks function codes.
But is there a way to make it ALWAYS use the move I want on the first turn?
Basically, to summarize, I have a Pokemon with Normalize and Skill Swap, that is a ghost type Pokemon. I want the enemy trainer to ALWAYS use Skill Swap first turn if they have Normalize, so I figured just shooting the chance to use it up would basically guarantee it - but it doesn't seem to work that way, no matter how high I put the chance to use it.
Is there a way to see the Debug Logs for how the game does AI Calculations while you are playing? That would help a lot.
Anyway, the code for it is below - Maybe I didn't even do it right. But it definitely worked for some moves. Thanks if anyone knows.
when 0x67
if isConst?(opponent.ability(true),PBAbilities,:WONDERGUARD) ||
isConst?(attacker.ability(true),PBAbilities,:WONDERGUARD)
score-=80
end
if isConst?(attacker.ability(true),PBAbilities,:NORMALIZE)
score+=150
end
if isConst?(opponent.ability(true),PBAbilities,:NORMALIZE)
score-=150
end
if skill>=80
if opponent.ability==attacker.ability ||
(isConst?(opponent.ability(true),PBAbilities,:TRUANT) &&
attacker.pbIsOpposing?(opponent.index)) ||
(isConst?(opponent.ability(true),PBAbilities,:SLOWSTART) &&
attacker.pbIsOpposing?(opponent.index))
score-=90
end
end
score-=40 # don't prefer this move