• Just a reminder that providing specifics on, sharing links to, or naming websites where ROMs can be accessed is against the rules. If your post has any of this information it will be removed.
  • Dawn, Gloria, Juliana, or Summer - which Pokémon protagonist is your favorite? Let us know by voting in our poll!
  • Our friends from the Johto Times are hosting a favorite Pokémon poll - and we'd love for you to participate! Click here for information on how to vote for your favorites!
  • 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
    13
    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.
     
    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)
     
    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'
     
    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.
     
    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