I did that at first, both will work the same though. Mainly I just wanted to know syntax on setting moves, nature, and ability (because everything I've tried hasn't worked yet).
The syntax you've got should work (i.e. for moves and ability). I'm just not sure why you'd make a separate def for this, when you could use the standard trading method and put in a few lines in the event afterwards modifying it. Seems simpler to me, is all (since it's a one-off thing).
Since you mentioned crashing, find the exact line that causes the problem (it's mentioned in the error message). I'm not certain, but it might be the naming line - try using "
yourPokemon.name=_INTL("PUKA")" instead.
As for changing the gender, both of these are interpretations of the personal ID of that Pokémon. Use "
setGender(female)", where "female" is either "
true" or "
false" (to make it female or male respectively). It's used just like "name" and "moves" as you've been using.
Changing the nature is more involved, and would most likely require creating a new def in
PokeBattle_Pokemon (like
setGender has). Remember that you can change a Pokémon's nature in debug mode; this is the code that does so:
Code:
when 4 # Set Nature
commands=[]
25.times do |i|
commands.push(PBNatures.getName(i))
end
[email protected](_INTL("Choose a nature."),commands)
if command>=0
oldgender=pkmn.gender
2000.times do
pkmn.personalID&=0xFFFF0000
pkmn.personalID|=rand(65536)
pkmn.personalID-=pkmn.personalID%25
pkmn.personalID+=command
break if pkmn.gender==oldgender
end
pkmn.calcStats
if pkmn.nature!=command
pbDisplay(_INTL("The Pokémon's nature couldn't be changed."))
else
pbDisplay(_INTL("The Pokémon's nature was changed."))
pbRefreshSingle(pkmnid)
end
end
Tidy that up, make it accept an input of a nature's name, and that should do it. This code was taken from
PokemonScreen, which displays the party screen.