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

[Custom Feature Question] Exchanging specific Pokémon for an Item or Money

13
Posts
3
Years
    • Seen May 16, 2021
    Hello everyone,

    I am quite new to Pokémon Essentials, so I a not sure whether this question is too obvious.

    So for my game I want to have a quest like system, where a NPC ask you to catch a specific Pokémon (like with a certain ability, shiny, level and so on). The player should gift this Pokémon to the NPC and in exchange they will get money and/or rare items.

    How do I do that? I tried to play a bit with the NPC traders, but it does not work well.

    Any ideas?
    Thanks for any help :)
     
    32
    Posts
    4
    Years
    • Seen Sep 19, 2023
    Hi you can use this, give a charizarditex if you have a charizard,

    Code:
    def pbIntercambiosporcosas
       pbChoosePokemon(1,2)
       cancel = pbGet(1)
       pok1 = $Trainer.pokemonParty[pbGet(1)]
    if (pok1.species==6)
    Kernel.pbReceiveItem(PBItems::CHARIZARDITEX,1)    
    else
      Kernel.pbMessage(_INTL("Necesitas un charizard"))
    end
      end
     
    13
    Posts
    3
    Years
    • Seen May 16, 2021
    I tried to do it like the video, but it always gives me this error message:

    ---------------------------
    [Pokémon Essentials version 17.2]

    Exception: RuntimeError

    Message: Script error within event 12 (coords 15,9), map 48 (Test):

    Exception: NoMethodError

    Message: (eval):1:in `pbExecuteScript'undefined method `pbChooseTradeablePokemon' for #<Interpreter:0xc955db0>

    ***Full script:

    pbChooseTradeablePokemon(1,2,
    proc {|pkmn|
    pkmn.isFemale? &&
    isConst?(pkmn.species,PBSpecies,
    :DRAGONAIR)
    })


    Interpreter:243:in `pbExecuteScript'

    Interpreter:1606:in `eval'

    Interpreter:243:in `pbExecuteScript'

    Interpreter:1606:in `command_355'

    Interpreter:494:in `execute_command'

    Interpreter:193:in `update'

    Interpreter:106:in `loop'

    Interpreter:198:in `update'

    Scene_Map:163:in `update'

    Scene_Map:161:in `loop'



    Interpreter:276:in `pbExecuteScript'

    Interpreter:1606:in `command_355'

    Interpreter:494:in `execute_command'

    Interpreter:193:in `update'

    Interpreter:106:in `loop'

    Interpreter:198:in `update'

    Scene_Map:163:in `update'

    Scene_Map:161:in `loop'

    Scene_Map:170:in `update'

    Scene_Map:234:in `main'



    I do not want to initiate a trade, but rather have the NPC check whether I have a specific Pokémon, then erase that Pokémon from Team and receive an item.
     
    13
    Posts
    3
    Years
    • Seen May 16, 2021
    Hi you can use this, give a charizarditex if you have a charizard,

    Code:
    def pbIntercambiosporcosas
       pbChoosePokemon(1,2)
       cancel = pbGet(1)
       pok1 = $Trainer.pokemonParty[pbGet(1)]
    if (pok1.species==6)
    Kernel.pbReceiveItem(PBItems::CHARIZARDITEX,1)    
    else
      Kernel.pbMessage(_INTL("Necesitas un charizard"))
    end
      end

    So how to I integrate it in an NPC event? Sorry, if it is a stupid question...
     
    Back
    Top