• 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.

Add Pokemon with specific attributes

Chdonga

Pixel Artist/Spriter
24
Posts
12
Years
If it makes any difference, I'm using version 14.
I want to give the player a Pokemon that has specific IVs. I've tried editing the Pokemon before giving it to the player and editing the attributes of the most recent pokemon in the party and both of them just give me a syntax error. The Editing a Pokemon article didn't offer any help and there isn't an event relevant to my needs in the premade essentials file.

This seems like an easy task but I'm at a loss.
 

Radical Raptr

#BAMFPokemonNerd
1,121
Posts
13
Years
This is just an example
Code:
p=PokeBattle_Pokemon.new(PBSpecies::[COLOR="red"]YOUR POKEMON NAME[/COLOR],[COLOR="Lime"]YOUR POKEMON LEVEL[/COLOR],$Trainer)
p.item=PBItems::[COLOR="Red"]YOUR ITEM NAME[/COLOR]
p.form=1
p.iv[0]=20
p.iv[1]=20
p.iv[2]=20
p.iv[3]=20
p.iv[4]=20
p.iv[5]=20
p.calcStats
Kernel.pbAddPokemon(p)
 

Chdonga

Pixel Artist/Spriter
24
Posts
12
Years
I copied your code into a script event and I got another syntax error.
I ran Extendtext like it suggested but nothing happens.

Code:
Exception: RuntimeError
Message: Script error within event 5, map 44 (test):
Exception: SyntaxError
Message: (eval):12:in `pbExecuteScript'compile error
(eval):2: syntax error
(PBSpecies::RIOLU,5,$Trainer)
                    ^
***Line '(PBSpecies::RIOLU,5,$Trainer)' shouldn't begin with '('. Try
putting '(' at the end of the previous line instead,
or using Extendtext.
***Full script:
p=PokeBattle_Pokemon.new
(PBSpecies::RIOLU,5,$Trainer)
p.item=PBItems::ORANBERRY
p.form=1
p.iv[0]=20
p.iv[1]=20
p.iv[2]=20
p.iv[3]=20
p.iv[4]=20
p.iv[5]=20
p.calcStats
Kernel.pbAddPokemon(p)

Interpreter:276:in `pbExecuteScript'
Interpreter:1600:in `command_355'
Interpreter:494:in `execute_command'
Interpreter:193:in `update'
Interpreter:106:in `loop'
Interpreter:198:in `update'
Scene_Map:103:in `update'
Scene_Map:101:in `loop'
Scene_Map:114:in `update'
Scene_Map:68:in `main'
 
1,224
Posts
10
Years
I copied your code into a script event and I got another syntax error.
I ran Extendtext like it suggested but nothing happens.

Code:
Exception: RuntimeError
Message: Script error within event 5, map 44 (test):
Exception: SyntaxError
Message: (eval):12:in `pbExecuteScript'compile error
(eval):2: syntax error
(PBSpecies::RIOLU,5,$Trainer)
                    ^
***Line '(PBSpecies::RIOLU,5,$Trainer)' shouldn't begin with '('. Try
putting '(' at the end of the previous line instead,
or using Extendtext.
***Full script:
p=PokeBattle_Pokemon.new
(PBSpecies::RIOLU,5,$Trainer)
p.item=PBItems::ORANBERRY
p.form=1
p.iv[0]=20
p.iv[1]=20
p.iv[2]=20
p.iv[3]=20
p.iv[4]=20
p.iv[5]=20
p.calcStats
Kernel.pbAddPokemon(p)

Interpreter:276:in `pbExecuteScript'
Interpreter:1600:in `command_355'
Interpreter:494:in `execute_command'
Interpreter:193:in `update'
Interpreter:106:in `loop'
Interpreter:198:in `update'
Scene_Map:103:in `update'
Scene_Map:101:in `loop'
Scene_Map:114:in `update'
Scene_Map:68:in `main'

Always run extendtext.exe when doing events.

Alternatively, you could put the first part like this
Code:
p=PokeBattle_Pokemon.new(
PBSpecies::RIOLU,5,$Trainer)
and it would work.
 

Chdonga

Pixel Artist/Spriter
24
Posts
12
Years
Always run extendtext.exe when doing events.

Alternatively, you could put the first part like this
Code:
p=PokeBattle_Pokemon.new(
PBSpecies::RIOLU,5,$Trainer)
and it would work.

Thank you, it worked!

I had extendtext.exe running in the background, but I never noticed anything different.
 
Back
Top